ColorBy function does not manage color legend
When you are changing the field variable you are coloring a mesh by in the GUI, the scalar bar annotation is updated to give you a color legend with the displayed field. However, when you use the Python
ColorBy function, which is supposed to set up the coloring in the same way as the GUI, the color legend is not updated. To replicate, do the following:
- Load disk_out_ref.ex2. Turn on all variables. Apply.
- Open the Python Shell.
- Type the command
ColorBy(GetRepresentation(), ('POINTS', 'Pres'))
The points get colored correctly, but the color bar is not changed to the new coloring. If the view had a color bar in the view before calling
ColorBy, it sticks around after the colors change, which makes it hard to get rid of. The correct behavior is to get rid of color bars that are not used anymore and add the one that is.