Closed ustropics closed 1 day ago
This is coming from xarray's default plotting behavior if I remember correctly. The CRS object is stored in Satpy-created DataArray objects in .coords["crs"]
. If forcing the title on axis after the .imshow
call doesn't work, then it may not be an axis title but a figure title. In that case it would be fix.suptitle("TITLE")
to change that title. But...I'm not sure, your image looks like an axis title.
At the moment I don't see anything obvious in the xarray code that is setting the title. I'll have to do more digging, but please try the figure title or ensure that your changing of the axis title is happening after imshow
and let me know how it goes.
Quick test shows that this works:
In [4]: img = scn["C01"].plot.imshow()
In [5]: img.axes.set_title("TEST")
Out[5]: Text(0.5, 1.0, 'TEST')
In [6]: img.figure.show()
Ok, found it. It is controlled overall by the add_labels
keyword argument:
However, if you set that to False
then your axis ticks will be all wrong. The method it uses to come up with a title is here:
It is basically combining all 1 dimensional coordinate variables which for Satpy is typically just the single crs
coordinate. So you can do two things:
ax.set_title
after the imshow
call and before showing/saving it.del scn["C01"].coords["crs"]
.Thanks! Both methods worked, I appreciate the quick reply.
Glad it was easy enough to figure out!
I am getting an issue where my crs is printing to the title of the figure it appears. Below is my code (where recipe is the composite name). Perhaps using image.plot.imshow is causing the issue? I've tried resetting the title with ax but it doesn't work.