[Qgis-developer] Call matplotlib from QGIS

gene martin.laloux at gmail.com
Sun Feb 24 00:14:58 PST 2013


If your backend (backend: Qt4Agg)  is not specified in the file matplotlibrc
(see  Customizing matplotlib
<http://matplotlib.org/users/customizing.html?highlight=matplotlibrc>  )

you must first open a matplotlib figure/window:

   import matplotlib.pyplot as plt
   fig = plt.figure()
   ax = fig.gca()
   plot([1,2,3,4])
   plt.show()

or use pylab

   import pylab
   pylab.plot([1,2,3,4])
   pylab.show()


see 
http://www.portailsig.org/sites/default/files/images/illustration/python/couches3d/qgismatplotlibok.png
<http://www.portailsig.org/sites/default/files/images/illustration/python/couches3d/qgismatplotlibok.png>  
for an example of using matplotlib in the Python console.





--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Call-matplotlib-from-QGIS-tp5036364p5036425.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list