[Matplotlib-users] newbie question: type check?

2010-01-11 Thread Nico Schlömer
Hi, quick question from a Python noob: Suppose I have an instance of an object of matplotlib, Is there any way to check on its type, e.g., whether it is an instance of matplotlib.axes.AxesSubplots? Cheers! Nico -- This S

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread Jae-Joon Lee
When you check out the svn, please try to apply the patch attached. patch -p1 < ps_distiller.patch I hope this solves your problem. Regards, -JJ On Mon, Jan 11, 2010 at 7:25 PM, Jae-Joon Lee wrote: > On Mon, Jan 11, 2010 at 6:49 PM, John Reid > wrote: >> Thanks for help so far. Any more id

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread Jae-Joon Lee
On Mon, Jan 11, 2010 at 6:49 PM, John Reid wrote: > Thanks for help so far. Any more ideas? I'll try the svn if it is just a > case of checking it out and compiling. > Please try. I don't think the current svn version will make any difference. But, at least I can send you a patch that I think fi

Re: [Matplotlib-users] contour plots with logarithmic axes

2010-01-11 Thread Eric Firing
Jae-Joon Lee wrote: > Contour will work as expected if the axes is in log scale. See below. > > z = np.arange(100).reshape((10,10)) > x = np.logspace(0, 4, 10) > y = np.logspace(0, 4, 10) > > ax1 = subplot(121) > ax1.contour(np.log10(x), np.log10(y), z) > > ax2 = subplot(122) > ax2.set_xscale("l

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread John Reid
Jae-Joon Lee wrote: > My guess is that somehow the output format of bbox device in the > recent ghostscript has changed. > > What kind of output do you get when you run > >> gs -dBATCH -dNOPAUSE -sDEVICE=bbox test.eps > > in your shell (replace "test.eps" with any eps file you have) > > I get >

Re: [Matplotlib-users] contour plots with logarithmic axes

2010-01-11 Thread Jae-Joon Lee
Contour will work as expected if the axes is in log scale. See below. z = np.arange(100).reshape((10,10)) x = np.logspace(0, 4, 10) y = np.logspace(0, 4, 10) ax1 = subplot(121) ax1.contour(np.log10(x), np.log10(y), z) ax2 = subplot(122) ax2.set_xscale("log") ax2.set_yscale("log") ax2.contour(x,

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread Jae-Joon Lee
My guess is that somehow the output format of bbox device in the recent ghostscript has changed. What kind of output do you get when you run > gs -dBATCH -dNOPAUSE -sDEVICE=bbox test.eps in your shell (replace "test.eps" with any eps file you have) I get GPL Ghostscript 8.61 (2007-11-21) Copyr

[Matplotlib-users] contour plots with logarithmic axes

2010-01-11 Thread Jonathan Slavin
Is there any way to simply make a contour plot with logarithmic axes using matplotlib? I found a workaround by plotting log10(x), log10(y), but it'd be nicer if it was more direct. As someone new to matplotlib (experienced in IDL) I'm finding much to like, but some things are more difficult for

Re: [Matplotlib-users] Simple text style question

2010-01-11 Thread Gökhan Sever
OK JJ, After reading your explanation, I have tried my current Qt4Agg and PS backends. As you told coloring worked only with PS backend. See my sample test-snippets. plt.rcParams["text.latex.preamble"] = r"\usepackage{color}" plt.plot(range(10)); plt.ylabel("\color{red} {red}, \color{blue} {blue

Re: [Matplotlib-users] another problem with hardcoded colors

2010-01-11 Thread Jae-Joon Lee
On Mon, Jan 11, 2010 at 2:38 PM, Dominik Szczerba wrote: > Hmmm, that property really deserves its own rc param, but if you do not > like it, it should at least be somewhere automatically set to the > current background color to be resistant against people like me ;) I > would be happy to have suc

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread John Reid
Thanks for looking at this. I upgraded to 99.1.1 (although the tar file was named 99.1.2) and I got the same error message. When I played with the ps.usedistiller option I found it only doesn't work when I set ps.usedistiller to xpdf. With False or ghostscript it works ok but gives me output wi

Re: [Matplotlib-users] another problem with hardcoded colors

2010-01-11 Thread Dominik Szczerba
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jae-Joon Lee wrote: > On Sat, Jan 9, 2010 at 4:27 PM, Dominik Szczerba wrote: >> When using white over back color scheme the legend() is unreadable, with >> apparently hard-coded white legend background - or is there a way to set >> it in the rc file?

Re: [Matplotlib-users] another problem with hardcoded colors

2010-01-11 Thread Jae-Joon Lee
On Sat, Jan 9, 2010 at 4:27 PM, Dominik Szczerba wrote: > When using white over back color scheme the legend() is unreadable, with > apparently hard-coded white legend background - or is there a way to set > it in the rc file? > Unfortunately no. I recommend you to manually change the color of th

Re: [Matplotlib-users] Simple text style question

2010-01-11 Thread Jae-Joon Lee
First of all, to use "\color" with TeX, you need to use "color" package, i.e., you need to modify your latex preamble to include that package. This can be done by import matplotlib.pyplot as plt plt.rcParams["text.latex.preamble"] = r"\usepackage{color}" I guess the error you encounter is because

Re: [Matplotlib-users] Setting Relative Heights For Figure Rows

2010-01-11 Thread Jae-Joon Lee
See this example http://matplotlib.sourceforge.net/examples/pylab_examples/scatter_hist.html Or, you're willing to learn something new, you may use axes_grid toolkit. http://matplotlib.sourceforge.net/examples/axes_grid/scatter_hist.html -JJ ---

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread Jae-Joon Lee
You code works okay with the current svn. See if changing the distiller option makes any difference ("ps.usedistiller" in the rc file). The best would be for you to upgrade to the recent release of matplotlib if possible. Regards, -JJ On Mon, Jan 11, 2010 at 8:35 AM, John Reid wrote: > Hi, >

Re: [Matplotlib-users] Simple text style question

2010-01-11 Thread Gökhan Sever
This seems like the solution. However when I try: I[1]: plt.plot(range(10)) I[2]: plt.ylabel(r"{\color{red} a red text}") It doesn't function and produce an ugly set of error messages: I[3]: ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or in

Re: [Matplotlib-users] Simple text style question

2010-01-11 Thread Jeff Whitaker
Gökhan Sever wrote: > > > On Mon, Jan 11, 2010 at 6:51 AM, Jeff Whitaker > wrote: > > Gökhan Sever wrote: > > Hello, > > Is there a way to color words differently in a label or title, > for example: > > ylabel("measurement 1 (in red co

Re: [Matplotlib-users] Setting Relative Heights For Figure Rows

2010-01-11 Thread Matthias Michler
Hi Chris, I think pyplot.axes does what you are after, e.g. ax1 = axes([0.1, 0.3, 0.8, 0.6]) ax2 = axes([0.1, 0.1, 0.8, 0.1]) Kind regards, Matthias from the docs of pyplot.axes: `axes(rect, axisbg='w')`` where *rect* = [left, bottom, width, height] in normalized (0, 1) units. *axisbg* is

[Matplotlib-users] Setting Relative Heights For Figure Rows

2010-01-11 Thread Chris Spencer
I wanted to display my figure legend below my figure in the second row, so I used subplot(211) to create two rows. However, this creates two rows of equal height, so my graph is crammed into half the figure height in the first row, while my tiny legend barely fills up any of the second row. How do

[Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread John Reid
Hi, I'm using matplotlib 0.98.5.2 on Ubuntu with Ghostscript 8.70. The following code produces the following error. Can anyone verify whether this a problem with my installation or with matplotlib? import pylab as P P.figure() width=.4 x1 = [-0.4, 0.6, 1.6, 2.6, 3.6, 4.6, 5.6] y1 = [1.0,

Re: [Matplotlib-users] Simple text style question

2010-01-11 Thread Jeff Whitaker
Gökhan Sever wrote: > Hello, > > Is there a way to color words differently in a label or title, for > example: > > ylabel("measurement 1 (in red color)" , "measurement 2 (in blue > color)") to match with the plotted line colors? > > Thanks. > > -- > Gökhan Gökhan: ylabel('measurement 1',color='

Re: [Matplotlib-users] Simple text style question

2010-01-11 Thread Damon McDougall
Hi Gökhan, Do you have usetex=True set? If so, have you tried the LaTeX command sequence \color{red}{Red text goes here} ? Regards, -- Damon -- Damon McDougall Mathematics Institute University of Warwick Coventry CV4 7AL d.mcdoug...@warwick.ac.uk On 11 Jan 2010, at 05:4