Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-18 Thread Eric Firing
In general, I don't think mpl is threadsafe at all; it uses global variables, such as all the rc parameters, that could easily be modified by one thread while being used by another. I think that great care would be needed if one wanted to have multiple threads making plots. Having one plotting

Re: [Matplotlib-users] Gappy bars when no edge specified?

2008-03-18 Thread Michael Droettboom
Chris Withers wrote: > Eric Firing wrote: > >>> How do I make the small gaps go away? >>> >> With svn I don't see any gaps in the example above, either on screen or >> when saved to a png file. >> > > That's cool'n'all, but when is svn going to make it into a Windows > binary relea

Re: [Matplotlib-users] from pylab import nx?

2008-03-18 Thread Michael Droettboom
Eric Firing wrote: > Chris Withers wrote: > >> Hi All, >> >> A few of the units demos include the lines: >> >> from pylab import nx >> >> ...but this import errors for me. >> >> Why is that? >> > > If you are referring to scripts in the matplotlib/examples/ subdirectory > then you must hav

Re: [Matplotlib-users] Latex in Figures

2008-03-18 Thread Michael Droettboom
Mattias' suggestion is a good one if you have a full TeX environment installed. Otherwise, it looks like you're using some features that are only available in 0.91.x (but not earlier versions), for example "\sin". If you can, try upgrading. Cheers, Mike Lorenzo Isella wrote: > Dear All, > I

Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-18 Thread Michael Droettboom
At least the Agg backend *looks* to be reasonably threadsafe -- there are no obvious gotchas like global variables etc. Note, though, that multithreading may not gain much in the way of performance since the global interpreter lock is never released around long-running C blocks. However, I can

Re: [Matplotlib-users] Debugging: Many Multiple Plots -- Update

2008-03-18 Thread Rich Shepard
On Tue, 18 Mar 2008, Rich Shepard wrote: > File "termset-test-data.py", line 389, in testCode >pylab.hold() Replacing the line above with pylab.hold(False) seems to put me in a non-stop loop. I'll run the test code in winpdb, but still want suggestions on how to get the output I need. Ri

Re: [Matplotlib-users] plotting with missing data?

