holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.7k stars 402 forks source link

Retina support for matplotlib backend #2410

Open yajiez opened 6 years ago

yajiez commented 6 years ago

It would be nice if holoviews can support retina display using the %output magic:

%output fig='retina'

When working with matplotlib using the inline backend, retina display can be supported by %config magic:

%config InlineBackend.figure_format='retina'

sadly, holoviews ignores this configuration.

If anyone knows how to support retina display when using holoviews with matplotlib, please give me a hint. Thank you very much!

philippjfr commented 6 years ago

For now I'd suggest double the dpi with:

%output dpi=144

jlstevens commented 6 years ago

Not sure it is possible, but maybe we could detect if 'retina' has been set and use that to update the dpi default. Or maybe we should just use a higher default regardless given high resolution displays are becoming more standard?

yajiez commented 6 years ago

Hi @philippjfr @jlstevens, thanks very much for the reply. Using %output dpi=144 will produce a larger figure, if use it combined with %output size=50, them the elements inside the figure become larger. So I'm wondering if there is a way to change the default config of the holoviews.plotting.mpl.renderer.MPLRenderer instance?

kazimuth commented 4 years ago

Any update on how to fix this? I've been poking at it but InlineBackend.figure_format is itself kinda magic so i'm not really sure how to communicate exactly what it's doing to holoviews. it's also possible there's some unique holoviews stuff going on when computing the figure size, so this would need to be re-implemented?

orome commented 3 years ago

Is there a way to do this yet?

Currently

%config InlineBackend.figure_format = 'retina'
hv.output(s, backend='matplotlib')

fails to produce a retina figure.

jlstevens commented 3 years ago

@philippjfr Would it make sense to support hv.output(dpi='retina') which would be respected by the matplotlib backend (and the bokeh/plotly backends too if it makes sense?)

philippjfr commented 3 years ago

Doesn't make sense for the others, but still seems sensible. Indeed I think if you're on the matplotlib backend I think we already support hv.output(dpi=144) which should achieve this. Would be happy to see retina as an alias though.

orome commented 2 years ago

Doesn't make sense for the others, but still seems sensible. Indeed I think if you're on the matplotlib backend I think we already support hv.output(dpi=144) which should achieve this. Would be happy to see retina as an alias though.

@philippjfr That just makes figures bigger.

maximlt commented 2 years ago

Just writing notes here after look at this for a little while. The HoloViews Pane of Panel as now a high_dpi parameter that is set to True by default. However: