Plotly: Bold Axis Labels

Created on 2 Dec 2015  路  5Comments  路  Source: ropensci/plotly

Am I just blindfolded, or is ther no way to set the axis tick labels bold?

Thanks,
Bob

Most helpful comment

@robertleitner - Actually, plotly.js supports a subset of html labels. So, use <b>bold text</b>

Plotly uses a subset of HTML tags to do things like newline (<br>), bold (<b></b>), italics (<i></i>), hyperlinks (<a href='...'></a>). Tags <em>, <sup>, <sub> <span> are also supported.

Reference: https://plot.ly/r/reference/

All 5 comments

I don't think there is currently. Feel free to request this over at https://github.com/plotly/plotly.js

@robertleitner - Actually, plotly.js supports a subset of html labels. So, use <b>bold text</b>

Plotly uses a subset of HTML tags to do things like newline (<br>), bold (<b></b>), italics (<i></i>), hyperlinks (<a href='...'></a>). Tags <em>, <sup>, <sub> <span> are also supported.

Reference: https://plot.ly/r/reference/

@chriddyp Plot.ly for Python uses this as well. Typing x = '<b>Title</b>' will bold x.

I found a workaround today which does not need you to set the tags when generating the tick labels, but setting it after the plot has been generated.
You can just update your ticklabels with a suffix and a prefix which recognizes html tags.

This worked for me:
fig.update_yaxes(tickangle = -90,tickprefix="<b>",ticksuffix ="</b><br>")

I found this thread when searching for a souloution and wanted to leave my answer somewhere for people to find.

Great idea with the tickprefix and ticksuffix tags!

fig.update_yaxes(tickangle = -90,tickprefix="<b>",ticksuffix ="</b><br>")

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GegznaV picture GegznaV  路  3Comments

escorial82 picture escorial82  路  6Comments

kickbox picture kickbox  路  3Comments

fabiangehring picture fabiangehring  路  4Comments

viniciusvgp picture viniciusvgp  路  5Comments