Matplotlib is a plotting library for Python, built on NumPy and often used interactively with IPython. Its compact "pylab" interface is similar to the plotting functions of MATLABĀ®.

learn more… | top users | synonyms (2)

1
vote
0answers
8 views

Histogram from data which is already binned, I have bins and frequency values

All the matplotlib examples with hist() generate a data set, provide the data set to the hist function with some bins (possibly non-uniformly spaced) and the function automatically calculates and then ...
0
votes
1answer
7 views

matplotlib: plot and get_color?

Is it possible to get a list of colors used in a plot? Consider this example: line1 = ax1.plot(x1,y1) line2 = ax1.plot(x2,y2) I now how to set the color plt.setp(line1,'color','red') ...
3
votes
1answer
28 views

Creating tables in matplotlib

I'm trying to make a table using matplotlib and I've managed to get my data in but I'm struggling with the final formatting. I need to edit the size of the figure to include all my data as some is ...
0
votes
1answer
13 views

How to set the matplotlib figure default size in ipython notebook?

I use "$ipython notebook --pylab inline" to start the ipython notebook. The display matplotlib figure size is too big for me, and I have to adjust it manually. How to set the default size for the ...
2
votes
1answer
24 views

Python matplotlib - updating data during animation in Conway's Game of Life

The code below creates an animation for Conway's Game of Life using Python and matplotlib. I am not sure why I have to do: grid = newGrid.copy() mat.set_data(grid) Instead of simply: ...
0
votes
0answers
28 views

Python quit unexpectedly when trying to make a simple graph

I am running Mac OS X 10.8.4 and Python 2.7. I just wanted to make a scatter plot graph in python. It runs completely fine until I begin to put in the lines about graph. So when I include window = ...
0
votes
1answer
19 views

wxPython scrollbar doesn't stick

I've been playing with this cookbook example to make a scrollable matplotlib plot with wxPython. However, when I run this code on my Windows 7 machine at work, the scrollbar doesn't seem to work ...
0
votes
0answers
24 views

How to update a Matplotlib plot with real-time data [duplicate]

I am new to Matplotlib and have spent much time trying to figure out how to update my simple Matplotlib plot after the first run through my code. After i generate the plot, my code stops after the ...
2
votes
1answer
40 views

make only left subplots and bottom subplots (in MxN panels) contain x and y axis labels

Is there any way in a panel of NxM subplots to just have the axes being shown for the left column and bottom row. A|N|N|N A|N|N|N A|N|N|N A|A|A|A Where A = axis and N = no axis Sometimes my ...
0
votes
1answer
24 views

How to display a float matrix as elevation values in a 3D plot in Python?

I currently have a heat map which is a 2D float matrix (list of lists of floats to be accurate), and I can display it in 2D with matplotlib fairly easily, but I would like to display it in a 3D plot ...
1
vote
2answers
45 views

How to edit x axis with pylab?

Here is my graph, but it seems like over line x axis after 9. Anyone can help me to edit it?
3
votes
2answers
547 views

Why does scipy.optimize.curve_fit not fit to the data?

I've been trying to fit an exponential to some data for a while using scipy.optimize.curve_fit but i'm having real difficulty. I really can't see any reason why this wouldn't work but it just produces ...
4
votes
2answers
1k views

Stem plot in matplotlib?

I want to plot(x, sin(x)) but instead of a line from (xi,yi) to (x_i+1,y_i+1) I want a vertical line to each point from (xi,0) to (xi,yi) as sometimes interpolation between the points makes no sense ...
36
votes
2answers
25k views

matplotlib save plot to image file instead of displaying it (so can be used in batch scripts for example)

I am writing a quick and dirty script to generate plots on the fly. I am using the code below (from matplotlib docs) as a starting point: from pylab import * from optparse import OptionParser # make ...
3
votes
1answer
2k views

Matplotlib contour plot with intersecting contour lines

I am trying to make a contour plot of the following data using matplotlib in python. The data is of this form - # x y height 77.23 22.34 56 77.53 22.87 63 77.37 22.54 ...

1 2 3 4 5 285
15 30 50 per page