off-screen rendering

26 views
Skip to first unread message

Jon Christopher

unread,
Jul 14, 2016, 9:03:09 PM7/14/16
to pyqtgraph
For its efficiency, I'd like to use pyqtgraph rather than matplotlib, but in a headless environment.  
In matplotlib, I can create and save plots to a file without having a window, i.e. use off-screen rendering, and display that to a file.


Can I do this with pyqtgraph?  For the simplest possible plot example:


import numpy as np

import pyqtgraph as pg


data = np.random.normal(size=1000)

pg.plot(data, title="Simplest possible plotting example")


would it be possible to do something like:



data = np.random.normal(size=1000)

pg.render(data, title="Simplest possible plotting example","file.jpg")



Or alternately:


lay = pg.GraphicsLayout()

lay.addPlot(data)

lay.setSize(1000,1000)

lay.save("myfile.jpg")




If so, how?



Thanks!
-Jon

Reply all
Reply to author
Forward
0 new messages