matplotlib

What is the fastest way to scale and display an image in Python?

I am required to display a two dimensional numpy.array of int16 at 20fps or so. Using Matplotlib's imshow chokes on anything above 10fps. There obviously are some issues with scaling and interpolation. I should add that the dimensions of the array are not known, but will probably be around thirty by four hundred. These are data from a ...

Command-line Unix ASCII-based charting / plotting tool

Is there a good command-line UNIX charting / graphing / plotting tool out there? I'm looking for something that will plot xy points on an ASCII graph. Just to clarify, I'm looking for something that will output a graph in ASCII (like ascii-art style), so I can use it over an interactive shell session without needing X. ...

How do you change the size of figures drawn with matplotlib?

How do you change the size of figure drawn with matplotlib? ...

Scaling the y-axis with matplotlib in python

Does anybody know how to scale the y-axis with matplotlib? I don't want to change the y-limit, I just want to extend the physical space. ^ ^ | | | | +----> | Before +----> After Thanks! ...

Is plotting an image on a map with matplotlib possible?

Using basemap it's easy to plot a set of coordinates, like so: x, y = m(lons, lats) m.plot(x, y, 'go') but would it be possible to use an image instead of the green circle ('go')? I didn't find a direct way of doing this from the documentation. So, let's clarify this a bit: I'm using a map generated with basemap as a background a...

Python plotting: How can I make matplotlib.pyplot stop forcing the style of my markers?

I am trying to plot a bunch of data points (many thousands) in Python using matplotlib so I need each marker to be very small and precise. How do I get the smallest most simple marker possible? I use this command to plot my data: matplotlib.pyplot( x , y ,'.',markersize=0.1,linewidth=None,markerfacecolor='black') Then I can look at...

Where is the function get_example_data in matplotlib? It seems to be missing but its in examples/tutorials

Looking at this tutorial here: link text it references matplotlib.get_example_data('goog.npy'). I get an error when I run this, and furthermore I can't even find the mpl-data/ folder in my macosx installation of matplot lib when searching using Spotlight. Any idea what this function is now called? ...

Matplotlib's GUI doesn't allow typing in save box?

I've been using matplotlib in python for some time now and I've finally gotten around to asking this question about an issue on my mac. When a plot shows up (after the plot() command, draw(), or show()), I have all the functionality I could want; I can move, zoom, etc. that I didn't do in the code. When I go to save a figure with the vi...

Multiple overlapping plots with independent scaling in Matplotlib

I currently have code that calls matplotlib.pylab.plot multiple times to display multiple sets of data on the same screen, and Matplotlib scales each to the global min and max, considering all plots. Is there a way to ask it to scale each plot independently, to the min and max of that particular plot? ...

Barchart sizing of text & barwidth with matplotlib - python

I'm creating a bar chart with matplotlib-0.91 (for the first time) but the y axis labels are being cut off. If I increase the width of the figure enough they eventually show up completely but then the output is not the correct size. Any way to deal with this? ...

How do I tell matplotlib that I am done with a plot?

The following code plots two .ps files, but the second one contains both lines. import matplotlib import matplotlib.pyplot as plt import matplotlib.mlab as mlab plt.subplot(111) x = [1,10] y = [30, 1000] plt.loglog(x, y, basex=10, basey=10, ls="-") plt.savefig("first.ps") plt.subplot(111) x = [10,100] y = [10, 10000] plt.loglog(x, y,...

How to visualize IP addresses as they change in python?

I've written a little script that collects my external IP address every time I open a new terminal window and appends it, at well as the current time, to a text file. I'm looking for ideas on a way to visualize when/how often my IP address changes. I bounce between home and campus and could separate them using the script, but it would be...

Matplotlib suddenly crashes after reinstalling Xcode?

I was happy in my world of python and matplotlib with a good level of familiarity. I notied Xcode on my Mac wasn't working so I installed the latest version from Apple and it somehow broke my install of matplotlib (or numpy?)! I'm now getting ... /sw/lib/python2.5/site-packages/matplotlib-0.91.1-py2.5-macosx- 10.5-i386.egg/matplotlib/n...

Matplotlib Build Problem: Error C1083: Cannot open include file: 'ft2build.h'

ft2build.h is located here: C:\Program Files\GnuWin32\include Initially, I made the same mistake as here: http://stackoverflow.com/questions/160938/fatal-error-c1083-cannot-open-include-file-tiffio-h-no-such-file-or-director but since then, I've corrected that particular error (I've added the above directory to the "include" list, ra...

Plot logarithmic axes with matplotlib in python

I want to plot a graph with one logarithmic axis using matplotlib. I've been reading the docs, but can't figure out the syntax. I know that it's probably something simple like 'scale=linear' in the plot arguments, but I can't seem to get it right Sample program: from pylab import * import matplotlib.pyplot as pyplot a = [ pow(10,i)...

barchart (o plot) 3D in python

I need to plot some data in various forms. Currently I'm using matplotlib and I'm fairly happy with the plots I'm able to produce. This question is on how to plot the last one. The data is similar to the "distance table", like this (just bigger, my table is 128x128 and still have 3 or more number per element) Now, my data is much bette...

Matplotlib: Legend not displayed properly

I have datapoints of different classes which I want to visualize. Here is the image that I get: http://imgur.com/1x97h There are 3000 datapoints of 10 classes, 300 each. They are concatenated in a single array d over whose chunks I iterate. The labels are given in labels. pylab.clf() colors = (i + j for j in 'o<.' for i in 'bgrcmyk') ...

PyQt: splash screen while loading "heavy" libraries

My PyQt application that uses matplotlib takes several seconds to load for the first time, even on a fast machine (the second load time is much shorter as the DLLs are kept in memory by Windows). I'm wondering whether it's feasible to show a splash screen while the matplotlib library is being loaded. Where does the actual loading take p...

Controling bars width in matplotlib with per-month data

When I plot data sampled per month with bars, their width is very thin. If I set X axis minor locator to DayLocator(), I can see the bars width is adjusted to 1 day, but I would like them to fill a whole month. I tried to set the minor ticks locator to MonthLocator() without effect. [edit] Maybe an example will be more explicit, here ...

gnuplot vs matplotlib

I've started on a project graphing tomcat logs using gnuplot-py, specifically correlating particular requests with memory allocation and garbage collection. What is the collective wisdom on gnuplot-py vs matplotlib for python graphing. Are there better graphing libraries out there I haven't heard of? My general considerations are: Wh...