You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ax.set_xlabel("x units") and ax.set_ylabel("y units") methods. How do I do that for the colormap?
A minimal working example:
importmatplotlib.pyplotaspltax=plt.figure().gca()
y=ds["response_amplitude"] # ds is my xarray datasety.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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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
ax.set_xlabel("x units")
andax.set_ylabel("y units")
methods. How do I do that for the colormap?A minimal working example:
Not sure how I would access the colormap object here. I'd really appreciate any help.
Beta Was this translation helpful? Give feedback.
All reactions