Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread Chloe Lewis
And if you have mutually prime numbers of colors, linestyles, widths, you can automatically generate more distinct lines than I can distinguish... If there's any wxcuse for treating them as a series, I replot when I know how many I have, and space the colors through a colorbar. &C Away from hom

Re: [Matplotlib-users] a question about backend, matplotlib and ipython

2010-08-23 Thread Benjamin Root
On Mon, Aug 23, 2010 at 1:53 PM, xiaoni wrote: > Hello, > I got a problem with backend in matplotlib. > I used ipython for launching the codes and the backend of matplotlib > is GTKAgg. I have a code.py with a for loop for processing data, and in > each iteration I read and plot and s

Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread John Salvatier
By the way, I found that the following generator expression made things easy: def styles(): return ( {'c' : color, 'ls' : style, 'lw' : width} for color, style, width in itertools.product(colors, linestyles, linewidths)) then you can do something like for result, style in zip(results, styles

Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread John Salvatier
Thanks! On Mon, Aug 23, 2010 at 12:38 PM, Aman Thakral wrote: > Hi John, > > Here is a simple way to do it. > > import matplotlib.pyplot as plt > import numpy as np > fig = plt.figure() > ax = fig.add_subplot(111) > > colors = ('red','green','blue','yellow','orange') > linestyles = ('-','--',':'

Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread Aman Thakral
Hi John, Here is a simple way to do it. import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(111) colors = ('red','green','blue','yellow','orange') linestyles = ('-','--',':') linewidths = (0.5,2) y = np.random.randn(100,30) x = range(y.shape[0]) i = 0 fo

Re: [Matplotlib-users] Colorbar labeling

2010-08-23 Thread Friedrich Romstedt
2010/8/20 Bruce Ford : > I have a grid with values ranging from exactly 0.0 and 100.0.  When I > plot this with colorbar, the base of the colorbar is labeled "-0.0". > Is this a default for 0.0...to plot it with as a negative number?  Any > workarounds? How sure are you that the floating point num

Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread Justin McCann
Here are a couple of functions you might try, with a few colors and line styles I use: import itertools from pylab import * COLORS = ['#990033', '#FF', '#00FF00', '#F79E00', '#ff00ff', '#0080FF', '#FF', '#2D0668', '#2EB42E', '#ff6633', '#8000ff', '#33',

Re: [Matplotlib-users] plotting open symbols

2010-08-23 Thread Friedrich Romstedt
2010/8/20 Benjamin Root : > This used to trip me up as well.  However, for colors in matplotlib, None > (without quotes) tells mpl to use the default color, while 'None' (typically > not case-sensitive) means "do not plot any color". More precise, the string 'None' translates to fully transparent

Re: [Matplotlib-users] polar plot

2010-08-23 Thread Friedrich Romstedt
2010/8/20 Michael Droettboom : >> Yeah, it's my issue, but I'm not happy with fixing it.  Currently, >> matplotlib forces the xticks (i.e., the theta ticks) to be at sensible >> values via .set_xticks() and .set_xlabels() (projections/polar.py). >> >> I'm coding a matplotlib extension package which

[Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread John Salvatier
Hello, I have a plot with lots of curves on it (say 30), and I would like to have some way of distinguishing the curves from each other. Just plotting them works well for a few curves because they come out as different colors unless you specify otherwise, but if you do too many you start getting r

[Matplotlib-users] a question about backend, matplotlib and ipython

2010-08-23 Thread xiaoni
Hello, I got a problem with backend in matplotlib. I used ipython for launching the codes and the backend of matplotlib is GTKAgg. I have a code.py with a for loop for processing data, and in each iteration I read and plot and save the figures. Because there

Re: [Matplotlib-users] Mapping fonts properly

2010-08-23 Thread Michael Droettboom
On 08/23/2010 11:08 AM, Daniel Hyams wrote: Thanks for your response Michael! Deleting the fontList.cache indeed solved the problem. The first sample that I gave below now works fine under both Windows and Linux; whew...I would have never known about that cache file without your help. So, s

Re: [Matplotlib-users] Mapping fonts properly

2010-08-23 Thread Daniel Hyams
Thanks for your response Michael! Deleting the fontList.cache indeed solved the problem. The first sample that I gave below now works fine under both Windows and Linux; whew...I would have never known about that cache file without your help. So, should the fontList.cache file be deleted each tim

Re: [Matplotlib-users] Mapping fonts properly

2010-08-23 Thread Michael Droettboom
On 08/22/2010 10:00 PM, Daniel Hyams wrote: I am searching for advice on how to handle selecting a specific font, and using that in a matplotlib figure. As a background, the font will be picked through the wx.FontDialog (common font dialog) provided by wxPython. So, what I will have is the fo

Re: [Matplotlib-users] Animated artists not present in savefigged files

2010-08-23 Thread Daπid
What I use to create animations is plainly: savefig(head+str(filecode).zfill(digits)+format, dpi=205) plt.clf() filecode+=1 where filecode is the name, digits an int and format usually .png. clf() is important in order to prevent memory leaks, because otherwise mpl stores all the figures one in

Re: [Matplotlib-users] Animated artists not present in savefigged files

2010-08-23 Thread John Hunter
On Mon, Aug 23, 2010 at 7:59 AM, Kim Hansen wrote: > Hi list, > > I am using animated artists to generate an animation, where I save each step > in the anmantion as a png using the savefig method of the figure instance > after drawing the animated artists on a cached background and after > fig.can

[Matplotlib-users] Animated artists not present in savefigged files

2010-08-23 Thread Kim Hansen
Hi list, I am using animated artists to generate an animation, where I save each step in the anmantion as a png using the savefig method of the figure instance after drawing the animated artists on a cached background and after fig.canvas.blit. What I see on screen are the updated animated artist