You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
| 2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
| 2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
| 2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
| 2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
| 2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
| 2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
| 2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
| 2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
| 2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
| 2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
| 2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
| 2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
| 2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
(8) |
|
2
(2) |
3
(8) |
4
(19) |
5
(19) |
6
(25) |
7
(8) |
8
(1) |
|
9
|
10
(15) |
11
(22) |
12
(8) |
13
(4) |
14
(1) |
15
|
|
16
(1) |
17
(20) |
18
(17) |
19
(13) |
20
(17) |
21
(7) |
22
(5) |
|
23
(6) |
24
(14) |
25
(14) |
26
(18) |
27
(21) |
28
(5) |
29
(9) |
|
30
(6) |
|
|
|
|
|
|
|
From: John H. <jdh...@ac...> - 2006-04-17 15:50:06
|
>>>>> "Ryan" == Ryan Krauss <rya...@gm...> writes:
Ryan> Is there some command to refresh the system color
Ryan> dictionary?
The color manager is caching color args -> output tuples. The
original question was how to make scripts that can be easily modified
to support switching between color and grayscale. Now you want it to
work interactively from the shell --- looks like bait-and-switch to me
:-)
You'll need to clear the color mananger cache
from matplotlib.colors import colorConverter
colorConverter.cache = {}
JDH
|
|
From: Ryan K. <rya...@gm...> - 2006-04-17 15:42:48
|
Is there a similar dictionary for linetypes? I would anticipate needing to use more linetypes in grayscale than in color (i.e. everything could be solid in color). Thanks again, Ryan On 4/17/06, Ryan Krauss <rya...@gm...> wrote: > I am making some progress. The following script works, but you have > to shut down ipython if you want to switch from color to grayscale: > > from numpy import arange, sin, cos, pi > import matplotlib.colors > reload(matplotlib.colors) > cnames=3Dmatplotlib.colors.cnames > from pylab import figure, show, nx, clf, cla > fig =3D figure(4) > ax =3D fig.add_subplot(111) > t=3Darange(0,1,0.01) > y=3Dsin(2*pi*t) > grayscale=3D0 > if not grayscale: # using color > cnames['mygreen'] =3D '#008000' > else: # using grayscale > cnames['mygreen'] =3D '#808080' > > #ax.plot(t,y, color=3Dcnames['green']) > ax.plot(t,y, color=3D'mygreen') > show() > > Is there some command to refresh the system color dictionary? > > Thanks, > > Ryan > > On 4/17/06, John Hunter <jdh...@ac...> wrote: > > >>>>> "Ryan" =3D=3D Ryan Krauss <rya...@gm...> writes: > > > > Ryan> I am mildly concerned about how my plots will look if > > Ryan> someone prints my thesis out in grayscale. Is there an easy > > Ryan> way to use the same code with one switch at the beginning to > > Ryan> plot in color or grayscale? Is there a way to redefine what > > Ryan> happens when I call plot(x,y,'g-') so that 'g-' no longer > > Ryan> means green but now means something like color=3D0.75 so some > > Ryan> grayscale specification? > > > > That is an interesting problem I hadn't considered before. We have *a > > lot* of colors defined in matplotlib.colors. cnames is a dict from > > color names to rgb tuples (see below for example usage). > > > > It would be useful to support custom colors in the rc file or > > elsewhere -- then you could do something like > > > > colors.mygreen : 008000 > > > > and later redefine it to gray if you need to > > > > colors.mygreen : 808080 > > > > But you can't do that today... What you can do is manipulate the > > cnames dict. I suggest creating a module like mycolors that extends > > the cnames dict, and then using these custom color names in your > > script. When you want to go grayscale, you just modify the colors in > > mycolors. > > > > > > # mycolors.py > > from matplotlib.colors import cnames > > if 1: # using color > > cnames['mygreen'] =3D '#008000' > > else: # using grayscale > > cnames['mygreen'] =3D '#808080' > > > > > > Then later, you can use it as follows: > > > > import mycolors > > from pylab import figure, show, nx > > fig =3D figure() > > ax =3D fig.add_subplot(111) > > ax.plot((1,2,3), color=3D'mygreen') > > show() > > > > so you'll only have a single point of maintenance. We'll also accept > > a patch to the rc system to support custom colors, which is the > > preferred way to go. > > > > JDH > > > |
|
From: Ryan K. <rya...@gm...> - 2006-04-17 15:41:32
|
I am making some progress. The following script works, but you have
to shut down ipython if you want to switch from color to grayscale:
from numpy import arange, sin, cos, pi
import matplotlib.colors
reload(matplotlib.colors)
cnames=3Dmatplotlib.colors.cnames
from pylab import figure, show, nx, clf, cla
fig =3D figure(4)
ax =3D fig.add_subplot(111)
t=3Darange(0,1,0.01)
y=3Dsin(2*pi*t)
grayscale=3D0
if not grayscale: # using color
cnames['mygreen'] =3D '#008000'
else: # using grayscale
cnames['mygreen'] =3D '#808080'
#ax.plot(t,y, color=3Dcnames['green'])
ax.plot(t,y, color=3D'mygreen')
show()
Is there some command to refresh the system color dictionary?
Thanks,
Ryan
On 4/17/06, John Hunter <jdh...@ac...> wrote:
> >>>>> "Ryan" =3D=3D Ryan Krauss <rya...@gm...> writes:
>
> Ryan> I am mildly concerned about how my plots will look if
> Ryan> someone prints my thesis out in grayscale. Is there an easy
> Ryan> way to use the same code with one switch at the beginning to
> Ryan> plot in color or grayscale? Is there a way to redefine what
> Ryan> happens when I call plot(x,y,'g-') so that 'g-' no longer
> Ryan> means green but now means something like color=3D0.75 so some
> Ryan> grayscale specification?
>
> That is an interesting problem I hadn't considered before. We have *a
> lot* of colors defined in matplotlib.colors. cnames is a dict from
> color names to rgb tuples (see below for example usage).
>
> It would be useful to support custom colors in the rc file or
> elsewhere -- then you could do something like
>
> colors.mygreen : 008000
>
> and later redefine it to gray if you need to
>
> colors.mygreen : 808080
>
> But you can't do that today... What you can do is manipulate the
> cnames dict. I suggest creating a module like mycolors that extends
> the cnames dict, and then using these custom color names in your
> script. When you want to go grayscale, you just modify the colors in
> mycolors.
>
>
> # mycolors.py
> from matplotlib.colors import cnames
> if 1: # using color
> cnames['mygreen'] =3D '#008000'
> else: # using grayscale
> cnames['mygreen'] =3D '#808080'
>
>
> Then later, you can use it as follows:
>
> import mycolors
> from pylab import figure, show, nx
> fig =3D figure()
> ax =3D fig.add_subplot(111)
> ax.plot((1,2,3), color=3D'mygreen')
> show()
>
> so you'll only have a single point of maintenance. We'll also accept
> a patch to the rc system to support custom colors, which is the
> preferred way to go.
>
> JDH
>
|
|
From: James B. <jb...@cf...> - 2006-04-17 15:20:56
|
Hi From other postings I see how to use a legend with errorbar. For example: http://sourceforge.net/mailarchive/message.php?msg_id=14124668 But I see that there is still a problem with the color of the legend symbols. Specifically, if I plot using errorbar and then overplot a line, the color of the line in the legend is set to the color of the errorbar plot. For example: from pylab import * data = [1,2,3] error = [.5, .5, .5] # The errorbar plot is blue. line1 = errorbar(data, data, error, None, 'bo') # The dashed line plot is red. line2 = plot(data, data, 'r--') legend((line1,line2),('line1','line2')) show() Notice that in the legend both the points and the dashed lines are blue, when the dashed line should be red. Is there a way around this? Am I using legend() incorrectly? Thanks, James |
|
From: John H. <jdh...@ac...> - 2006-04-17 15:13:42
|
>>>>> "Ryan" == Ryan Krauss <rya...@gm...> writes:
Ryan> I am mildly concerned about how my plots will look if
Ryan> someone prints my thesis out in grayscale. Is there an easy
Ryan> way to use the same code with one switch at the beginning to
Ryan> plot in color or grayscale? Is there a way to redefine what
Ryan> happens when I call plot(x,y,'g-') so that 'g-' no longer
Ryan> means green but now means something like color=0.75 so some
Ryan> grayscale specification?
That is an interesting problem I hadn't considered before. We have *a
lot* of colors defined in matplotlib.colors. cnames is a dict from
color names to rgb tuples (see below for example usage).
It would be useful to support custom colors in the rc file or
elsewhere -- then you could do something like
colors.mygreen : 008000
and later redefine it to gray if you need to
colors.mygreen : 808080
But you can't do that today... What you can do is manipulate the
cnames dict. I suggest creating a module like mycolors that extends
the cnames dict, and then using these custom color names in your
script. When you want to go grayscale, you just modify the colors in
mycolors.
# mycolors.py
from matplotlib.colors import cnames
if 1: # using color
cnames['mygreen'] = '#008000'
else: # using grayscale
cnames['mygreen'] = '#808080'
Then later, you can use it as follows:
import mycolors
from pylab import figure, show, nx
fig = figure()
ax = fig.add_subplot(111)
ax.plot((1,2,3), color='mygreen')
show()
so you'll only have a single point of maintenance. We'll also accept
a patch to the rc system to support custom colors, which is the
preferred way to go.
JDH
|
|
From: Charlie M. <cw...@gm...> - 2006-04-17 15:06:29
|
> as a long time matlab/mac user i am all excited to have discovered > pylab and matplotlib as a full fledged alternative (that was a week > ago). i have already converted my first few matlab scripts and i like > it :) > > i have installed a suite of modules (ipython 2.4.1, numpy, matploblib > 0.87; all on os x 10.4.6 residing at [/Library/Frameworks/ > Python.framework/Versions/2.4/lib/python2.4/site-packages/]) and now > also pyobjc because i would love to make cocoaagg work (in place of > tkagg which loads kind os slow at times). > however, upon starting the plotwindow, i have see the following > exception: > > > % ipython -pylab > > Python 2.4.1 (#2, Mar 31 2005, 00:05:10) > > Type "copyright", "credits" or "license" for more information. > > > > IPython 0.7.1.fix1 -- An enhanced Interactive Python. > > ? -> Introduction to IPython's features. > > %magic -> Information about IPython's 'magic' % functions. > > help -> Python's own help system. > > object? -> Details about 'object'. ?object also works, ?? prints more. > > > > Welcome to pylab, a matplotlib-based Python environment. > > For more information, type 'help(pylab)'. > > > > In [1]: plot([1,4,3]) > > 2006-04-15 08:30:39.793 python2.4[4086] *** NSThread: ignoring > > exception '*** -[NSKeyedUnarchiver decodeObjectForKey:]: missing > > class information for object' that raised during delayed perform of > > target 0x3003160 and selector 'startWithBundle:' > > can you give me a tip? unfortunately there is hardly any mention/ > discussion on cocoaagg on the web. > > thanks for a brief note and helping to develop a great scientific > platform > > best > > ch I am replying on the matplotlib-users list, which I strongly recommend you join. The CocoaAgg backend is fairly new, and is missing a few features that other backends have. This is why there isn't much documentation online. As for the error, it looks as if your setup might not be able to find the Matplotlib.nib bundle that is used for the CocoaAgg backend.=20 I can't reproduce this error however, so it is hard to say for sure.=20 This is included in matplotlib's data folder. You should update to the new Universal 2.4.3 build of python. It gets rid of the whole python vs. pythonw. As for speed, the CocoaAgg won't be any faster than the TkAgg, since they both use Agg for the rendering. Speed is also relative to what you are plotting. The CocoaAgg does not have blitting support for animation btw. - Charlie |
|
From: Ryan K. <rya...@gm...> - 2006-04-17 14:50:31
|
I am mildly concerned about how my plots will look if someone prints my thesis out in grayscale. Is there an easy way to use the same code with one switch at the beginning to plot in color or grayscale? Is there a way to redefine what happens when I call plot(x,y,'g-') so that 'g-' no longer means green but now means something like color=3D0.75 so some grayscale specification? Does anyone have a suggestion for line types that work well in grayscale? Thanks, Ryan |
|
From: Jakob J. L. <jak...@gm...> - 2006-04-17 14:42:27
|
Thanks John & Ryan,
I'm sitting here in Germany, Berlin, trying to get some data-analysis
up to par during the Easter holidays and can't get over the fact that
I'm getting help from around the globe, within minutes.
It seems to work now!
Jakob
On 4/17/06, Ryan Krauss <rya...@gm...> wrote:
> Here is an example that works for me doing this as John mentioned
> (figure 2) or the first way that came to my mind (figure 1):
>
> from numpy import zeros, arange, sin, cos, pi
> from pylab import figure, subplot, plot, show, cla, clf
> t=3Darange(0,1,0.01)
> y=3Dzeros([len(t),4],'d')
> y[:,0]=3Dsin(2*pi*t)
> y[:,1]=3Dcos(2*pi*t)
> y[:,2]=3Dsin(2*pi*t*2+1)
> y[:,3]=3Dcos(2*pi*t*2+1)
>
> nc=3D1
> nr=3D4
>
> figure(1)
> clf()
> for x in range(nr):
> subplot(nr,1,x+1)
> plot(t,y[:,x])
>
> figure(2)
> clf()
> for x in range(nr):
> ax =3D figure(2).add_subplot(nr, 1, x+1)
> ax.hold(False)
> ax.plot(t,y[:,x])
> if ax.is_last_row():
> ax.set_xlabel('time')
>
> show()
>
>
> On 4/17/06, John Hunter <jdh...@ac...> wrote:
> >
> > You seem to be mixing idioms, between pylab which manages current
> > figure and current axes, and explicitly managing the Figure and Axes
> > instances yourself. Eg
> >
> > fig =3D figure()
> > hold(False) #<-- manipulates current axes
> > for counter in counter_list:
> > y =3D intensities_calc[counter]
> > plotnr =3D plotnr+1
> > ax =3D subplot(rownrs, colnrs, plotnr) #<-- uses curren=
t fig
> > fig.add_subplot(ax)
> > plot(x,y) #<-- uses current axes
> > if ax.is_last_row():
> > ax.set_xlabel('time')
> >
> > If you want to manage the figure and axes attributes yourself, which
> > is good practice, I suggest imposing some discipline on yourself and
> > only importing 4 things from pylab (this is what I usually do)
> >
> > from pylab import figure, show, nx, close
> >
> > Your code would then look something like:
> >
> > fig =3D figure()
> > for counter in counter_list:
> > y =3D intensities_calc[counter]
> > plotnr =3D plotnr+1
> > ax =3D fig.add_subplot(rownrs, colnrs, plotnr)
> > ax.hold(False)
> > ax.plot(x,y)
> > if ax.is_last_row():
> > ax.set_xlabel('time')
> >
> > That should work, as long as plotnr is incrementing like you expect it
> > to.
> >
> > JDH
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting lang=
uage
> > that extends applications into web and mobile media. Attend the live we=
bcast
> > and join the prime developer group breaking into this new coding territ=
ory!
> > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=
=3D121642
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
--
Jakob J. Lopez (Jak...@gm...)
|
|
From: Ken M. <mc...@ii...> - 2006-04-17 14:38:27
|
Jakob,
Here's an example of managing axes, etc yourself while plotting.
John covered just about everything I was going to mention in his
email, but I'd like to add that using "from XYZ import *" in scripts
can make them hard for other people to understand.
Ken
import pylab
nrows = 2
ncols = 3
x = pylab.arange(0, 10, 0.1) # your X here
fig = pylab.figure()
for i in range(0, nrows*ncols):
y = i * x # your Y here
# i goes 0..N-1, but the plot number goes 0..N, so add one here
ax = fig.add_subplot(nrows, ncols, i+1)
ax.plot(x, y)
if ax.is_last_row():
ax.set_xlabel('time')
pylab.show()
|
|
From: Ryan K. <rya...@gm...> - 2006-04-17 14:35:38
|
Here is an example that works for me doing this as John mentioned
(figure 2) or the first way that came to my mind (figure 1):
from numpy import zeros, arange, sin, cos, pi
from pylab import figure, subplot, plot, show, cla, clf
t=3Darange(0,1,0.01)
y=3Dzeros([len(t),4],'d')
y[:,0]=3Dsin(2*pi*t)
y[:,1]=3Dcos(2*pi*t)
y[:,2]=3Dsin(2*pi*t*2+1)
y[:,3]=3Dcos(2*pi*t*2+1)
nc=3D1
nr=3D4
figure(1)
clf()
for x in range(nr):
subplot(nr,1,x+1)
plot(t,y[:,x])
figure(2)
clf()
for x in range(nr):
ax =3D figure(2).add_subplot(nr, 1, x+1)
ax.hold(False)
ax.plot(t,y[:,x])
if ax.is_last_row():
ax.set_xlabel('time')
show()
On 4/17/06, John Hunter <jdh...@ac...> wrote:
>
> You seem to be mixing idioms, between pylab which manages current
> figure and current axes, and explicitly managing the Figure and Axes
> instances yourself. Eg
>
> fig =3D figure()
> hold(False) #<-- manipulates current axes
> for counter in counter_list:
> y =3D intensities_calc[counter]
> plotnr =3D plotnr+1
> ax =3D subplot(rownrs, colnrs, plotnr) #<-- uses current =
fig
> fig.add_subplot(ax)
> plot(x,y) #<-- uses current axes
> if ax.is_last_row():
> ax.set_xlabel('time')
>
> If you want to manage the figure and axes attributes yourself, which
> is good practice, I suggest imposing some discipline on yourself and
> only importing 4 things from pylab (this is what I usually do)
>
> from pylab import figure, show, nx, close
>
> Your code would then look something like:
>
> fig =3D figure()
> for counter in counter_list:
> y =3D intensities_calc[counter]
> plotnr =3D plotnr+1
> ax =3D fig.add_subplot(rownrs, colnrs, plotnr)
> ax.hold(False)
> ax.plot(x,y)
> if ax.is_last_row():
> ax.set_xlabel('time')
>
> That should work, as long as plotnr is incrementing like you expect it
> to.
>
> JDH
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting langua=
ge
> that extends applications into web and mobile media. Attend the live webc=
ast
> and join the prime developer group breaking into this new coding territor=
y!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=
=3D121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: John H. <jdh...@ac...> - 2006-04-17 14:27:53
|
You seem to be mixing idioms, between pylab which manages current
figure and current axes, and explicitly managing the Figure and Axes
instances yourself. Eg
fig = figure()
hold(False) #<-- manipulates current axes
for counter in counter_list:
y = intensities_calc[counter]
plotnr = plotnr+1
ax = subplot(rownrs, colnrs, plotnr) #<-- uses current fig
fig.add_subplot(ax)
plot(x,y) #<-- uses current axes
if ax.is_last_row():
ax.set_xlabel('time')
If you want to manage the figure and axes attributes yourself, which
is good practice, I suggest imposing some discipline on yourself and
only importing 4 things from pylab (this is what I usually do)
from pylab import figure, show, nx, close
Your code would then look something like:
fig = figure()
for counter in counter_list:
y = intensities_calc[counter]
plotnr = plotnr+1
ax = fig.add_subplot(rownrs, colnrs, plotnr)
ax.hold(False)
ax.plot(x,y)
if ax.is_last_row():
ax.set_xlabel('time')
That should work, as long as plotnr is incrementing like you expect it
to.
JDH
|
|
From: Jakob J. L. <jak...@gm...> - 2006-04-17 14:08:08
|
Hi Ryan,
Thanks for that very quick email and the encouragement.
Sadly, using ax.plot doesnt solve my problem.. no change in output...
Jakob
On 4/17/06, Ryan Krauss <rya...@gm...> wrote:
> I think you need to replace plot(x,y) with ax.plot(x,y).
>
> I think this script could be slightly simpler if you used the pylab
> interface to matplotlib so that you could just call figure, subplot,
> and plot without having to specify the axis.
>
> But if this is your first attempt at using matplotlib, you have done a
> fairly impressive job at searching the examples and archives first.
>
> Ryan
>
> On 4/17/06, Jakob J. Lopez <jak...@gm...> wrote:
> > Hello,
> >
> > It may very well be that this is a trivial problem, due to my lack of
> > knowledge. I did, at least, go through all the mail lists and the
> > examples of pylab (VERY NICE, BTW: I am extremely happy to have found
> > it).
> >
> > I am trying to plot a table or matrix of graphs. I want to do this
> > with a loop. So far, I have tried it with something like
> >
> > ## code starts here
> > rownrs =3D ... # defined nr of graphs in x direction
> > colnrs =3D ... # defined nr of graphs in y direction
> > x =3D .... # defined x-values here
> > plotnr =3D 0
> > fig =3D figure()
> > hold(False)
> > for counter in counter_list:
> > y =3D intensities_calc[counter]
> > plotnr =3D plotnr+1
> > ax =3D subplot(rownrs, colnrs, plotnr)
> > fig.add_subplot(ax)
> > plot(x,y)
> > if ax.is_last_row():
> > ax.set_xlabel('time')
> > show()
> >
> > ### code ends here
> >
> > all i get is one graph, in the first position. no error messages.
> >
> > please, what am i doing wrong ?
> >
> > very grateful for an answer..
> >
> > Jakob
> >
> > --
> > Jakob J. Lopez (Jak...@gm...)
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting lang=
uage
> > that extends applications into web and mobile media. Attend the live we=
bcast
> > and join the prime developer group breaking into this new coding territ=
ory!
> > http://sel.as-us.falkag.net/sel?cmdlnk&kid=110944&bid$1720&dat=121642
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
--
Jakob J. Lopez (Jak...@gm...)
|
|
From: Ryan K. <rya...@gm...> - 2006-04-17 14:03:56
|
I think you need to replace plot(x,y) with ax.plot(x,y).
I think this script could be slightly simpler if you used the pylab
interface to matplotlib so that you could just call figure, subplot,
and plot without having to specify the axis.
But if this is your first attempt at using matplotlib, you have done a
fairly impressive job at searching the examples and archives first.
Ryan
On 4/17/06, Jakob J. Lopez <jak...@gm...> wrote:
> Hello,
>
> It may very well be that this is a trivial problem, due to my lack of
> knowledge. I did, at least, go through all the mail lists and the
> examples of pylab (VERY NICE, BTW: I am extremely happy to have found
> it).
>
> I am trying to plot a table or matrix of graphs. I want to do this
> with a loop. So far, I have tried it with something like
>
> ## code starts here
> rownrs =3D ... # defined nr of graphs in x direction
> colnrs =3D ... # defined nr of graphs in y direction
> x =3D .... # defined x-values here
> plotnr =3D 0
> fig =3D figure()
> hold(False)
> for counter in counter_list:
> y =3D intensities_calc[counter]
> plotnr =3D plotnr+1
> ax =3D subplot(rownrs, colnrs, plotnr)
> fig.add_subplot(ax)
> plot(x,y)
> if ax.is_last_row():
> ax.set_xlabel('time')
> show()
>
> ### code ends here
>
> all i get is one graph, in the first position. no error messages.
>
> please, what am i doing wrong ?
>
> very grateful for an answer..
>
> Jakob
>
> --
> Jakob J. Lopez (Jak...@gm...)
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting langua=
ge
> that extends applications into web and mobile media. Attend the live webc=
ast
> and join the prime developer group breaking into this new coding territor=
y!
> http://sel.as-us.falkag.net/sel?cmdlnk&kid=110944&bid$1720&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Jakob J. L. <jak...@gm...> - 2006-04-17 13:46:30
|
Hello,
It may very well be that this is a trivial problem, due to my lack of
knowledge. I did, at least, go through all the mail lists and the
examples of pylab (VERY NICE, BTW: I am extremely happy to have found
it).
I am trying to plot a table or matrix of graphs. I want to do this
with a loop. So far, I have tried it with something like
## code starts here
rownrs =3D ... # defined nr of graphs in x direction
colnrs =3D ... # defined nr of graphs in y direction
x =3D .... # defined x-values here
plotnr =3D 0
=09fig =3D figure()
=09hold(False)
=09for counter in counter_list:
=09=09y =3D intensities_calc[counter]
=09=09plotnr =3D plotnr+1=09
=09=09ax =3D subplot(rownrs, colnrs, plotnr)
=09=09fig.add_subplot(ax)
=09=09plot(x,y)=09
=09=09if ax.is_last_row():
=09=09ax.set_xlabel('time')
=09show()
### code ends here
all i get is one graph, in the first position. no error messages.
please, what am i doing wrong ?
very grateful for an answer..
Jakob
--
Jakob J. Lopez (Jak...@gm...)
|
|
From: John H. <jdh...@ac...> - 2006-04-17 13:30:57
|
>>>>> "Erik" == Erik Tollerud <eto...@up...> writes:
Erik> Hello, I'm new to matplotlib (and fairly new to Python in
Erik> general, for that matter) with a fair amount of MATLAB
Erik> experience. I've got matplotlib running fine (I'm using the
Erik> activestate ActivePython 2.4 on win32), but when I call
Erik> commands like plot and the like in the interactive, all I
See http://matplotlib.sf.net/interactive.html, which ultimately
recommends the same solution Eric Firing points out (ipython -pylab)
but gives more detail and other options.
JDH
|
|
From: Eric F. <ef...@ha...> - 2006-04-17 05:40:25
|
Erik, Try ipython: http://ipython.scipy.org/, called as "ipython -pylab". Eric Erik Tollerud wrote: > Hello, I'm new to matplotlib (and fairly new to Python in general, for > that matter) with a fair amount of MATLAB experience. I've got > matplotlib running fine (I'm using the activestate ActivePython 2.4 on > win32), but when I call commands like plot and the like in the > interactive, all I get is a python object, with no GUI or anything. > All the backends I've seen seem geared towards scripts, unix-type > windowing, or both, so I'm not entirely sure what to do to emulate the > convinience of the MATLAB interactive plotting interface. How can I > do this? (Note that I'm not particularly attached to ActivePython, but > win32 is a must...) > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Alan G I. <ai...@am...> - 2006-04-17 01:20:49
|
On Sun, 16 Apr 2006, Erik Tollerud apparently wrote: > when I call commands like plot and the like in the > interactive, all I get is a python object Sounds like you need a show() command. hth, Alan Isaac |
|
From: Erik T. <eto...@up...> - 2006-04-16 23:57:58
|
Hello, I'm new to matplotlib (and fairly new to Python in general, for that matter) with a fair amount of MATLAB experience. I've got matplotlib running fine (I'm using the activestate ActivePython 2.4 on win32), but when I call commands like plot and the like in the interactive, all I get is a python object, with no GUI or anything.=20 All the backends I've seen seem geared towards scripts, unix-type windowing, or both, so I'm not entirely sure what to do to emulate the convinience of the MATLAB interactive plotting interface. How can I do this? (Note that I'm not particularly attached to ActivePython, but win32 is a must...) |
|
From: Eric E. <ems...@ob...> - 2006-04-14 15:32:10
|
Hi, I am desperately trying to make mpl3D work (need to produce a figure rather urgently). I have sent an email regarding this problem on the forum (see recent post on "mpl3D bugs?), but didn't get any feedback yet. Please, anybody with some hint on how to solve this, let me know. thanks in advance for your help. cheers Eric |
|
From: Ryan K. <rya...@gm...> - 2006-04-13 18:25:05
|
The new formatter works pretty well. One change though, the last line should be: else: return LogFormatterMathtext.__call__(self, x, pos) Thanks, John On 4/13/06, John Hunter <jdh...@ac...> wrote: > >>>>> "Ryan" =3D=3D Ryan Krauss <rya...@gm...> writes: > > Ryan> My love of large fonts is causing a problem. If you look at > Ryan> the attached figure, I typically have x and y tick marks > Ryan> that nearly collide in the lower left hand corner of each > Ryan> subplot. I typically end up setting the yticks by hand, but > Ryan> this isn't super convienent for each plot. I am about to > Ryan> right a function to drop the lowest ytick label, but is > Ryan> there a better approach? > > Increase the xtick.major.pad and/or ytick.major.pad rc settings by a > couple of points. > > Alternatively, if you do want to drop the leftmost xtick label, for > instance, you can easily derive a custom formatter. Here you are using > the LogFormatterMathtext > > from matplotlib.ticker import LogFormatterMathtext > > class MyFormatter(LogFormatterMathtext): > def __call__(self, x, pos=3DNone): > if pos=3D=3D0: return '' # pos=3D0 is the first tick > else: return LogFormatterMathtext(self, x, pos) > > ax.xaxis.set_major_formatter(MyFormatter()) > > Nice looking figure! > JDH > |
|
From: John H. <jdh...@ac...> - 2006-04-13 16:10:57
|
>>>>> "Ryan" == Ryan Krauss <rya...@gm...> writes:
Ryan> My love of large fonts is causing a problem. If you look at
Ryan> the attached figure, I typically have x and y tick marks
Ryan> that nearly collide in the lower left hand corner of each
Ryan> subplot. I typically end up setting the yticks by hand, but
Ryan> this isn't super convienent for each plot. I am about to
Ryan> right a function to drop the lowest ytick label, but is
Ryan> there a better approach?
Increase the xtick.major.pad and/or ytick.major.pad rc settings by a
couple of points.
Alternatively, if you do want to drop the leftmost xtick label, for
instance, you can easily derive a custom formatter. Here you are using
the LogFormatterMathtext
from matplotlib.ticker import LogFormatterMathtext
class MyFormatter(LogFormatterMathtext):
def __call__(self, x, pos=None):
if pos==0: return '' # pos=0 is the first tick
else: return LogFormatterMathtext(self, x, pos)
ax.xaxis.set_major_formatter(MyFormatter())
Nice looking figure!
JDH
|
|
From: Ryan K. <rya...@gm...> - 2006-04-13 15:50:35
|
My love of large fonts is causing a problem. If you look at the attached figure, I typically have x and y tick marks that nearly collide in the lower left hand corner of each subplot. I typically end up setting the yticks by hand, but this isn't super convienent for each plot. I am about to right a function to drop the lowest ytick label, but is there a better approach? Thanks, Ryan |
|
From: John P. <joh...@st...> - 2006-04-13 03:43:31
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Hi all,<br> <br> I have a simple 'region map' like the that shown below (currently generated as a gtk.gdk.Pixbuf) that I would like to plot on matplotlib axes, and then draw some points and lines on top of. I would also like to add to my graph a legend that shows what the various colours mean.<br> <br> Is there any way I can do this with matplot lib? The closest I found was the following, but there's no mention of the issue of creating a legend.<br> <a class="moz-txt-link-freetext" href="http://www.scipy.org/Cookbook/Matplotlib/Plotting_Images_with_Special_Values">http://www.scipy.org/Cookbook/Matplotlib/Plotting_Images_with_Special_Values</a><br> <br> <img src="cid:par...@st..." alt=""><br> <br> Cheers<br> JP<br> <pre class="moz-signature" cols="72">-- John Pye School of Mechanical and Manufacturing Engineering The University of New South Wales Sydney NSW 2052 Australia t +61 2 9385 5127 f +61 2 9663 1222 <a class="moz-txt-link-freetext" href="mailto:john.pye_AT_student_DOT_unsw.edu.au">mailto:john.pye_AT_student_DOT_unsw.edu.au</a> <a class="moz-txt-link-freetext" href="http://pye.dyndns.org/">http://pye.dyndns.org/</a></pre> </body> </html> |
|
From: Eric F. <ef...@ha...> - 2006-04-12 17:33:19
|
Andrea, I agree, the colorbar should dynamically update. A workaround might be to simply call colorbar every time you update the image data. At least part of a longer-term solution may be to change colorbar so that instead of always using contourf, it uses imshow when it is being used with a nearly continuous set of colors instead of a small discrete set. I have not had time to look at this closely, but I can add it to my list. Eric and...@ti... wrote: > Hello NG, > > I haven't stated my question very clearly, probably. I > am trying to use imshow() with a dinamically changing set of matrices. > What my application does, is just to respond to a user selection from > awxPython radiobutton and, based on the user's choice, display a > different matrix on a matplotlib figure (I am using the OO interface). > I also have an horizontal colorbar to let the user orient himself over > the matrix values. Well, these matrices have different magnitues in > value, and I was expecting that the colorbar would be updated with the > new image data. > Isn't the colorbar supposed to update when the input > image/pcolor/whatever changes? |
|
From: Eric E. <ems...@ob...> - 2006-04-12 15:36:04
|
Hi, I have tried to follow the wiki on mpl3d and fails to get anything working. First there is a minor typo I think in the first example as the text reads: (http://www.scipy.org/Wiki/Cookbook/Matplotlib/mplot3D) import mpl3d.mplot3D as p3 and should be I think import mpl3d.mplot3d as p3 with a small 'd'. But anyway I get nothing when trying to use test1 (a figure plot is opening but that's all). I do simply: import mpl3d from mpl3d import mplot3d mplot3d.test1() Nothing happens except a figure opens. When I go with the mouse over the figure I get: /usr/lib/python2.4/site-packages/matplotlib/backend_bases.py in mouse_move(self, event) 1125 if event.inaxes and event.inaxes.get_navigate(): 1126 -> 1127 try: s = event.inaxes.format_coord(event.xdata, event.ydata) 1128 except ValueError: pass 1129 except OverflowError: pass /usr/lib/python2.4/site-packages/mpl3d/mplot3d.py in format_coord(self, xd, yd) 1073 """ 1074 p = (xd,yd) -> 1075 edges = self.tunit_edges() 1076 #lines = [proj3d.line2d(p0,p1) for (p0,p1) in edges] 1077 ldists = [(proj3d.line2d_seg_dist(p0,p1,p),i) for i,(p0,p1) in enumerate(edges)] /usr/lib/python2.4/site-packages/mpl3d/mplot3d.py in tunit_edges(self, vals, M) 684 685 def tunit_edges(self, vals=None,M=None): --> 686 tc = self.tunit_cube(vals,M) 687 edges = [(tc[0],tc[1]), 688 (tc[1],tc[2]), /usr/lib/python2.4/site-packages/mpl3d/mplot3d.py in tunit_cube(self, vals, M) 678 679 def tunit_cube(self,vals=None,M=None): --> 680 if M is None: M = self.M 681 xyzs = self.unit_cube(vals) 682 tcube = proj3d.proj_points(xyzs,M) AttributeError: Axes3D instance has no attribute 'M' .... Similar problems when trying the other posted examples. My config is: ========= loaded rc file /home/emsellem/.matplotlib/matplotlibrc matplotlib version 0.87.2 verbose.level helpful interactive is False platform is linux2 numerix numpy 0.9.7.2341 font search path ['/usr/lib/python2.4/site-packages/matplotlib/mpl-data'] loaded ttfcache file /home/emsellem/.matplotlib/ttffont.cache matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-data backend GTKAgg version 2.8.0 Python 2.4.1 (#1, Sep 13 2005, 00:39:20) Type "copyright", "credits" or "license" for more information. IPython 0.7.0 -- An enhanced Interactive Python. =========================================== Thanks for any tip on this, Eric |