Replies: 1 comment 4 replies
-
Hi @zmoon Thanks for the feedback! We've implemented You should be able to set the DPI when creating the figure, which would only apply to that one without affecting others. fig, ax = plt.subplots(
figsize=(5, 10),
dpi=150, # set DPI for the current figure
subplot_kw={"projection": ccrs.PlateCarree()}, constrained_layout=True
) I can't immediately think of a way to produce sharper images without blowing up the image. With our naitive plotting API (using HoloViews/Datashader), the pixel ratio parameter is used to control the effective resolution. ![]() ![]() Pinging @kafitzgerald and @anissa111 since they have done more work with MPL than I have, so they might know a better approach. I do like the idea of adding some context in the user guide notebook. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Since
.to_raster()
1 doesn't expose any options, it seems that currently the only way to make it try harder and produce a sharper image (assuming you have high-resolution data) is to set the figure DPI to something higher than the default (100) before calling.to_raster()
. This is a bit annoying if you're using Jupyter though, because unless you reset the figure DPI to the default afterwards, it will display the figure blown up.Anyway, I feel like this method should at least be mentioned in https://uxarray.readthedocs.io/en/latest/user-guide/mpl.html#rasterization. And/or option(s) could be added to
.to_raster()
.Footnotes
thanks for adding this, have been enjoying it ↩
Beta Was this translation helpful? Give feedback.
All reactions