Toggle color legend visibility code

I have the code to visualize some netcdf files.
Can someone tell the code on how to change the color legend.

I suppose that you are using python and not the GUI ?

What do you mean by “change the color legend” ? Please be more precise.

Yes I am using python. I want to use gray scale color bar. I wanted to know the syntax for it. If not the color bar, how can i change the color of the object ?

lut = GetColorTransferFunction("YourVariable")
lut.ApplyPreset('X Ray', True)

Use tools -> Start trace in the GUI when you do not know how to do something in python.

1 Like

okay thankyou.