Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import plotly.graph_objs as go
  2. import plotly
  3. import plotly.io as pio
  4. trace0 = go.Scatter(
  5. x=[7],
  6. y=[7.5],
  7. )
  8. data = [trace0]
  9. layout = {
  10. 'xaxis': {
  11. 'zeroline': False,
  12. 'dtick': 1,
  13. },
  14. 'yaxis': {
  15. 'zeroline': False,
  16. 'dtick': 1,
  17.  
  18. },
  19. 'shapes': [
  20. {
  21. 'type': 'line',
  22. 'x0': 5,
  23. 'y0': 0,
  24. 'x1': 5,
  25. 'y1': 10,
  26. 'line': {
  27. 'width': 1,
  28. },
  29. },
  30. {
  31. 'type': 'line',
  32. 'x0': 0,
  33. 'y0': 5,
  34. 'x1': 10,
  35. 'y1': 5,
  36. 'line': {
  37. 'width': 1
  38. },
  39. },
  40. ]
  41. }
  42. fig = {
  43. 'data': data,
  44. 'layout': layout,
  45. }
  46. plotly.offline.plot(fig)
  47. pio.write_image(fig, 'images/test.png')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement