Skip to main content

Home/ Python Programming/ Group items tagged matplotlib

Rss Feed Group items tagged

reckoner reckoner

Plotting NaNs in Matplotlib (matplotlib-users) - 0 views

  • Your example works as you describe on recent matplotlib versions. I suspect you are using an old one. The preferred way of handling missing points in numpy, and therefore in matplotlib and pylab, however, is via masked arrays.import pylabimport numpy as npfrom numpy import maa = [1,2,3,4,5]b = np.array([6,2,np.nan,1,9])bm = ma.masked_where(np.isnan(b), b)pylab.plot(a,bm)pylab.show()There are many other examples of masked array use in the examples directory of the matplotlib distribution.EricFernando Abilleira wrote:> Dear sourceforge community,> > I come from a Matlab environment so I am used to plotting matrices that > contain NaN elements. This is very useful because in some cases one > doesn't have data for the entire matrix. If one tries plotting the data, > the NaN elements won't be plotted.
reckoner reckoner

pyscripter - Using matplotlib with PyScripter - 0 views

  • interpreter:>>>import matplotlib>>>matplotlib.interactive(True)>>>matplotlib.use("WXAgg")>>>from matplotlib.pylab import *>>>plot([1,2,3])>>>xlabel('time (s)') 
Mario Antonio Herrero Machado

Acerca de Pybonacci « Pybonacci - 0 views

  •  
    Somos unos apasionados de Python que nos hemos decidido a rellenar el que pensamos que es un hueco importante en la blogosfera hispana: el uso de Python para aplicaciones científicas. Nuestra intención es escribir con regularidad sobre cómo podemos utilizar este lenguaje de programación fantástico que es Python para resolver problemas en ciencia e ingeniería, utilizando librerías como NumPy, SciPy, matplotlib, SymPy y muchas más. También traduciremos artículos escritos en otros idiomas que nos resulten interesantes, mostraremos pequeñas recetas y escribiremos reseñas sobre programas o bibliotecas que nos resulten interesantes.
reckoner reckoner

Python Introduction to Python PyGTK/Glade and Matplotlib Tutorial - 0 views

  •  
    In this tutorial we will create a little application written in PyGTK and we will use Glade to create the graphical use interface (GUI). Another feature of this tutorial is that we will create a bar chart with Matplotlib. Eventually it should look like so
reckoner reckoner

XGraph plot dot showing multiple edges - networkx-discuss | Google Groups - 0 views

  • For example edge labels can be added using matplotlib "text" objects like this: import networkx as nx import pylab as plot K=nx.XGraph(name="Konigsberg", multiedges=True, selfloops=False) K.add_edges_from([("A","B","Honey Bridge"),     ("A","B","Blacksmith's Bridge"),     ("A","C","Green Bridge"),     ("A","C","Connecting Bridge"),     ("A","D","Merchant's Bridge"),     ("C","D","High Bridge"),     ("B","D","Wooden Bridge")]) pos=nx.spring_layout(K) nx.draw_nx(K,pos) xa,ya=pos['A'] xb,yb=pos['B'] plot.text((xa+xb)/2,(ya+yb)/2,"Blacksmith's Bridge") plot.show() With a little work you can get the label rotated and exactly how you want it positioned.  You can also set the node positions directly in the "pos" dictionary above.
1 - 6 of 6
Showing 20 items per page