holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.01k stars 99 forks source link

Themes: Make it easy to create beautiful plots with hvPlot #834

Open MarcSkovMadsen opened 1 year ago

MarcSkovMadsen commented 1 year ago

Currently there is no easy (i.e. one-line of code) to make your hvPlot beautiful.

And (in my opinion) the existing theme has not been attractive for a decade. The colors, fonts and other details needs a modernization. I believe the lots of users will drop a plotting library if they cannot easily create great looking plots.

hvplot

I would like a oneliner that can see the theme used for hvPlot.

.set_theme("made_up")

In my dream world the same theme made_up theme would work across backends and across hvplot, HoloViews and Panel.

I believe especially having a beautiful theme for Matplotlib+Bokeh backends in light + dark mode would be really, really valuable. As there are already many Matplotlib themes out there it might be possible to convert one of these to a Bokeh theme. The existing bokeh themes are ugly - don't use them.

I would also like the ability to specify one accent color similarly to the Fast templates, potentially a color palette and font to enable users to easily use their organizations style. For private fonts I would need to the ability to refererence a css style sheet in hvPlot.

Personally I would like this for work and my private life - for example whenever I demo hvPlot and HoloViews and try to communicate how powerful it is. Its just difficult because you cannot get over the initial hurdle of the output not looking awesome by default. People just don't see the rest.

A simple minimal solution might to be Gallery notebook examples of how to style each backend.

While we are at it the Bokeh default tool should also be changed to zoom. I see users being confused all the time because it is not the default. And double-click should zoom out. And there is no need to display hover tool icons. This would all significantly improve the user experience.

MarcSkovMadsen commented 1 year ago

There is some discussion with useful information here. But you can see how painful it is and how you have to use Panel to get an end to end solution supporting custom fonts.

https://discourse.holoviz.org/t/how-do-i-use-custom-font-in-holoviews/303/11

MarcSkovMadsen commented 1 year ago

For example I can easily change the color map for bar charts. But the hover color and color user for the selected tools is still blue.

It does not look appealing and as something you would present to any other than you self and your data colleagues.

image

Being able to easily select a better theme including a few variables like font, accent color and color map would make a world of a difference.

We have that for the Panel FastListTemplate. Must be possible to carve out.

maximlt commented 1 year ago

And (in my opinion) the existing theme has not been attractive for a decade.

I assume you're talking about Bokeh since hvPlot is only a few years old. Did you open a feature request on Bokeh's Github to improve its theme? That would benefit a lot of people, not just hvPlot's users.

Its just difficult because you cannot get over the initial hurdle of the output not looking awesome by default. People just don't see the rest.

That is not really the experience I've got. For instance, Matplotib plots aren't particularly beautiful by default, yet there's millions of Matplotlib plots out there.

I think the source of your tension using hvPlot is that you are using it just to make beautiful plots. I think hvPlot and HoloViews should be improved to make plots that are more beautiful and publication-ready, and that the documentation should be improved to show how to do that. But what they excel at is data exploration, which is the step in a data analysis workflow where you're trying to understand the data and should not (really, you should not) focus on how things look, as it can only distract you from your goal.

@jlstevens is there a way in HoloViews to define themes?

jlstevens commented 1 year ago

For the most part, HoloViews simply exposes whatever theming support exists in the plotting backend. For instance, Bokeh plots can have bokeh themes applied.

Of course, HoloViews has some of its own defaults that can be overridden as desired - if you wanted to you could collect yours preferences together and override some global style/plotting options. As a whole, we haven't really done this much though, but of course if someone were to make a nice alternative theme, we would be very happy to consider making it available to everyone!

MarcSkovMadsen commented 1 year ago

Its actually not only the theme.

It requires css as well for which i dont know a mechanism to inject.

And i believe it should be possible to quickly share the resultat of exploration in a nice looking and functioning way with colleges, managers and other stakeholders.

Furthermore we also need the web site to be nice looking to appeal to users. And the same when used in blogs, social media and when answering users on discourse.

Right now the web site reference examples looks like exploration. There is no easy way to get to a nice looking end result.

It's like saying you can use hvplot and HoloViews for exploration, but if you want an end result to share you need to rewrite using another framework.