Font sizes and bold for different elements of a HoloView plot

The documentation ( says the following elements can be set in terms of font size:

[‘xlabel’, ‘ylabel’, ‘zlabel’, ‘labels’, ‘xticks’, ‘yticks’, ‘zticks’, ‘ticks’, ‘minor_xticks’, ‘minor_yticks’, ‘minor_ticks’, ‘title’, ‘legend’, ‘legend_title’]

And the following command should be used:

hv.Curve([1, 2, 3], label=‘Title’).opts(fontsize={‘title’: 16, ‘labels’: 14, ‘xticks’: 6, ‘yticks’: 12})

But when I try that, for example, for legend: 12 in the fontsize dict on hv.Curve, I get an error message. When I remove legend, I also get errors on xticks and yticks.

Therefore my questions:
a. how to set the font sizes for the different plot elements?
b. how to set certain of those elements to bold or italic or underlined?

It would help if you would post your error message.

But what I noticed, it looks like in your code example you’re using the wrong quotes. You are using ‘ ’, but you should be using: 'quotes' and
If I try this code with the right quotes, it works for me:

hv.Curve([1, 2, 3], label='Title').opts(fontsize={'title': 16, 'labels': 14, 'xticks': 6, 'yticks': 12, 'legend': 12})

(i use holoviews version 1.13.2)

This SO-question also shows different ways of changing font sizes:

I don’t know how to do bold or italic or underlined text.

1 Like

Thank you for the reply. The quotes seem to be changed when copying and pasting into the forum. When I copy your suggestion into my code, I also have an issue with the quotes.

Your code looks ok apart from the quotes; without an MWE and the error message it is kind of hard to help you. But I also suspect the quotes are at fault.

For bold/italic/underlined text, you’d have to change the font itself which seems to be somewhat tricky in bokeh even if possible IIRC.

1 Like