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
(2) |
2
(13) |
3
(13) |
4
(11) |
5
(15) |
6
(16) |
7
(1) |
|
8
(2) |
9
(1) |
10
(16) |
11
(19) |
12
(8) |
13
(20) |
14
(9) |
|
15
(2) |
16
(9) |
17
(29) |
18
(14) |
19
(13) |
20
(10) |
21
(1) |
|
22
(3) |
23
(4) |
24
(26) |
25
(11) |
26
(11) |
27
(8) |
28
(4) |
|
29
(2) |
30
(10) |
31
(17) |
|
|
|
|
|
From: Ken M. <mc...@ii...> - 2005-05-24 17:06:15
|
On May 24, 2005, at 4:37 AM, phi...@ho... wrote:
> The program i have to create must let users give lots of paremeters
> for functions.
> But he can only specify some and the program must adapt to complete by
> default settings the ones missing.
It sounds like Python's keyword arguments are exactly what you need.
They allow you to specify optional function arguments that are assigned
some default value if no value is provided:
>>> def foo(a=1, b=2, c=3):
... print a, b, c
...
>>> foo()
1 2 3
>>> foo('x')
x 2 3
>>> foo('x', 'y')
x y 3
>>> foo('x', 'y', 'z')
x y z
Python also allows you to specify the values of keyword arguments by
name, rather than by position:
>>> foo(a=47, c=12)
47 2 12
Sometimes you want to have *a lot* of keyword arguments or you need to
capture additional keyword arguments without caring what they are.
Python allows you to do this with a parameter that starts with "**",
e.g. "**kwds". When the function is called, this argument will be a
dictionary containing the keyword arguments:
>>> def bar(**kwds):
... print kwds
...
>>> bar(a=1, b=2, c=3)
{'a': 1, 'c': 3, 'b': 2}
>>> bar(a='x', c='z')
{'a': 'x', 'c': 'z'}
Python has some neat tricks to allow you to supply arguments to
function calls using tuples and dictionaries, which is something
matplotlib does a lot. It's really useful when you're just collecting
arguments to pass to another function:
import wx
class TitleFrame(wx.Frame):
def __init__(self, parent, title, **kwds):
# pass the keyword arguments on to wx.Frame.__init__()
wx.Frame.__init__(self, parent, -1, title, **kwds)
The link Andrew sent you provides a complete overview of all of these
features, explains how the arguments to a function call get mapped onto
its position and keyword arguments, and also covers all of the gotcha's
in detail. For example, you'll learn why this happens and how to work
around it:
>>> def baz(a, b=[]):
... b.append(a)
... print b
...
>>> baz(1)
[1]
>>> baz(2)
[1, 2]
>>> baz(3)
[1, 2, 3]
> It is a way for python to compensate the lack of overload for methods
> in oo.
I'm not sure how you plan to use default values to compensate for the
absence of overloaded methods. The general view of the Python
community seems to be that overloaded methods aren't really all that
hot and doing type-based dispatching with isinstance() is genrally a
Bad Thing. I've found that it isn't too difficult to design around the
lack over overloading.
If you have some application that absolutely requires it, you may want
to look into the Python Enterprise Application Kit, which has a
multiple/predicate dispatch framework (much more powerful than simple
overloading):
http://peak.telecommunity.com/
> I go through pylab.py code and although it is new to me, i have the
> intuition you are using it.
Oh yeah, matplotlib is chock full of keyword arguments. Most major
Python libraries are, because they make programming so convenient.
Pylab also makes heavy use of the **kws construct to pass keyword
arguments around.
> Is Matplotlib using the concept of partial application?
I think you probably meant to ask about "default arguments". Partial
application is a functional programming concept where calling a
function with fewer arguments than it requires returns another
function, which accepts the remaining arguments. They're a PEP about
adding this to Python 2.5:
http://www.python.org/peps/pep-0309.html
Ken
|
|
From: Chris B. <Chr...@no...> - 2005-05-24 16:29:05
|
phi...@ho... wrote:
> But he can only specify some and the program must adapt to complete by
> default settings the ones missing.
> It is a way for python to compensate the lack of overload for methods in
> oo.
This is called keyword arguments in Python, and it has a lot of use
besides "compensating for a lack of overloaded methods.
> I go through pylab.py code and although it is new to me, i have the
> intuition you are using it.
> Is Matplotlib using the concept of partial application?
Hardly any substantial Python code doesn't use keyword arguments.
By the way, you can do type checking as another way to get something
like method overloading.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: Chris B. <Chr...@no...> - 2005-05-24 16:26:26
|
A few comments:
John Hunter wrote:
> I have no problem with this. I think we should agree on a standard
> way of writing examples. I'm of two minds about how we should do this
> vis-a-vis numerix symbols.
>
> Approach 1: Help educate newbies about where symbols are coming from
>
> import pylab as p
> import matplotlib.numerix as nx
>
> x = nx.arange(100.0)
> y = nx.sin(2*nx.pi*x)
> p.plot(x,y)
> p.show()
>
> Approach 2: Given that the array packages are still being reorganized,
> use pylab as a namespace aggregator
>
> import pylab as p
>
> x = p.arange(100.0)
> y = p.sin(2*nx.pi*x)
> p.plot(x,y)
> p.show()
Why use nx, rather than n? (or N, which is what I usually use).
Actually, I usually use "import Numeric as N", I used Numeric long
before I discovered matplotlib.
I'd say that this decision should be driven somewhat by what you want
matplotlib to be. I see it as a plotting package, and I see Numeric (or
SciPyBase?) as a numerical array package. Given that, option (1) is the
way to go.
However, I can see the strong appeal of an all in one package, al la
Matlab. If we go this route (which is kind of the route at the moment),
we'll see lot of questions on this list that have nothing to do with
matplotlib, and everything to do with Numerix. WE have that already, of
course.
I really would like to see a nice, unified, set of packages for doing
scientific/numeric work with Python. I think SciPy is the natural place
for this, NOT matplotlib. My ideal version would have matplotlib as a
sub-package of SciPy. It looks like we get to the grand-unification of
Numeric, as SciPy Base, that that's a good start. I don't recall why you
didn't make matplotlib a subpackage of SciPy in the first place, but I
can understand that it happened that way, and honestly, there have been
a lot of "plotting for SciPy" starts, and none of them has gotten to the
usefulness of matplotlib, so you certainly did something right!
> 1 looks better to me for the standard symbols (arange, pi, etc...) but
> when you start to include linear algebra, FFT, MLab, etc, I am not
> sure. Currently mpl numerix uses the numarray hierarchy: is there any
> advanced word on whether this will be used in Numeric3?
I haven't noticed, but I'm guessing it'll be something like:
import scipy.fft as fft
> Basically, the question is, do we want to encourage using pylab as a
> namespace aggregator to hide the complexity of where all these symbols
> are coming from in packages whose organization is still evolving?
I'd say no, but you're point about the still evolving is a good one.
> Also, I still want to support the 'from somewhere import something'
> style of import since I think it makes the scripts more friendly to
> read for many from a procedural programming background..
>
> from pylab import hist, show
Sure. I do this a fair bit. I like it because it is explicit about where
stuff is coming from. You're also right, if you are using a procedural
style, typing "pylab." all the time gets pretty tiresome.
> Chris> One way to get there is to add much of the functionality of
> Chris> pylab to the OO interface. I really wish I had the time to
> Chris> write an OO-pylab, I think it would be really great, even
> Chris> for interactive use.
>
> I think the OO interface is already pretty easy to use.
It may have gotten better. I haven't use it much recently, my main
matplotlib using project has been handed off to another coder. I just
remember that as much as I wanted to use the OO interface, It ended up
being much easier to use pylab.whatever much of the time. Maybe the real
problem isn't what's there, but what's in the examples.
> * Easier attribute setting (eg x.facecolor = 'r') but this is
> already accomplished somewhat since the set/get introspection
> facilities are now available in matplotlib.artist to the OO user
I just looked in the class docs, and I still can't see how to set
something in an OO way, like the facecolor, for example:
x.set('facecolor', 'r') maybe?
I know I'd rather x.SetFaceColor('r') or something like that, but the
above is OK too.
> * Have some way to enable auto-redraw on attribute change for
> interactive use. This could be accomplished fairly easily with an
> ipython hook
That would be nice. Having to call Figure.show() isn't too bad though.
> * Make the backend figure canvas, figure import a little less wordy,
Yes. What I'd like to be able to do is:
import matplotlib as mpl
F = mpl.Figure()
A = F.plot(x,y)
A.xlabel("some text")
The only convenience you'd lose over the procedural interface is the
"current figure/axis" concept, which I don't like much anyway.
> Are there other areas you would like to see improved? There isn't a
> lot pylab does anymore, except manage the figure windows. And
> usually the API developer wants to do this in any case.
Well, yes, for embedded use, but for quick scripts and interactive use,
there should gbe an OO way to have your figure windows managed.
It's probably time for me to put up or shut up...I hope I'll get a
chance to put up soon.
Maybe a good start would be to go through the tutorial and users guide,
and try to re-write all the examples in an OO manner, and see what happens.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: Jean-Francois D. <jfd...@ge...> - 2005-05-24 16:01:28
|
I can't verify your script because I just solve my problem. But an hour
ago, I tried a script similar to the one you send and it was working.
My problem was related to NFS. I was using AMD to mount my nfs drive. I
decided to try autofs. At my surprise, my problem was solve. I have no
ideas about the relation between amd and matplotlib (probably pylab)
causing my bug.
Here is the error reported in /var/log/messages that lead me to the
solution :
kernel: nfs_stat_to_errno: bad nfs status return value: 11
Jean-Francois Dupuis
On Tue, 2005-05-24 at 10:34 -0500, John Hunter wrote:
> >>>>> "Jean-Francois" == Jean-Francois Dupuis <jfd...@ge...> writes:
>
> Jean-Francois> I tried GTK and GTKagg backend and nothing
> Jean-Francois> changes. The same thing append at a plot call in
> Jean-Francois> interactive mode.
>
> You do you get the same behavior with this gtk script
>
>
> import pygtk
> pygtk.require('2.0')
> import gtk
>
> def hello(event):
> print "Hello World"
> return gtk.TRUE
>
> window = gtk.Window()
> window.set_name("Test Input")
> window.connect("destroy", gtk.mainquit)
>
> vbox = gtk.VBox(spacing=3)
> window.add(vbox)
> vbox.show()
>
> button = gtk.Button("Hello World")
> button.connect("clicked", hello)
> button.show()
> vbox.pack_start(button, expand=gtk.FALSE, fill=gtk.FALSE)
>
>
> button = gtk.Button("Quit")
> button.connect("clicked", gtk.mainquit)
> button.show()
> vbox.pack_start(button, expand=gtk.FALSE, fill=gtk.FALSE)
>
>
> window.show()
> gtk.main()
>
>
>
>
|
|
From: John H. <jdh...@ac...> - 2005-05-24 15:34:59
|
>>>>> "Jean-Francois" == Jean-Francois Dupuis <jfd...@ge...> writes:
Jean-Francois> I tried GTK and GTKagg backend and nothing
Jean-Francois> changes. The same thing append at a plot call in
Jean-Francois> interactive mode.
You do you get the same behavior with this gtk script
import pygtk
pygtk.require('2.0')
import gtk
def hello(event):
print "Hello World"
return gtk.TRUE
window = gtk.Window()
window.set_name("Test Input")
window.connect("destroy", gtk.mainquit)
vbox = gtk.VBox(spacing=3)
window.add(vbox)
vbox.show()
button = gtk.Button("Hello World")
button.connect("clicked", hello)
button.show()
vbox.pack_start(button, expand=gtk.FALSE, fill=gtk.FALSE)
button = gtk.Button("Quit")
button.connect("clicked", gtk.mainquit)
button.show()
vbox.pack_start(button, expand=gtk.FALSE, fill=gtk.FALSE)
window.show()
gtk.main()
|
|
From: Christian M. <mee...@un...> - 2005-05-24 15:30:37
|
Hi, thanks for your answers. You are right Darren, I should have had a look in the archives first. It won't happen again. Anyway: I guess from this starting point I can go on. Cheers Christian |
|
From: Andrew S. <str...@as...> - 2005-05-24 15:05:20
|
phi...@ho... wrote: > Hi list, > > The program i have to create must let users give lots of paremeters for > functions. > But he can only specify some and the program must adapt to complete by > default settings the ones missing. > It is a way for python to compensate the lack of overload for methods in > oo. > > I go through pylab.py code and although it is new to me, i have the > intuition you are using it. > Is Matplotlib using the concept of partial application? Yes, pylab does this, although I've never heard default arguments called a "concept of partial application." I might suggest that pylab's handling of arguments is rather elaborate for a newbie with its heavy use of *args and **kwargs and nested call structures, but don't let that stop you! :) In case you haven't seen it, check out the relevant part of the tutorial: "More on Defining Functions" http://docs.python.org/tut/node6.html#SECTION006700000000000000000 Cheers! Andrew |
|
From: John H. <jdh...@ac...> - 2005-05-24 14:16:12
|
>>>>> "Christian" == Christian Meesters <mee...@un...> writes:
Christian> Hi, I'd like to plot my data and indicate where the
Christian> instrument I used actually actually should truncate
Christian> those data. My idea is to have y values from zero to a
Christian> certain maximum and to draw a red line from zero to the
Christian> lower limit, then to continue with this line colored in
Christian> black, and finally end this very line colored red from
Christian> the upper limit to the maximum of my data. How is this
Christian> to accomplish?
Sorry for the delay in answering this. I am not 100% sure I
understand your question, but it appears to me that you want to color
a line differently depending on it's y value. You can do this with
masked arrays, which are supported in matplotlib CVS
import matplotlib.numerix.ma as ma
from matplotlib.numerix import logical_or
from pylab import plot, show, arange, sin, pi
t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
upper = 0.77
lower = -0.77
supper = ma.masked_where(s < upper, s)
slower = ma.masked_where(s > lower, s)
smiddle = ma.masked_where(logical_or(s<lower, s>upper), s)
plot(t, slower, 'r', t, smiddle, 'b', t, supper, 'g')
show()
Another approach, which will work with any recent matplotlib
(including 0.71), is to use a shaded region to indicate your ranges.
from pylab import plot, show, arange, sin, pi, axhspan
t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
upper = 0.77
lower = -0.77
plot(t, s)
axhspan(upper, 1, facecolor='red', alpha=0.5)
axhspan(-1, lower, facecolor='blue', alpha=0.5)
show()
Christian> A second problem for me is probably trivial for more
Christian> experienced users: How to adjust the size of x- &
Christian> y-labels (using subplot)?
Christian> I should mention that I'm stuck with version 0.71 for a
Christian> while ...
xlabel('my label', fontsize=16)
You can also control the default x and y label size, and the tick
label size, in your rc file
http://matplotlib.sourceforge.net/.matplotlibrc
To set the fontsize for the tick labels, you can do something like
locs, labels = xticks()
set(labels, fontsize=16)
Should help!
JDH
|
|
From: Darren D. <dd...@co...> - 2005-05-24 13:54:40
|
On Tuesday 24 May 2005 9:23 am, Christian Meesters wrote:
> However, my second questions remains. But I wrote it down the dumb way:
> Of course, what I meant is the numbering and not the labelling. So, can
> somebody tell me how change font and size of the numbering along the
> axes?
Try searching the matplotlib-users archive. I searched for <ticklabel size>=
=20
and the first hit I got had the answer:
for label in gca().get_yticklabels():=20
label.set_size(6)
Darren
|
|
From: Christian M. <mee...@un...> - 2005-05-24 13:23:41
|
Hi Some time passed since my post, so I guess there is just no answer for my main question. At least there is no direct approach, right? However, my second questions remains. But I wrote it down the dumb way: Of course, what I meant is the numbering and not the labelling. So, can somebody tell me how change font and size of the numbering along the axes? Christian On 21 May 2005, at 08:41, Christian Meesters wrote: > Hi, > > I'd like to plot my data and indicate where the instrument I used > actually actually should truncate those data. My idea is to have y > values from zero to a certain maximum and to draw a red line from zero > to the lower limit, then to continue with this line colored in black, > and finally end this very line colored red from the upper limit to the > maximum of my data. > How is this to accomplish? > > A second problem for me is probably trivial for more experienced > users: How to adjust the size of x- & y-labels (using subplot)? > > I should mention that I'm stuck with version 0.71 for a while ... > > TIA > Regards, > Christian > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: <phi...@ho...> - 2005-05-24 09:37:09
|
Hi list, The program i have to create must let users give lots of paremeters for functions. But he can only specify some and the program must adapt to complete by default settings the ones missing. It is a way for python to compensate the lack of overload for methods in oo. I go through pylab.py code and although it is new to me, i have the intuition you are using it. Is Matplotlib using the concept of partial application? Thans a lots, regards, Philippe Collet |
|
From: Ryan K. <rya...@co...> - 2005-05-24 03:24:07
|
<!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">
Sounds good. I am not be able to work on it for a couple of weeks, but
I will give it a shot. (I have some other deadlines but may ticker
with it a little bit before my other stuff is due).<br>
<br>
Ryan<br>
<br>
John Hunter wrote:
<blockquote cite="mid...@pe..."
type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">"Ryan" == Ryan Krauss <a class="moz-txt-link-rfc2396E" href="mailto:rya...@co..."><rya...@co...></a> writes:
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->
Ryan> Thanks Dale. Based on that example, I can set the fontsize
Ryan> from a script. Is there a way to do it from the rc file?
Ryan> It would be great to set it once with the rest of my font
Ryan> preferences.
No, but it would not be difficult to add these parameters in rc.
Ready to become an mpl developer? :-)
Look at matplotlib/__init__.py to see how the rc params are
processed. Add the ones you want and use them in legend.py, following
the example of Text or Line2D in matplotlib.text and matplotlib.line2d
respectively.
JDH
</pre>
</blockquote>
<br>
</body>
</html>
|
|
From: Jean-Francois D. <jfd...@ge...> - 2005-05-24 00:36:26
|
Hi,
I installed matplotlib and only the root user can execute a matplotlib
script without freezing the computer. Under root, everything seem
working well. As a simple user, the script freeze without displaying
anything and only a kill signal can stop the process.
I tried GTK and GTKagg backend and nothing changes. The same thing
append at a plot call in interactive mode.
Someone have an idea of what is going on ?
Thanks,
Jean-Francois Dupuis
OS : Linux 2.6.10-1.770_FC3smp
Here are some output of a simple script :
simple.py :System infos
from pylab import *
plot([1,2,3])
show()
As simple user :
> python simple.py --verbose-debug-annoying
matplotlib data path /usr/share/matplotlib
loaded rc file /usr/share/matplotlib/.matplotlibrc
matplotlib version 0.80
verbose.level debug-annoying
interactive is False
platform is linux2
loaded modules: ['pylab', '__future__', 'copy_reg', 'sre_compile',
'distutils', 'itertools', '_sre', 'japanese.aliases', 'site',
'__builtin__', 'datetime', 'encodings', 'encodings.encodings',
'sre_constants', 'distutils.string', 'dateutil', 'matplotlib.datetime',
'posixpath', 'matplotlib.warnings', 'encodings.codecs',
'matplotlib.sys', 'pytz.datetime', 're', 'os.path', 'pytz.sys',
'_codecs', 'distutils.sysconfig', 'encodings.exceptions', 'pytz.sets',
'stat', 'zipimport', 'string', 'warnings', 'encodings.types',
'UserDict', 'encodings.utf_8', 'matplotlib', 'japanese', 'sys',
'japanese.aliases.encodings', 'pytz.tzinfo', 'pytz', '__main__',
'matplotlib.__future__', 'codecs', 'distutils.re', 'matplotlib.pytz',
'types', 'strop', 'matplotlib.dateutil', 'matplotlib.os', 'sre',
'bisect', 'matplotlib.distutils', 'signal', 'distutils.errors',
'linecache', 'distutils.os', 'posix', 'encodings.aliases', 'sets',
'exceptions', 'sre_parse', 'pytz.bisect', 'distutils.sys', 'os']
numerix Numeric 23.1
font search path ['/usr/share/matplotlib']
trying fontname /usr/share/matplotlib/VeraIt.ttf
trying fontname /usr/share/matplotlib/cmsy10.ttf
trying fontname /usr/share/matplotlib/VeraMoBd.ttf
trying fontname /usr/share/matplotlib/VeraSe.ttf
trying fontname /usr/share/matplotlib/cmmi10.ttf
trying fontname /usr/share/matplotlib/Vera.ttf
loaded ttfcache file /gel/usr/jfdupuis/.ttffont.cache
backend GTKAgg version 2.4.0
(... process killed after a while)
As root :
# python simple.py --verbose-debug-annoying
matplotlib data path /usr/share/matplotlib
loaded rc file /usr/share/matplotlib/.matplotlibrc
matplotlib version 0.80
verbose.level debug-annoying
interactive is False
platform is linux2
loaded modules: ['pylab', '__future__', 'copy_reg', 'sre_compile',
'distutils', 'itertools', '_sre', 'japanese.aliases', 'site',
'__builtin__', 'datetime', 'encodings', 'encodings.encodings',
'sre_constants', 'distutils.string', 'dateutil', 'matplotlib.datetime',
'posixpath', 'matplotlib.warnings', 'encodings.codecs',
'matplotlib.sys', 'pytz.datetime', 're', 'os.path', 'pytz.sys',
'_codecs', 'distutils.sysconfig', 'encodings.exceptions', 'pytz.sets',
'stat', 'zipimport', 'string', 'warnings', 'encodings.types',
'UserDict', 'encodings.utf_8', 'matplotlib', 'japanese', 'sys',
'japanese.aliases.encodings', 'pytz.tzinfo', 'pytz', '__main__',
'matplotlib.__future__', 'codecs', 'distutils.re', 'matplotlib.pytz',
'types', 'strop', 'matplotlib.dateutil', 'matplotlib.os', 'sre',
'bisect', 'matplotlib.distutils', 'signal', 'distutils.errors',
'linecache', 'distutils.os', 'posix', 'encodings.aliases', 'sets',
'exceptions', 'sre_parse', 'pytz.bisect', 'distutils.sys', 'os']
numerix Numeric 23.1
font search path ['/usr/share/matplotlib']
trying fontname /usr/share/matplotlib/VeraIt.ttf
trying fontname /usr/share/matplotlib/cmsy10.ttf
trying fontname /usr/share/matplotlib/VeraMoBd.ttf
trying fontname /usr/share/matplotlib/VeraSe.ttf
trying fontname /usr/share/matplotlib/cmmi10.ttf
trying fontname /usr/share/matplotlib/Vera.ttf
loaded ttfcache file /root/.ttffont.cache
backend GTKAgg version 2.4.0
FigureCanvasAgg.draw
RendererAgg.__init__
RendererAgg._get_agg_font
findfont failed Lucida Grande
findfont failed Verdana
findfont failed Geneva
findfont failed Lucida
findfont found Bitstream Vera Sans, normal, normal 500, normal,
10.0
findfont returning /usr/share/matplotlib/Vera.ttf
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
|
|
From: John H. <jdh...@ac...> - 2005-05-24 00:04:32
|
>>>>> "Ryan" == Ryan Krauss <rya...@co...> writes:
Ryan> Thanks Dale. Based on that example, I can set the fontsize
Ryan> from a script. Is there a way to do it from the rc file?
Ryan> It would be great to set it once with the rest of my font
Ryan> preferences.
No, but it would not be difficult to add these parameters in rc.
Ready to become an mpl developer? :-)
Look at matplotlib/__init__.py to see how the rc params are
processed. Add the ones you want and use them in legend.py, following
the example of Text or Line2D in matplotlib.text and matplotlib.line2d
respectively.
JDH
|
|
From: Ryan K. <rya...@co...> - 2005-05-23 23:54:37
|
Thanks Dale. Based on that example, I can set the fontsize from a
script. Is there a way to do it from the rc file? It would be great to
set it once with the rest of my font preferences.
Ryan
Darren Dale wrote:
>On Monday 23 May 2005 6:39 pm, Ryan Krauss wrote:
>
>
>>Is there a setting in the .matplotlibrc file to control the font size
>>for the legend?
>>
>>I tried setting "font.size : x-large #medium", but that didn't
>>work.
>>
>>I also tried just including prop=FontProperties('large') in the legend
>>call, but that gave an error. So, I am not understanding the help on
>>legend either.
>>
>>
>
>Try checking legend_demo.py from the examples.
>
>Darren
>
>
|
|
From: Darren D. <dd...@co...> - 2005-05-23 23:00:03
|
On Monday 23 May 2005 6:39 pm, Ryan Krauss wrote:
> Is there a setting in the .matplotlibrc file to control the font size
> for the legend?
>
> I tried setting "font.size : x-large #medium", but that didn't
> work.
>
> I also tried just including prop=FontProperties('large') in the legend
> call, but that gave an error. So, I am not understanding the help on
> legend either.
Try checking legend_demo.py from the examples.
Darren
|
|
From: Ryan K. <rya...@co...> - 2005-05-23 22:39:12
|
Is there a setting in the .matplotlibrc file to control the font size
for the legend?
I tried setting "font.size : x-large #medium", but that didn't
work.
I also tried just including prop=FontProperties('large') in the legend
call, but that gave an error. So, I am not understanding the help on
legend either.
Thanks,
Ryan
|
|
From: John H. <jdh...@ac...> - 2005-05-23 15:03:59
|
>>>>> "Chris" == Chris Barker <Chr...@no...> writes:
Chris> Fernando Perez wrote:
>> I'd also suggest removing from all example code 'from pylab
>> import *' statements.
Chris> Here here! (hear hear?). I'd really like to see all those
Chris> "import *"'s go away.
I have no problem with this. I think we should agree on a standard
way of writing examples. I'm of two minds about how we should do this
vis-a-vis numerix symbols.
Approach 1: Help educate newbies about where symbols are coming from
import pylab as p
import matplotlib.numerix as nx
x = nx.arange(100.0)
y = nx.sin(2*nx.pi*x)
p.plot(x,y)
p.show()
Approach 2: Given that the array packages are still being reorganized,
use pylab as a namespace aggregator
import pylab as p
x = p.arange(100.0)
y = p.sin(2*nx.pi*x)
p.plot(x,y)
p.show()
1 looks better to me for the standard symbols (arange, pi, etc...) but
when you start to include linear algebra, FFT, MLab, etc, I am not
sure. Currently mpl numerix uses the numarray hierarchy: is there any
advanced word on whether this will be used in Numeric3?
import matplotlib.numeric.fft as nxfft
import matplotlib.numeric.mlab as nxmlab
???
Basically, the question is, do we want to encourage using pylab as a
namespace aggregator to hide the complexity of where all these symbols
are coming from in packages whose organization is still evolving?
Also, I still want to support the 'from somewhere import something'
style of import since I think it makes the scripts more friendly to
read for many from a procedural programming background..
from pylab import hist, show
Chris> One way to get there is to add much of the functionality of
Chris> pylab to the OO interface. I really wish I had the time to
Chris> write an OO-pylab, I think it would be really great, even
Chris> for interactive use.
I think the OO interface is already pretty easy to use. Some ease of
use areas I see are
* Easier attribute setting (eg x.facecolor = 'r') but this is
already accomplished somewhat since the set/get introspection
facilities are now available in matplotlib.artist to the OO user
* Have some way to enable auto-redraw on attribute change for
interactive use. This could be accomplished fairly easily with an
ipython hook
* Make the backend figure canvas, figure import a little less wordy,
Are there other areas you would like to see improved? There isn't a
lot pylab does anymore, except manage the figure windows. And
usually the API developer wants to do this in any case.
JDH
|
|
From: George N. <ag...@no...> - 2005-05-22 22:01:11
|
Thought I'd summarize my experiences. They may result from a messed up =20= installation, but could be useful for others -- Bradley Minch, using =20 10.2.8, seems to have had my initial problem, #I below. Excuse the overlong email here. Many thanks to Darren Dale for helping me out. Setup: matplotlib 0.80, ipython 0.6.13, readline.so [from =20 www.pycs.net/bbum/2004/1/21/readline.so.gz] zlib, libpng, tk_inter8.4, freetype 2.1.9 [produces =20 libfreetype.6.3.7.dylib], wx-2.6-mac-unicode, standard Panther Apple Python 2.3, updated to MacPython, scipy 0.3.2 [from =20 http://cbis.anu.edu.au/misc/SciPy_complete-0.3.2.mpkg.zip] Numeric 23.1, OS X 10.3.9 Running with TkAgg backend set in .matplotlibrc 1. Original problem: First time I did from pylab import * (or ipython -pylab) got error while font_manager was trying to build the ttffont.cache... =C2=A0 File =20 "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-=20= packages/matplotlib/font_manager.py", line 347, in ttfFontProperty =C2=A0=C2=A0=C2=A0 size =3D str(float(font.get_fontsize())) AttributeError: get_fontsize Now, when building the ttf cache, font_manager searches for TrueType =20 fonts. 1. in the matplotlib data directory =20 /System/Library/Frameworks/Python.framework/Versions/2.3/share/=20 matplotlib 2. In the normal Mac places /Library/Fonts/, /System/Library/Fonts,/Network/Library/Fonts, =20 ~/Library/Fonts Tracked this problem down to the font VT102Font that I had in =20 ~/Library/Fonts. Moved VT102Font to (new directory) ~/SuspectFonts off the font path. Problem 1 solved! from pylab import * now happily built a =20 ~/.ttffont.cache for me. 2. Next problem -- absurdly large, corrupted, PS files. Ran this script that produces simple plots, with axes labelled (by =20 default) with sans-serif numbers. dt =3D 0.01 t =3D arange(0,10,dt) subplot(211) s =3D sin(t) plot(t,s) subplot(212) c =3D cos(t) plot(t,c) savefig('/Users/agn/sincos.png') -- produced a nice file ~28KB in size savefig('/Users/agn/sincos.ps') -- produced a file of 4.6MB. Trying to view this file using Apple preview, or converting it to pdf =20= with ps2pdf (ps2pdf13, v1.3, 21Feb2002) or Apple pstopdf gave an error. =20= E.g. ps2pdf sincos.ps gave: Error: /invalidfont in -dict- Operand stack: LucidaGrande --dict:10/14(L)-- Font LucidaGrande =20 --dict:10/14(L)-- LucidaGrande Darren Dale sorted me out here. The default sans-serif font used to =20 label the axes is the first font in the san-serif line (about line 113) =20= in the .matplotlibrc startup file. The default .matplotlibrc gives =20 LucidaGrande as that default font. LucidaGrande.dfont is an Apple =20 standard font living in /System/Library/Fonts. He suggested that I put Bitstream Vera Sans as the first font on the =20= san-serif line in .matplotlibrc, so that this font, which comes with =20 matplotlib, and lives in =20 /System/Library/Frameworks/Python.framework/Versions/2.3/share/=20 matplotlib is used as the default sans-serif font instead. Problem 2 solved. savefig('/Users/agn/sincos.ps') now gives a 176 KB =20 ps, that reduces to a 36KB pdf. Perfectly OK now. Suspected same problem would arise for other families, so put Bitstream =20= Vera Serif as the default serif font, & Bitstream Vera Sans Mono as =20 the default monospace font. 3. John Hunter suggested that problem 2 might be solved if I were to =20 modify line 180 of .matplotlibrc to set ps.useafm : True This should give smaller Ps files at the cost of breaking mathtext =20 (which incidentally *does* (almost completely) work for me with =20 ps.useafm : False). Unfortunately, setting ps.useafm true doesn't work for me. Now if =20 ps.useafm is True, font_manager only makes a cache -- .afmfont.cache =20= -- when you first try to save to PS. I have at present the problem that =20= font_manager is falling over when trying to make this cache. One of the =20= Chinese-type opentype (.otf) fonts --- = /System/Library/Fonts/=E3=83=92=E3=83=A9=E3=82=AD=E3=82=99=E3=83=8E=E6=98=8E= =E6=9C=9D =20 Pro W3.otf -- or in hex /System/Library/Fonts/=20 \xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe6\x98\x8e=20= \xe6\x9c\x9d Pro W3.otf causes an infinite loop with 'Key error converting in AFM' in afm.py, =20= when trying to parse the header. Quite a few fonts are in 'seen', -- {'pbkd8a.afm': 1, 'pagd8a.afm': 1, 'pbkl8a.afm': 1, 'ptmri8a.afm': 1, =20= 'pncb8a.afm': 1, 'phvbo8a.afm': 1, 'phvb8an.afm': 1, 'phvro8an.afm': 1, =20= 'ptmb8a.afm': 1, 'pcrro8a.afm': 1, 'pcrb8a.afm': 1, 'pplr8a.afm': 1, =20 'pzdr.afm': 1, 'cmsy10.afm': 1, 'phvlo8a.afm': 1, 'cmr10.afm': 1, =20 'phvb8a.afm': 1, 'phvl8a.afm': 1, 'pncri8a.afm': 1, 'pagdo8a.afm': 1, =20= 'putri8a.afm': 1, 'pzcmi8a.afm': 1, 'ptmbi8a.afm': 1, 'phvro8a.afm': 1, =20= 'putr8a.afm': 1, 'phvbo8an.afm': 1, 'pcrr8a.afm': 1, 'putbi8a.afm': 1, =20= 'pcrbo8a.afm': 1, 'cmtt10.afm': 1, 'pplb8a.afm': 1, 'pbkdi8a.afm': 1, =20= 'pagk8a.afm': 1, 'pncr8a.afm': 1, 'putb8a.afm': 1, 'psyr.afm': 1, =20 'pagko8a.afm': 1, 'pplbi8a.afm': 1, 'pbkli8a.afm': 1, 'pncbi8a.afm': 1, =20= 'cmmi10.afm': 1, 'ptmr8a.afm': 1, 'pplri8a.afm': 1, 'cmex10.afm': 1, =20 'phvr8a.afm': 1, =20 '\xe3\x83\x92\xe3\x83\xa9\xe3\x82\xad\xe3\x82\x99\xe3\x83\x8e\xe6\x98\x8=20= e\xe6\x9c\x9d Pro W3.otf': 1, 'phvr8an.afm': 1} so have presumably been successfully parsed, except for this .otf font. Haven't sorted this problem out yet. I suppose I could try removing the =20= East Asian fonts from the system folder, or changing font_manager so it =20= does not read them in. 4. Conclusion: For me, the only fonts that work are the BitStream Vera =20= Fonts supplied with matplotlib. Not ideal, because they do do not =20 include italic, cursive, or fantasy fonts (although they do include an =20= *oblique* sans serif font). But this is sufficient to make matplotlib =20= work for most practical purposes, especially as mathtext does work =20 (though ps2pdf can't convert the ps fonts to pdf; Apple pstopdf (used =20= by Preview) must be used) Again, many thanks to Darren Dale and also to John Hunter and Fernando =20= Perez for their replies. George Nurser. |
|
From: John H. <jdh...@ac...> - 2005-05-22 00:53:55
|
>>>>> "Ryan" == Ryan Krauss <rya...@co...> writes:
Ryan> Setting the pad in the .matplotlibrc file was an excellent
Ryan> solution for me. And being able to set all my font
Ryan> preferences there is a great feature that I don't think
Ryan> Matlab has. One of the first things I needed to do in Matlab
Ryan> was write a script that formatted my figures the way I
Ryan> liked. I assumed I needed to do the same thing in mpl, but
Ryan> not so. Good Stuff!
As a long time matlab user, I grew tired of all the arcane commands
you have to execute to customize the figure. So I tried to make the
most common stuff configurable in the rc file. One feature I use a lot
is directory level customization. mpl looks in the current directory
first for the rc file, then HOME and then in the site locations.
Typically, I want different defaults for the web, for publication and
for the screen, and use directory specific rc file for these. See
also the "rc" command, for changing the defaults on a per script
basis...
JDH
|
|
From: Ryan K. <rya...@co...> - 2005-05-22 00:45:00
|
Setting the pad in the .matplotlibrc file was an excellent solution for me. And being able to set all my font preferences there is a great feature that I don't think Matlab has. One of the first things I needed to do in Matlab was write a script that formatted my figures the way I liked. I assumed I needed to do the same thing in mpl, but not so. Good Stuff! Ryan John Hunter wrote: >>>>>>"Ryan" == Ryan Krauss <rya...@co...> writes: >>>>>> >>>>>> > > Ryan> I have a question about tick formatting. I have a semilogx > Ryan> plot and if I resize the xticks using locs , labels = xticks > Ryan> () set(labels , size=ticksize) I like the size and the font, > Ryan> but the exponents (10^0) run into the axis. > >The reasons for are complicated and have to do with an optimization to >make exponential ticking faster, and I won't go into them right now. >Suffice it to say that it is a bug, but there may be a workaround > >Do any of the suggestions here help? > > http://matplotlib.sourceforge.net/faq.html#TEXTOVERLAP > >Note you can also control the "pad" in points of the offset of the >ticks from the xaxis > > ticks = ax.xaxis.get_major_ticks() > for tick in ticks: > tick.set_pad(6) > >or if you prefer > > set(ax.xaxis.get_major_ticks(), pad=6) > >The default pad is controlled by an rc parameter > > tick.major.pad : 4 # distance to major tick label in points > tick.minor.pad : 4 # distance to the minor tick label in points > >See http://matplotlib.sf.net/.matplotlibrc > >JDH > > > |
|
From: Christian M. <mee...@un...> - 2005-05-21 06:47:15
|
Hi, I'd like to plot my data and indicate where the instrument I used actually actually should truncate those data. My idea is to have y values from zero to a certain maximum and to draw a red line from zero to the lower limit, then to continue with this line colored in black, and finally end this very line colored red from the upper limit to the maximum of my data. How is this to accomplish? A second problem for me is probably trivial for more experienced users: How to adjust the size of x- & y-labels (using subplot)? I should mention that I'm stuck with version 0.71 for a while ... TIA Regards, Christian |
|
From: John H. <jdh...@ac...> - 2005-05-20 22:23:57
|
>>>>> "Jeff" == Jeff Peery <jef...@se...> writes:
Jeff> Hi again, my operating system is windows 2000 professional,
Jeff> and I'm using python 2.4, wxpython 2.5.5, and
Jeff> matplotlib-0.80.win32-py2.4.exe. I attached my code. The
Jeff> problem is that the program crashes when I try to close a
Jeff> plot or plot a second plot. Any ideas how to make this work?
Jeff> Thanks.
Don't import pylab while using the OO API -- see
examples/embedding_in_wx*.py and
http://matplotlib.sourceforge.net/faq.html#OO
Should help...
|
|
From: Jeff P. <jef...@se...> - 2005-05-20 19:38:01
|
#!/usr/bin/env python
#Boa:App:BoaApp
import wx
import sample
modules ={'sample': [1, 'Main frame of Application', 'none://sample.py']}
class BoaApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
self.main = sample.create(None)
# needed when running from Boa under Windows 9X
self.SetTopWindow(self.main)
self.main.Show();
return True
def main():
application = BoaApp(0)
application.MainLoop()
if __name__ == '__main__':
main()
|
|
From: John H. <jdh...@ac...> - 2005-05-20 16:18:16
|
>>>>> "John" == John Gill <jn...@eu...> writes:
John> Attached is a patch to collections.py and legend.py to make
John> the auto-legend stuff smarter.
John> A couple of caveats.
John> The new code doesn't makes as much use of C++ -- there might
John> be performance issues for plots with large numbers of
John> points, although I haven't encountered any.
John> I don't think any of my tests include plots with
John> LineCollections, so there is a reasonable chance that code
John> in _auto_legend_data has not been exercised.
John> Other than that, it seems to do the trick.
Thanks John, also added to CVS. I think this could be extremely slow
for very large lines (100k points, for example) but I don't see that
as a real problem because auto placement is not the default for
legends (for precisely this reason).
Cheers!
JDH
|