Closed jtamerius closed 4 years ago
Hi @jtamerius,
It sounds like Latex rendering mode is somehow being triggered. But this should only happen if the first and last characters are $
.
import plotly.io as pio
import plotly.graph_objects as go
pio.templates.default = None
pio.show(
go.Figure(data=go.Scatter(y=[1, 3, 2], name="$Hello", showlegend=True)),
renderer="png", engine="kaleido"
)
pio.show(
go.Figure(data=go.Scatter(y=[1, 3, 2], name="$Hello$", showlegend=True)),
renderer="png", engine="kaleido"
)
If you only have a leading $
, and you're seeing an issue, could you provide an example that reproduces it?
Regardless, a workaround is to use the HTML code for the dollar symbol (see http://cactus.io/resources/toolbox/html-currency-symbol-codes)
pio.show(
go.Figure(data=go.Scatter(y=[1, 3, 2], name="$Hello$", showlegend=True)),
renderer="png", engine="kaleido"
)
You caught me. I didn't provide the entire label in my post because I didn't think it mattered. My bad. The entire label is '$50k-$100k'. The solution you have provided works -- thanks!
Hey All,
I am using Plotly and Kaleido to export a png. The legend text labels begin with dollar signs such as '$50k' but this is special character (or something) and causes the text to become smaller font, truncated and italicized. If I use an escape character such as '\$50k' the text label stays '\$50k'. If I do r'$50k' it works when I output to html but not png (converts to smaller font, etc). Any help on getting around this would be much appreciated!
Thanks, James