-
Hi all, I recently started playing around with xarray, and encountered the case where I'd like to change the labels of the axes for a 2D plot. Of course, for changing the x,y labels I simply use A minimal working example: import matplotlib.pyplot as plt
ax = plt.figure().gca()
y = ds["response_amplitude"] # ds is my xarray dataset
y.plot(ax=ax)
ax.set_xlabel("some x label") Not sure how I would access the colormap object here. I'd really appreciate any help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@paniash there are various ways to do this, for example as shown in the docs here https://docs.xarray.dev/en/stable/user-guide/plotting.html#other-features y.plot(cbar_kwargs={"label": "my custom label"}, If you looked other places in the docs and expected to find this information, it'd be helpful to know. |
Beta Was this translation helpful? Give feedback.
@paniash there are various ways to do this, for example as shown in the docs here https://docs.xarray.dev/en/stable/user-guide/plotting.html#other-features
If you looked other places in the docs and expected to find this information, it'd be helpful to know.