2008-03-18 Thread Eric Firing
Pierre GM wrote: > On Tuesday 18 March 2008 16:17:08 Eric Firing wrote: >> Chris Withers wrote: >>> Eric Firing wrote: >> You should use numpy.masked_where(numpy.isnan(aa), aa). (I meant numpy.ma.masked_where(...)) > > or use masked_invalid directly (shortcut to masked_where((isnan(aa) | > isinf(

Re: [Matplotlib-users] plotting with missing data?

2008-03-18 Thread Pierre GM
On Tuesday 18 March 2008 16:17:08 Eric Firing wrote: > Chris Withers wrote: > > Eric Firing wrote: > You should use numpy.masked_where(numpy.isnan(aa), aa). or use masked_invalid directly (shortcut to masked_where((isnan(aa) | isinf(aa)) > > I only wish that masked_equal didn't blow up when aa

Re: [Matplotlib-users] gradient fills for bar charts?

2008-03-18 Thread Eric Firing
Chris Withers wrote: > Hi All, > > Is there any way in MPL to do gradient filled bars like you can in > Excel? (click data series -> format data series -> patterns -> fill > effects -> gradient -> diagonal up) > > cheers, > > Chris > Short of laboriously putting an image in each bar, no. Er

Re: [Matplotlib-users] Gappy bars when no edge specified?

2008-03-18 Thread Chris Withers
Eric Firing wrote: >> How do I make the small gaps go away? > > With svn I don't see any gaps in the example above, either on screen or > when saved to a png file. That's cool'n'all, but when is svn going to make it into a Windows binary release? ;-) cheers, Chris - not sure how to compile MP

Re: [Matplotlib-users] Gappy bars when no edge specified?

2008-03-18 Thread Eric Firing
Chris Withers wrote: > Hi All, > > Why does the following render small gaps horizontally between the bars? > > import pylab > data = [1,2,1,2,4,2] > labels = pylab.arange(len(data1)) > pylab.bar(labels,data1,width=1,linewidth=0) > pylab.show() > > How do I make the small gaps go away? With svn

[Matplotlib-users] gradient fills for bar charts?

2008-03-18 Thread Chris Withers
Hi All, Is there any way in MPL to do gradient filled bars like you can in Excel? (click data series -> format data series -> patterns -> fill effects -> gradient -> diagonal up) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co

Re: [Matplotlib-users] plotting with missing data?

2008-03-18 Thread Eric Firing
Chris Withers wrote: > Eric Firing wrote: >>> Specifically, what I have is an array like so: >>> >>> ['','','',1.1,2.2] >> >> Try something like this: >> >> import numpy.ma as ma >> from pylab import * >> >> aa = [3.4, 2.5, '','','',1.1,2.2] >> def to_num(arg): >> if arg == '': >> retur

[Matplotlib-users] Gappy bars when no edge specified?

2008-03-18 Thread Chris Withers
Hi All, Why does the following render small gaps horizontally between the bars? import pylab data = [1,2,1,2,4,2] labels = pylab.arange(len(data1)) pylab.bar(labels,data1,width=1,linewidth=0) pylab.show() How do I make the small gaps go away? cheers, Chris

Re: [Matplotlib-users] Repost: problem exporting mathtext to eps file in 0.91.2

2008-03-18 Thread mdroe
It looks like it may be Windows-specific. I can create .eps files with math on mpl-0.91.2, Python 2.5, gs-7.07 on Linux without problems. Someone with a Windows installation may need to look at this. Just so I can have a deeper look -- can you please attach a) the Python source of a minimal

Re: [Matplotlib-users] from pylab import nx?

2008-03-18 Thread Eric Firing
Chris Withers wrote: > Hi All, > > A few of the units demos include the lines: > > from pylab import nx > > ...but this import errors for me. > > Why is that? If you are referring to scripts in the matplotlib/examples/ subdirectory then you must have a version in which some of those scripts h

Re: [Matplotlib-users] from pylab import nx?

2008-03-18 Thread Zane Selvans
Chris Withers wrote: Hi All, A few of the units demos include the lines: from pylab import nx ...but this import errors for me. Not sure if this is relevant, but NX is a frequently used shorthand for the NetworkX graph/network analysis package from Los Alamos National Labs: https://networ

Re: [Matplotlib-users] Repost: problem exporting mathtext to eps file in 0.91.2

2008-03-18 Thread Mark Bakker
Just upgraded to Ghostview 4.9 with Ghostscript 8.61, but it still doesn't work. Does anybody see greek symbols in eps files with mpl 0.92.1? Mark On Tue, Mar 18, 2008 at 5:07 PM, Mark Bakker <[EMAIL PROTECTED]> wrote: > Hello Bernhard - > > When I set the fonttype to 42, the eps file gets much

Re: [Matplotlib-users] placing legend outside of plot area

2008-03-18 Thread Chris Withers
Matthias Michler wrote: > - I think this could be a good improvement, but i'm not sure if it is easy to > expand the functionality of the axes-legend (pyplot.legend or ax.legend) to > that of a figure-legend(pyplot.figlegend or fig.legend with fig as a figure > instance) without missing somethin

Re: [Matplotlib-users] Repost: problem exporting mathtext to eps file in 0.91.2

2008-03-18 Thread Mark Bakker
Hello Bernhard - When I set the fonttype to 42, the eps file gets much bigger, and the fonts seem included. The file contains the same section as yours: %!PS-TrueTypeFont-1.0-2.0 %%Title: Bitstream Vera Sans %%Copyright: Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. %%Creator: Convert

Re: [Matplotlib-users] Basemap: Labeling parallels in polar stereographic projections

2008-03-18 Thread Jeff Whitaker
Rich Fought wrote: > >> Rich: You'll have to do it manually with the axes text method. The >> drawparallels method can only label them where they intersect the >> edge of the map. >> > Thanks Jeff, that's what I was afraid of. > > New question: when adding axis labels (xlabel, ylabel) and figur

Re: [Matplotlib-users] default zorder for plots?

2008-03-18 Thread Chris Withers
Hi Matthias, Matthias Michler wrote: > in "examples/zorder_demo.py" I found: > --- > The default drawing order for axes is patches, lines, text. This > order is determined by the zorder attribute. The fol

[Matplotlib-users] bar chart with dates on x-axis blows up

2008-03-18 Thread Chris Withers
Hi All, I'm trying to plot a bar chart something like: from pylab import * from datetime import datetime,timedelta now = datetime.now() data1 = [1,2,3] data2 = [4,5,6] labels = [now-timedelta(1),now,now+timedelta(1)] bar(labels,data1) show() However, this blows up: Traceback (most recent cal

Re: [Matplotlib-users] Basemap: Labeling parallels in polar stereographic projections

2008-03-18 Thread Rich Fought
> Rich: You'll have to do it manually with the axes text method. The > drawparallels method can only label them where they intersect the edge > of the map. > Thanks Jeff, that's what I was afraid of. New question: when adding axis labels (xlabel, ylabel) and figure title, these overlap basem

Re: [Matplotlib-users] Basemap: Labeling parallels in polar stereographic projections

2008-03-18 Thread Jeff Whitaker
Rich Fought wrote: > Hi, > > When using north/south polar stereographic projections from basemap, how > can I get labels to show up on the parallels when none of them intersect > a plot edge? > > Thanks, > Rich > Rich: You'll have to do it manually with the axes text method. The drawparall

[Matplotlib-users] Basemap: Labeling parallels in polar stereographic projections

2008-03-18 Thread Rich Fought
Hi, When using north/south polar stereographic projections from basemap, how can I get labels to show up on the parallels when none of them intersect a plot edge? Thanks, Rich - This SF.net email is sponsored by: Microsoft

Re: [Matplotlib-users] Repost: problem exporting mathtext to eps file in 0.91.2

2008-03-18 Thread Bernhard Voigt
hi again! did you look into the eps file, do you see that the font is included, eg. i have something like that in my eps files (still in the header section): %!PS-Adobe-3.0 Resource-Font %%Title: cmmi10 %%Copyright: Copyright (C) 1994, Basil K. Malyshev. All Rights Reserved.012BaKoMa Fonts Collect

Re: [Matplotlib-users] default zorder for plots?

2008-03-18 Thread Matthias Michler
Hello Chris, in "examples/zorder_demo.py" I found: --- The default drawing order for axes is patches, lines, text. This order is determined by the zorder attribute. The following defaults are set Artist

[Matplotlib-users] default zorder for plots?

2008-03-18 Thread Chris Withers
Chris Withers wrote: > I tried fiddling with the zorder of the plot and the grid but nothing > had any effect. What am I doing wrong? How do I get the grid to show up > behind the lines? Actually, I did manage to fix this by specifying a zorder of 10 for the plots and a zorder of 1 for the grid

Re: [Matplotlib-users] making minor ticks into lines instead of ticks

2008-03-18 Thread Chris Withers
Matthias Michler wrote: > ax.yaxis.grid(which='minor') This is what I was after, thankyou :-) However, the lines show up on top of the lines plotted, not behind them as I'd expect. I tried fiddling with the zorder of the plot and the grid but nothing had any effect. What am I doing wrong? How

[Matplotlib-users] from pylab import nx?

2008-03-18 Thread Chris Withers
Hi All, A few of the units demos include the lines: from pylab import nx ...but this import errors for me. Why is that? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk -

Re: [Matplotlib-users] Latex in Figures

2008-03-18 Thread Matthias Michler
Hello Lorenzo, maybe you don't really use Tex to build the labels and mathtext does not support any Tex-functionality. if you use: from matplotlib import rc rc('text', usetex=True) import pylab as p it should work. Alternat

Re: [Matplotlib-users] placing legend outside of plot area

2008-03-18 Thread Matthias Michler
On Tuesday 18 March 2008 10:50, Chris Withers wrote: > Eric Firing wrote: > > It sounds like what you want it the pyplot figlegend command: > > def figlegend(handles, labels, loc, **kwargs): > > This feels like what I should be wanting except: > > - why does it need explicit parameters? why can't i

Re: [Matplotlib-users] making minor ticks into lines instead of ticks

2008-03-18 Thread Matthias Michler
Hello Chris, for only horizontal lines you can use 'ax.yaxis.grid' like: --- from pylab import * figure() ax = axes() ax.set_yticks([0.0,0.5,1.0], minor=False) ax.set_yticks(list(linspace(0.0, 1.0, 11)), minor=True) ax.yaxis.grid(which='minor') show(

Re: [Matplotlib-users] placing legend outside of plot area

2008-03-18 Thread Chris Withers
Eric Firing wrote: > It sounds like what you want it the pyplot figlegend command: > def figlegend(handles, labels, loc, **kwargs): This feels like what I should be wanting except: - why does it need explicit parameters? why can't it pick up its lines and labels automatically, like legend does?

[Matplotlib-users] Latex in Figures

2008-03-18 Thread Lorenzo Isella
Dear All, I think the solution to my problem must be a one-liner, but I have been unsuccessful. I am trying to use latex formulas (nothing dramatically complicated) inside a figure. I suppose everything is working correctly on my system. I tried running the example at: http://www.scipy.org/Cookbook

Re: [Matplotlib-users] plotting with missing data?

2008-03-18 Thread Chris Withers
Eric Firing wrote: >> Specifically, what I have is an array like so: >> >> ['','','',1.1,2.2] > > Try something like this: > > import numpy.ma as ma > from pylab import * > > aa = [3.4, 2.5, '','','',1.1,2.2] > def to_num(arg): > if arg == '': > return .0 > return arg > > aa

Re: [Matplotlib-users] making minor ticks into lines instead of ticks

2008-03-18 Thread Chris Withers
Eric Firing wrote: >> I can get the major ticks to show by doing grid(True), but how do I >> get the same effect for minor ticks? > > Try > > grid(True, which='minor') Thanks, that worked (well, it did what it was supposed to...) so it'd be nice if it was in the online docs as well as the docs