question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to make all fontsizes in your plot with the same scale larger (like in seaborn)

See original GitHub issue

It would be great in Holoviews if you would have a nice, easy and fast way to make your plot more readable without having to specify every fontsize for every part of the plot separately.

Seaborn has the option to scale all your fontsizes (such as title, xlabel, ylabel, xticks etc) with the same factor, like this:

import seaborn as sns
sns.set(font_scale=2.0)

This will not set all fontsizes to the same size, but rather multiply every separate fontsize with the same factor.

Currently you have to do in Holoviews:

my_plot.opts(fontsize={'title': 20, 'yticks': 14, 'xticks': 14, 'xlabel': 16})

This is great if you want to define your plot precisely, but not if you want to rapidly change your plot.

(solution could be something like my_plot.opts(fontscale=2.0) or hv.output(fontscale=200), but these are just suggestions.)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ahuang11commented, Nov 29, 2019

Turns out it’s harder to implement than expected since holoviews doesn’t have the default fontsizes available in self (https://github.com/holoviz/holoviews/blob/master/holoviews/plotting/plot.py#L512 simply returns an empty dict if None) and I think to get the defaults, you need to either hardcode the defaults or render the figure and painstakingly retrieve the attributes (p.title.text_fontsize, p.xlabel.axis_label_text_font_size, etc) for multiple backends.

One workaround for bokeh is doing fontsize={'ticks': '200%', 'labels': '200%'}

0reactions
ahuang11commented, Nov 29, 2019

I think we’ll probably have to do this sadly, each backend will have to implement a method that returns the defaults.

As in hardcode the defaults or render the plots each time to get the default?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fine control over the font size in Seaborn plots - Stack Overflow
My font size in my paper is 9pt and I would like to make sure the font size in my plots are either...
Read more >
4 Different Methods for Changing the Font Size in Python ...
On a plot created by these 3 functions, we can change the font sizes of axis labels using the set_axis_labels function.
Read more >
How to Change Font Size in Seaborn Plots (With Examples)
You can use the following basic syntax to change the font size in Seaborn plots: import seaborn as sns sns.set(font_scale=2).
Read more >
How to change Seaborn legends font size, location and color?
This is one of the easiest methods to change the font size of any Seaborn legends, in this we just have to pass...
Read more >
Controlling figure aesthetics — seaborn 0.12.1 documentation
You can also independently scale the size of the font elements when changing the context. (This option is also available through the top-level...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found