Re: [Matplotlib-users] x= / y= labels default format is wrong

2009-05-29 Thread Eric Firing
Xavier Gnata wrote: > >> >>> >> Right now, the default is very simple: >> >> def format_data_short(self,value): >> 'return a short formatted string representation of a number' >> return '%1.3g'%value >> >> It looks like changing it to something like "%-12g" would facilitate >

Re: [Matplotlib-users] x= / y= labels default format is wrong

2009-05-29 Thread Xavier Gnata
> >> >> However, everyone would be happy if the default format would be >> consistent : >> >> As it is, *by default*, when <1000 it displays an int and after 1000 >> it displays 1.42e3. >> Why? What do you think this scientific format is a good for? >> >> I understand some users would like to se

Re: [Matplotlib-users] x= / y= labels default format is wrong

2009-05-29 Thread Eric Firing
Xavier Gnata wrote: > > However, everyone would be happy if the default format would be consistent : > > As it is, *by default*, when <1000 it displays an int and after 1000 it > displays 1.42e3. > Why? What do you think this scientific format is a good for? > > I understand some users would l

[Matplotlib-users] Histogram with multiple data

2009-05-29 Thread Yves-Alexandre
Hi, I'm trying to add label to a histogram with multiple data. The doc says "label can also be a sequence of strings" but when I try: plt.hist([listA, listB, listC], bins=25, histtype='bar', alpha=0.75,rwidth=0.85,label=['A','B','C']) I got an error: "AttributeError: 'tuple' object has no attr

Re: [Matplotlib-users] x= / y= labels default format is wrong

2009-05-29 Thread Xavier Gnata
John Hunter wrote: > On Fri, May 29, 2009 at 10:50 AM, Xavier Gnata wrote: > > >>> I had the same problem and fixed it by changing just two lines of code in >>> the axes.py (line 1812 and 1814). Just change the formatter in >>> 'self.xaxis.major.formatter.set_scientific(sb)' to whatever you w

[Matplotlib-users] PCA scatter plot in pylab with data labels

2009-05-29 Thread tjk1
Gurus, I am implementing some simple Principal Component Analysis (PCA) in Python but I have run into trouble with the graphical output. I have calculated my scores and my loadings (just matrices with mean-centered, univariate values) and I want to scatterplot them. However, to make the gr

Re: [Matplotlib-users] computer modern

2009-05-29 Thread Nicolas Pourcelot
Thanks, it works well. However, I forgot that computer modern does not include accented characters (unlike latin modern), so I eventually used Stix : mpl.rc('font', family = 'serif', serif = 'STIXGeneral') By the way, is there any way to use Stix for sans-serif as well, or even cursive and mon

Re: [Matplotlib-users] Error in mpl.axes.set_default_color_cycle

2009-05-29 Thread Eric Firing
Yannick Copin wrote: > Hi, > > I have an error while trying to use mpl.axes.set_default_color_cycle to > define my own color cycle based on the set1 colormap: > > In [1]: set1 = array([[228,55, 77, 152,255,255,166,247,153], > ...: [26, 126,175,78, 127,255,86, 129,153], > ..

Re: [Matplotlib-users] Howto get horiz/vert grid

2009-05-29 Thread Sandro Tosi
On Fri, May 29, 2009 at 19:09, Neal Becker wrote: > > from pylab import semilogy, show, grid > grid() > semilogy (result[0]) > > This gave me just a vertical grid.  What do I do to get both horiz and vert > grids? (without looking at a screenshot or to the dataset is hard to tell but) is it possi

[Matplotlib-users] Error in mpl.axes.set_default_color_cycle

2009-05-29 Thread Yannick Copin
Hi, I have an error while trying to use mpl.axes.set_default_color_cycle to define my own color cycle based on the set1 colormap: In [1]: set1 = array([[228,55, 77, 152,255,255,166,247,153], ...: [26, 126,175,78, 127,255,86, 129,153], ...: [28, 184,74, 163,0,

[Matplotlib-users] Howto get horiz/vert grid

2009-05-29 Thread Neal Becker
from pylab import semilogy, show, grid grid() semilogy (result[0]) This gave me just a vertical grid. What do I do to get both horiz and vert grids? -- Register Now for Creativity and Technology (CaT), June 3rd, NYC.

Re: [Matplotlib-users] x= / y= labels default format is wrong

2009-05-29 Thread John Hunter
On Fri, May 29, 2009 at 10:50 AM, Xavier Gnata wrote: >> I had the same problem and fixed it by changing just two lines of code in >> the axes.py (line 1812 and 1814). Just change the formatter in >> 'self.xaxis.major.formatter.set_scientific(sb)' to whatever you want (the >> same for y). You

Re: [Matplotlib-users] making publication quality plots

2009-05-29 Thread John Hunter
On Fri, May 29, 2009 at 10:25 AM, Paul Anton Letnes wrote: > I'm trying to make a publication quality plot for a two-column latex > article. I'm using latex for text processing, so the plot quality > itself is impeccable. However, as I scale the plot size down, the > legend becomes extremely larg

Re: [Matplotlib-users] x= / y= labels default format is wrong

2009-05-29 Thread Xavier Gnata
Indeed, but it should really be fixed in the svn. Xavier > Hi Xavier, > > I had the same problem and fixed it by changing just two lines of code in the > axes.py (line 1812 and 1814). Just change the formatter in > 'self.xaxis.major.formatter.set_scientific(sb)' to whatever you want (the > sam

Re: [Matplotlib-users] making publication quality plots

2009-05-29 Thread Chaitanya Krishna
Hi, I usually fix the size of the figure when I produce it. I use rcparams below for a single column plot. This usually solves the problem. What you see is what you get in the final document if you use the same size of the figure as used to produce it. def paper_single(): plt.rc('figure', fig

[Matplotlib-users] making publication quality plots

2009-05-29 Thread Paul Anton Letnes
Howdy y'all! I'm trying to make a publication quality plot for a two-column latex article. I'm using latex for text processing, so the plot quality itself is impeccable. However, as I scale the plot size down, the legend becomes extremely large compared to the plot itself. Has anyone solv

Re: [Matplotlib-users] Strange resize behaviour for qt backend

2009-05-29 Thread Ole Streicher
Hallo Theodore, "Drain, Theodore R" writes: > Remember, this is not a multi-threaded system.  You can't receive a > second repaint event while the drawing code is happening because the > event loop is not in a separate thread.  This is not my choice. If the user resizes the window, the events a

Re: [Matplotlib-users] Strange resize behaviour for qt backend

2009-05-29 Thread Ole Streicher
Hi again, Ole Streicher writes: > Darren Dale writes: >> I am really busy with other things, and can't offer suggestions unless >> you post a short, simple, standalone script that demonstrates the >> problem. > Sure: > w.show() > a.exec_() I forgot to say: execute this code, and then try to res

Re: [Matplotlib-users] Strange resize behaviour for qt backend

2009-05-29 Thread Ole Streicher
Hi Darren, Darren Dale writes: > I am really busy with other things, and can't offer suggestions unless > you post a short, simple, standalone script that demonstrates the > problem. Sure: 8<- import random import sys from