-
When using iris.quickplot.pcolormesh, a colorbar is created automatically. How can I specify keywords arguments for that colorbar, like I can do when I create a colorbar manually and add it to a plot created with iris.plot.pcolormesh? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Or is there some better way to solve it in than the way I’m trying to solve it in while still getting the same behavior? |
Beta Was this translation helpful? Give feedback.
-
Which keywords do you want to pass? Some properties of the import iris.quickplot as qplt
mesh = qplt.pcolormesh(my_data)
mesh.colorbar.set_label('stuff') For full control, I think the right way is to use |
Beta Was this translation helpful? Give feedback.
-
Thanks; this is probably what I was looking for since I'm plotting maps, but the code for adding x- and y-labels could definitely be useful too. How does Iris know when a map is being plotted? Does is just check whether the two axis coordinates are spatial coordinates? |
Beta Was this translation helpful? Give feedback.
-
Thank you both anyway for your answers. I think I have my code the way want it now. |
Beta Was this translation helpful? Give feedback.
The above snippet gives the plot title and the labels for the x- and y-axis, which quickplot also adds automatically (although the x- and y- labels are skipped for maps). The colorbar label is defined here:
iris/lib/iris/quickplot.py
Lines 66 to 69 in 3e1e80e