matplotlib

color plot animation with play, pause, stop cabability using Tkinter with pylab/matplotlib embedding: can't update figure/canvas ?

I've looked but didn't find previous questions specific enough, so sorry if this is repeated. Goal: GUI to continuously update figure with different matrix data plotted by pylab's pcolor such that there is a running animation. But user should be able to play, pause, stop animation by Tkinter widget buttons. Before I get an answer for ma...

Matplotlib legend help

I am writing a script that plot's several points. I am also trying to create a legend from these points. To sum up my script, I am plotting several 'types' of points (call them 'a', 'b', 'c'). These points have different colors and shapes: 'a'-'go' 'b'-'rh' 'c'-'k^'. This is a shortened version of the relevant parts of my script: lbl =...

What is the difference between 'log' and 'symlog'?

In matplotlib, I can set the axis scaling using either pyplot.xscale() or Axes.set_xscale(). Both functions accept three different scales: 'linear' | 'log' | 'symlog'. What is the difference between 'log' and 'symlog'? In a simple test I did, they both looked exactly the same. I know the documentation says they accept different paramet...

Fill OUTSIDE of polygon | Mask array where indicies are beyond a circular boundary?

I use plot(x,y,'r') to plot a red circle. x and y are arrays such that when paired as (x,y) and plotted, all points form a circle-line. fill(x,y,'r') plots a red circle that is filled in (or colored in) red. How can I keep the circle white on the inside, but fill outside the circle out to the axis boundaries? I looked into using fill_...

python matplotlib will only plot integers

Hi, I'm very new to python. two days. trying to get a plot working with matplotlib. I'm getting this error: cannot perform reduce with flexible type the line with the error is: ax.scatter(x,y,z,marker='o') Variables: ax is defined as: ax = Axes3D(fig) fig is defined as: fig = plt.figure() x, y, z are lists Any python expert...

adjusting heights of individual subplots in matplotlib in Python

if I have a series of subplots with one column and many rows, i.e.: plt.subplot(4, 1, 1) # first subplot plt.subplot(4, 1, 2) # second subplot # ... how can I adjust the height of the first N subplots? For example, if I have 4 subplots, each on its own row, I want all of them to have the same width but the first 3 subplots to be short...

import matplotlib._png fails

Hi, I have a problem getting matplotlib 1.0.0 work in Python 2.5.2 (Ubuntu 10.04) See attached console output. Any ideas appreciated. Thanks Python 2.5.2 (r252:60911, Jul 23 2010, 23:04:44) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> import scipy >>> import matplotli...

Matplotlib: interactive plot on a web server

hi, I'm currently using Open Flash Chart 2 on my django website, but I find it insufficiently customizable. (It's great when you want the usual barcharts, piecharts, but what about homemade shapes...). Although it's open source, I don't feel like diving in the Flex code. I'm thinking a lot about matplotlib but the documentation is rathe...

mplot3d in wxPython frame

I'm writing an application in wxPython. The button "Plot" shows the wxFrame with 3D surface but I can't rotate the surface. Is it possible to rotate a 3D plot placed in a wxFrame? How can I do? Example: import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplot...

Set Colorbar Range in matplotlib

I have the following code: import matplotlib.pyplot as plt cdict = { 'red' : ( (0.0, 0.25, .25), (0.02, .59, .59), (1., 1., 1.)), 'green': ( (0.0, 0.0, 0.0), (0.02, .45, .45), (1., .97, .97)), 'blue' : ( (0.0, 1.0, 1.0), (0.02, .75, .75), (1., 0.45, 0.45)) } cm = m.colors.LinearSegmentedColormap('my_colormap', cdict, 1024) ...

Graphing in Python 3.x

In Python 2.6, I used matplotlib to make some simple graphs. However, it is incompatible with Python 3.1. What are some alternative modules that can accomplish the same thing without being very complex? ...

Python and GnuCash: Extract data from GnuCash files

I'm looking for information on how to read GnuCash files using python. I have read about this python-gnucash which provides Python bindings to the GnuCash library, but it takes a lot of work at the moment (e.g. dependencies, headers, etc.). The instructions are tailored for the Linux environment, and a rather old GnuCash version (2.0.x)....

How to enlarge subplot matplotlib?

I currently have two subplots. Note: this is in matplotlib v0.99.3 on Mac OS X 10.6.x I have an event-handler that when one of the subplots are clicked, it prints something. This is only a temporary place holder. What I want to happen is when the subplot is clicked, I want it to take up the whole figure (delete the other subplot and max...

How to scale down the y-axis in matplotlib/python?

This is more of a math question than a matplotlib question but if there is a way to do this specifically in matplotlib that would be great. I have a set of points with the max-y-value and the min-y-value can have a difference anywhere from a few hundred to a few thousand. I am trying to plot these points in a very small scale on the ...

How to alternate colors in stacked bar graph in matplotlib?

Dear All I want to alternate colors in a stacked bar graph in matplotlib..so as I can get different colors for the graphs depending on their type. I have two types except that they do not alternate regularly. so I need to check their type before I choose the colors. The problem is that it is conditional. I provide the type in an array,...

Matplotlib - changing plot size within rectangular grid.

I have 4 subplots (created by using add_subplot) organised in a 2x2 rectangular grid. The two in the second row do not need to take up as much space and I wish to change it such that the top row takes up two thirds of the space and the bottom row takes up the remaining third. I've found that you can arbitrarily place subplots by creatin...

3D pie graph in matplotlib

Is there a way to render a 3D pie in matplotlib? Or do you know at least a Python package that can generate 3D pies? EDIT: I actually already knew about pygooglechart, but I'm looking for something that can be done offline. My apologies for forgetting to include this information. For those who offered pygooglechart, thanks for the effor...

Setting spines in matplotlibrc

For a strange reason I cannot find the way to specify spines configuration in Python's matplotlibrc file. Any idea on how to cause matplotlib not to draw upper and right spines by default? More about info about spines in matplotlib is here Thank you ...

matplotlib: add circle to plot

How do I add a small filled circle or point to a countour plot in matplotlib? ...

Matplotlib animation either freezes after a few frames or just doesn't work

I've been trying for hours to get this simple script working, but nothing I do seems to help. It's a slight modification of the most basic animated plot sample code from the Matplotlib website, that should just show a few frames of noise (I have the same issue with the unmodified code from their website BTW). On my computer with the TkA...