Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import plotly.graph_objs as go
- import plotly
- import plotly.io as pio
- trace0 = go.Scatter(
- x=[7],
- y=[7.5],
- )
- data = [trace0]
- layout = {
- 'xaxis': {
- 'zeroline': False,
- 'dtick': 1,
- },
- 'yaxis': {
- 'zeroline': False,
- 'dtick': 1,
- },
- 'shapes': [
- {
- 'type': 'line',
- 'x0': 5,
- 'y0': 0,
- 'x1': 5,
- 'y1': 10,
- 'line': {
- 'width': 1,
- },
- },
- {
- 'type': 'line',
- 'x0': 0,
- 'y0': 5,
- 'x1': 10,
- 'y1': 5,
- 'line': {
- 'width': 1
- },
- },
- ]
- }
- fig = {
- 'data': data,
- 'layout': layout,
- }
- plotly.offline.plot(fig)
- pio.write_image(fig, 'images/test.png')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement