Guest User

Untitled

a guest
Mar 18th, 2017
1,811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. from PyQt5.QtWebKitWidgets import QWebView
  2. import plotly
  3. import plotly.graph_objs as go
  4.    
  5. x1 = [10, 3, 4, 5, 20, 4, 3]
  6.    
  7. trace1 = go.Box(
  8. x = x1)
  9.    
  10. layout = go.Layout(
  11. showlegend = True)
  12.    
  13.    
  14. data = [trace1]
  15. fig = go.Figure(data=data, layout = layout)
  16.    
  17. fn = '/home/matteo/plot.html'
  18. plotly.offline.plot(fig, filename = fn, auto_open = False)
  19.    
  20. view = QWebView()
  21. view.load(QUrl.fromLocalFile(fn))
  22. view.show()
Advertisement
Add Comment
Please, Sign In to add comment