Skip to content

Instantly share code, notes, and snippets.

@Miladiouss
Last active October 7, 2022 00:34
Show Gist options
  • Save Miladiouss/754a660425f7694b601a21361ee54a66 to your computer and use it in GitHub Desktop.
Save Miladiouss/754a660425f7694b601a21361ee54a66 to your computer and use it in GitHub Desktop.
Plotting on a 1-D number axis.
import plotly.graph_objects as go
fig = go.Figure()
xdata = [(1 - 1/i) for i in range(1, 15)]
fig.add_trace(go.Scatter(
x=xdata, y=len(xdata)*[0], mode='markers', marker_size=10, marker_color='red'
))
fig.update_xaxes(showgrid=False)
fig.update_yaxes(showgrid=False,
zeroline=True, zerolinecolor='black', zerolinewidth=3,
showticklabels=False)
fig.update_layout(height=200, plot_bgcolor='white')
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment