plotly / Kaleido

Fast static image export for web-based visualization libraries with zero dependencies
Other
367 stars 36 forks source link

Negative sign (dash – ) renders incorrectly for SVG outputs #190

Open Miladiouss opened 1 year ago

Miladiouss commented 1 year ago

fig.show('svg') renders correctly on a local Jupyter Notebook but when pushed to GitHub, some charecters such as hyphen for negative sign on axes are rendered as

Related Issues: 4118

import plotly.graph_objects as go

xs_blue, ys_blue = np.random.multivariate_normal([0, 0], [[1, 0.5], [0.5, 1]], 1_000).T
xs_red, ys_red = np.random.multivariate_normal([1, 1], [[1, -0.5], [-0.5, 1]], 1_000).T

fig = go.Figure()

fig.add_trace(go.Scatter(
    x=xs_blue,
    y=ys_blue,
    mode='markers',
    marker=dict(color='lightblue', size=3.5, opacity=.75), 
    name='Negative',
))

fig.add_trace(go.Scatter(
    x=xs_red,
    y=ys_red,
    mode='markers',
    marker=dict(color='orange', size=3.5, opacity=.75),
    name='Positive',
))

fig.layout.title = "Minus -1 vs Dash –1"
fig.layout.xaxis.title = r"$x$"
fig.layout.yaxis.title = r"$y$"

fig.layout.xaxis.range = (-5, +5)
fig.layout.yaxis.range = (-5, +5)

fig.show('svg')

SVG in Local Jupyter SVG on GitHub

Miladiouss commented 1 year ago

I have created a ticket on GitHub (for Microsoft):

https://support.github.com/ticket/personal/0/2310382

gvwilson commented 3 months ago

Thanks for your interest in Kaleido. We are currently working on an overhaul that might address your issue - we hope to have news in a few weeks and will post an update then. Thanks - @gvwilson