# Use block names in legend

**URL:** https://discourse.paraview.org/t/use-block-names-in-legend/10548
**Category:** ParaView Support
**Created:** [October 19, 2022, 10:00am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548 "2022-10-19T10:00:03Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Jeremie](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/e47c2d/32.png) [@Jeremie](https://discourse.paraview.org/u/Jeremie)
#### Post date: [October 19, 2022, 10:00am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/1 "2022-10-19T10:00:03Z")

</div>

Hi,

is there a way to use block names in the legend instead of the default (block = 1), (block = 2), etc…

Best,  
Jérémie

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 20, 2022, 1:13am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/2 "2022-10-20T01:13:37Z")

</div>

Hi @Jeremie

Which legend are you referring to ? Can you share a screenshot ?

Best,

---

<div class="post-metadata">

### Author: ![Jeremie](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/e47c2d/32.png) [@Jeremie](https://discourse.paraview.org/u/Jeremie)
#### Post date: [October 21, 2022, 4:03pm UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/3 "2022-10-21T16:03:30Z")

</div>

Hi,

Here’s an example  
[example.zip](https://discourse.paraview.org/uploads/short-url/j3cDPGXFNuOeJ1Qyuqk5ZcA1Td5.zip) (36.6 KB)

I would like to plot the the velocity component “vz” over time, contained in the col-cds files, for both cases (with and without force) on the same graph. Ideally with a legend that has something like vz (with force) and vz (without force).

If I import each sequence of files and plot, I cannot differentiate the two graphs in the legend:

 ![noblock](https://discourse.paraview.org/uploads/default/original/2X/9/95bc42d95f696b1dd67b584884a1398dd472e355.png)

If I group them I can only show the number of the block in the legend:

 ![block](https://discourse.paraview.org/uploads/default/original/2X/6/67cb2db59566f8197cc16ca05685361da46087cc.png)

Best,  
Jérémie

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 24, 2022, 2:02am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/4 "2022-10-24T02:02:50Z")

</div>

Hi @Jeremie

In ParaView 5.11, GroupDataSets lets you rename the blocks if you want to, this should fix your issue.

Best,

---

<div class="post-metadata">

### Author: ![Jeremie](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/e47c2d/32.png) [@Jeremie](https://discourse.paraview.org/u/Jeremie)
#### Post date: [October 24, 2022, 9:27am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/5 "2022-10-24T09:27:43Z")

</div>

That’s good to hear. I will update to version 5.11

I am still not sure how to have with two different colors for each vz, in a way that is consistent, from a single color palette rather than 2 different color palettes.

Best  
Jérémie

---

<div class="post-metadata">

### Author: ![Jeremie](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/e47c2d/32.png) [@Jeremie](https://discourse.paraview.org/u/Jeremie)
#### Post date: [October 24, 2022, 10:50am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/6 "2022-10-24T10:50:48Z")

</div>

Hi @mwestphal

I have downloaded Paraview 5.11. It is indeed possible to change the block names but the name on the legend are still “block = 1” etc…

Best,  
Jérémie

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 24, 2022, 11:01am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/7 "2022-10-24T11:01:15Z")

</div>

It is working great here, please share your data

---

<div class="post-metadata">

### Author: ![Jeremie](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/e47c2d/32.png) [@Jeremie](https://discourse.paraview.org/u/Jeremie)
#### Post date: [October 24, 2022, 12:20pm UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/8 "2022-10-24T12:20:33Z")

</div>

The data is the same as the one I uploaded with my 2nd message.

Group them up, rename each block and use the “Plot selection over time” filter, the legend will show something like this (bottom right)

 ![example](https://discourse.paraview.org/uploads/default/original/2X/2/2f777ea97704ca534b807cb788fcefeb10068859.png)

You can see up right in the spreadsheet that the block names have been changed.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 25, 2022, 1:09am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/9 "2022-10-25T01:09:27Z")

</div>

This is caused by PlotSelectionOverTime. You want to Plot Over Time first, two times, and then use GroupDataSet.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 25, 2022, 1:10am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/10 "2022-10-25T01:10:10Z")

</div>

That being said, PlotOverTime should not rename block like that, this is an issue that should be fixed, feel free to open it: [https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues)

---

<div class="post-metadata">

### Author: ![Jeremie](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/e47c2d/32.png) [@Jeremie](https://discourse.paraview.org/u/Jeremie)
#### Post date: [October 25, 2022, 2:07pm UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/11 "2022-10-25T14:07:33Z")

</div>

I am trying to do as you suggest.

I import my two series of files (still the same) and create the PlotDataOverTime datasets using Plot Data Over Time.

Then I group the two PlotDataOverTime datasets into one group using Group Datasets.

 ![Screenshot from 2022-10-25 16-03-33](https://discourse.paraview.org/uploads/default/original/2X/f/fef7d35adc554282d49b12dae3f13b32f987beda.png)

 ![Screenshot from 2022-10-25 16-04-48](https://discourse.paraview.org/uploads/default/original/2X/b/bca221a61053b436890cecfad324bc568302dfe2.png)

From there, I don’t see how to plot both lines on the same chart. As you can see above, I selected both PlotDataOverTime1 and PlotDataOverTime2 but only one appears on the line chart.

The problem of the names appearing in the legend remains unsolved too. Because if I change the names of the blocks that does not change the names in the legend.

If you have a solution, I would appreciate if you could explain step by step how you do it.

Best,  
Jérémie

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 26, 2022, 2:03am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/12 "2022-10-26T02:03:15Z")

</div>

Well, GoupDataSets lets you rename the blocks, did you try it in your last example ?

---

<div class="post-metadata">

### Author: ![Jeremie](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/e47c2d/32.png) [@Jeremie](https://discourse.paraview.org/u/Jeremie)
#### Post date: [October 26, 2022, 9:04am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/13 "2022-10-26T09:04:33Z")

</div>

Yes, I have tried and it does not change anything. If the block names mattered, the legend would indicate “PlotOverTime1” and “PlotOverTime2” instead of “normv (id=0)” or “normv (stats)” in the first place.

 ![Screenshot from 2022-10-26 11-02-13](https://discourse.paraview.org/uploads/default/original/2X/e/e61c5fbd1d1e7d09c5a37a8219e664e8f922eac5.png)

Plus, grouping after Plotting over time doesn’t seem to allow the two graphs to be shown on the same line chart

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 27, 2022, 1:26am UTC](https://discourse.paraview.org/t/use-block-names-in-legend/10548/14 "2022-10-27T01:26:51Z")

</div>

You are right, there is no way to do that (apart using some python programmable filter to handle the block renamming. I think there is an issues to fix:  
[https://gitlab.kitware.com/paraview/paraview/-/issues/21626](https://gitlab.kitware.com/paraview/paraview/-/issues/21626)
