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
|
|
From: matthew a. <ma...@ca...> - 2004-03-08 23:27:48
|
It seems to me, from the user's point of view, that the DPI is a rendering
option, not a plotting option. I should be able to take the same plot:
p = plot(sin(x))
and render it to screen
show(p, dpi=96, size=(8, 6))
OR
show(p, pixelsize=(768, 576))
or render it for printing:
savefig('p.png', dpi=300, size=(6, 4))
OR
savefig('p.png', pixelsize=(1800, 1200))
OR
savefig('p.eps', size=(6, 4))
I think people are going to want different DPI settings for screen vs.
printing. So perhaps dpi should be an option to show() and savefig()
rather than to plot?
And rather than having different DPI defaults for each backend, I would
have thought it better to have two global default DPI settings, one for
the screen and one for the printer. You would also want two default plot
sizes in inches.
In a sane world you wouldn't need to set the DPI for the screen, you could
trust X or Windows to provide it, but in practice what X says isn't always
useful.
You might even consider adding a print() command that renders a plot with
the default printing settings to a file (or even straight to the
printer?). Perhaps savefig() should use the default printing settings when
exporting an .eps file? (Although the DPI is ignored the plot size is
still relevant.)
I hope you find these ponderings useful. I am still a bit ignorant about
aspects of matplotlib so I'll hope you'll excuse me for that.
Cheers,
Matthew.
On Mon, 8 Mar 2004, John Hunter wrote:
> None of this matters, of course, for PS, which is resolution
> independent.
>
> dpi is not really suitably named because of this additional parameter
> PIXELS_PER_INCH. dpi is really a resolution parameter. When you
> increase dpi, the relative sizes of everything in your image should
> increase proportionately (line widths, text sizes, etc) but you have
> more pixels of resolution. When you increase figure size for a give
> dpi, everything should appear smaller because the physical size of the
> objects in your canvas haven't changed, but your canvas has increased.
>
> I'm open to suggestions on how to make this better.
>
> JDH
|
|
From: John H. <jdh...@ac...> - 2004-03-08 21:35:39
|
>>>>> "Al" == Al Schapira <a.d...@wo...> writes:
Al> In order to get the size of the overall plot window to
Al> anywhere near full screen, I've had to use something like
Al> figure(1, figsize=(18,12), dpi=72) or figure(1,
Al> figsize=(9,6), dpi=144)
Al> Both produce the same overall size plot window (11.25" wide by
Al> 8" tall), but in the latter case, the text size is much larger
Al> than in the latter case. Likewise the linewidths.
Al> Can you please explain the interaction among the dpi value,
Al> the font sizes displayed, and the overall plot size.
Hi Al,
This is a complicated issue and I don't have a full answer for you.
The problem is compounded by the fact that I am trying to make the DPI
parameter produce figures that look the same across the backends, and
different backends have often have an additional parameter that makes
assumptions about the number of pixels per inch on your display - eg
gd assumes 96, and these are not under my control.
The total figure width in pixels is figure width in inches * dpi;
ditto for height. If you set dpi to your device PIXELS_PER_INCH, the
width should be correct if you measure it on the screen with a ruler.
You will probably need to set PIXELS_PER_INCH for the backend you are
using to be correct for your display. This is a parameter the
respective backend files, eg, in matplotlib/backends/backend_gtk.py.
For backend_agg, you will have to change it both in
src/_backend_agg.cpp and matplotlib/backends/backend_agg.py. This is
something I would like to rationalize and perhaps move to the rc file.
I suggest setting it to your display width / pixels width, eg, 116 in
your example. Then
figure( (8,6), dpi=116)
should produce a an 8 inch by 6 inch figure. Let me know. Then
default dpi can be set in the rc file.
None of this matters, of course, for PS, which is resolution
independent.
dpi is not really suitably named because of this additional parameter
PIXELS_PER_INCH. dpi is really a resolution parameter. When you
increase dpi, the relative sizes of everything in your image should
increase proportionately (line widths, text sizes, etc) but you have
more pixels of resolution. When you increase figure size for a give
dpi, everything should appear smaller because the physical size of the
objects in your canvas haven't changed, but your canvas has increased.
I'm open to suggestions on how to make this better.
JDH
|
|
From: John H. <jdh...@ac...> - 2004-03-08 19:15:37
|
>>>>> "Andrew" == Andrew Straw <str...@as...> writes:
Andrew> 2) Is it a bug that the polygon is not filled
Yes, none of the rest of the drawing interface uses Polygon so I
hadn't noticed it. In patches.py, replace line 330 with
renderer.draw_polygon(gc, rgbFace, vertices)
Below is your (modified) original script, with comments that answer
your questions. With the patch above and some changes I made, it now
works (cool). It would be nice to figure out how to properly include
this in the regular API.
JDH
from matplotlib.matlab import *
from matplotlib.patches import Rectangle, Polygon
def filly(x,y1,y2,**kwargs):
ax = gca()
xy = []
for xi, yi in zip(x,y1):
xy.append( (xi,yi) )
for xi, yi in zip(x[::-1],y2[::-1]):
xy.append( (xi,yi) )
xy.append( xy[0] )
# see
# http://matplotlib.sourceforge.net/matplotlib.transforms.html
# for information on the new transform system. You can place
# objects in a variety of coord systems, most freqeuntly data or
# axes. data are the old-style coords you are used to. axes
# coords are normalized on a 0-1 scale. The xaxis and yaxis
# instances store default transforms so you can easily create new
# objects in either coord system. ax.xaxis.transData transforms
# data units to display units for the xaxis. ax.xaxis.transAxis
# transforms axis units to display units. You have done it right
# here.
polygon = Polygon(
ax.dpi, ax.bbox,
xy,
transx = ax.xaxis.transData, # what does this do?
transy = ax.yaxis.transData, # and this??
**kwargs)
ax.add_patch(polygon)
return polygon
figure(1)
t = arange(0.0, 1.0, 0.01)
s_mean = 0.5*sin(2*2*pi*t)
s_lo = s_mean-0.1
s_hi = s_mean+0.1
#plot(t,s_mean,'k')
filly(t,s_lo,s_hi,fill=1,facecolor='g')
# I haven't decided yet on how to handle autoscaling with patches
# since there is no efficient easy way to get the patch's extent in
# data coords. Instead, I update the datalim manually in plot
# commands that use pataches
gca().xaxis.datalim.update((min(t), max(t)))
gca().yaxis.datalim.update((min(s_lo), max(s_hi)))
# now this should work since the data lim are updated
gca().xaxis.autoscale_view()
gca().yaxis.autoscale_view()
#savefig('filly')
show()
|
|
From: Al S. <a.d...@wo...> - 2004-03-08 17:50:18
|
In order to get the size of the overall plot window to anywhere near full screen, I've had to use something like figure(1, figsize=(18,12), dpi=72) or figure(1, figsize=(9,6), dpi=144) Both produce the same overall size plot window (11.25" wide by 8" tall), but in the latter case, the text size is much larger than in the latter case. Likewise the linewidths. Can you please explain the interaction among the dpi value, the font sizes displayed, and the overall plot size. Note: If I omit the dpi parameter, the plot window remains at its default (approx 4" x 3") size. The only way I've gotten the window size to change at all is by adding the dpi parameter to the fiigure() call, hence the question. FYI, this is under RH linux 9, with XFree86 4.3.0-2. The display is a 15" diagonal (12" horizontal, 9" vertical) Dell laptop with 1400x1050 NVIDIA GeForce 4 (generic) graphics. Naively, this looks like the H-res is 1400/12" = 116.66 dpi and the V-res is 1050/9" = 116.66 dpi also. Should I set dpi to the resolution of my display (117) or to the resolution of the X fonts (75 or 100)? Thanks, -- Al Schapira <a.d...@wo...> |
|
From: John H. <jdh...@ac...> - 2004-03-08 17:16:15
|
>>>>> "Kuzminski," == Kuzminski, Stefan R <SKu...@fa...> writes:
Kuzminski> Thanks, that worked for the line being plotted,
Kuzminski> although the legend box and axis are still aliased.
Kuzminski> Part of my requirements include supporting
Kuzminski> presentation quality printing. I would like to just
Kuzminski> use Agg as GD has dependency issues and keeps popping
Kuzminski> up other problems ( not to mention how great the Agg
Kuzminski> output looks ). But that great looking anti-aliasing
Kuzminski> doesn't print well, so ideally there would be a
Kuzminski> 'global' level flag that controls aliasing ( or not )
Kuzminski> for everything drawn. I know when the image is being
Kuzminski> created for viewing or for printing and so can set the
Kuzminski> flag accordingly.
I'll work on getting the rest of the objects to respect the
antialiased flag. You can control antialiasing for all lines globally
with rcParams
http://matplotlib.sourceforge.net/faq.html#CUSTOM
JDH
|
|
From: Kuzminski, S. R <SKu...@fa...> - 2004-03-08 17:08:43
|
Thanks, that worked for the line being plotted, although the legend box
and axis are still aliased. Part of my requirements include supporting
presentation quality printing. I would like to just use Agg as GD has
dependency issues and keeps popping up other problems ( not to mention
how great the Agg output looks ). But that great looking anti-aliasing
doesn't print well, so ideally there would be a 'global' level flag that
controls aliasing ( or not ) for everything drawn. I know when the
image is being created for viewing or for printing and so can set the
flag accordingly.
S
-----Original Message-----
From: John Hunter [mailto:jdh...@ni...]=20
Sent: Monday, March 08, 2004 8:16 AM
To: Kuzminski, Stefan R
Cc: mat...@li...
Subject: Re: [Matplotlib-users] simple api question
>>>>> "Kuzminski," =3D=3D Kuzminski, Stefan R <SKu...@fa...>
writes:
Kuzminski,> I got the .51 release, looks great. I need to
Kuzminski,> set_antialiased() on the Renderer, but I'm not sure
Kuzminski,> how to get the renderer object correctly. If I call
Kuzminski,> gca() I get the SubPlot, but the renderer member is
Kuzminski,> None. Any advice would be appreciated.
There is no way to set antialiased on the renderer itself, just on the
individual objects (lines etc).
=20
plot([1,2,3], antialiased=3DFalse)
or=20
lines =3D plot(x1,y1,x2,y2)
set(lines, 'antialiased', False)
or set lines.antialiased in matplotlibrc to the default you want.
Unfortunately, agg does not yet respect antialiased =3D=3D False for all
primitives, currently only lines.
See also
http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC
http://matplotlib.sourceforge.net/faq.html#CUSTOM
Can you tell me what you're trying to do?
JDH
|
|
From: John H. <jdh...@ac...> - 2004-03-08 16:54:40
|
>>>>> "Kuzminski," == Kuzminski, Stefan R <SKu...@fa...> writes:
Kuzminski,> I got the .51 release, looks great. I need to
Kuzminski,> set_antialiased() on the Renderer, but I'm not sure
Kuzminski,> how to get the renderer object correctly. If I call
Kuzminski,> gca() I get the SubPlot, but the renderer member is
Kuzminski,> None. Any advice would be appreciated.
There is no way to set antialiased on the renderer itself, just on the
individual objects (lines etc).
plot([1,2,3], antialiased=False)
or
lines = plot(x1,y1,x2,y2)
set(lines, 'antialiased', False)
or set lines.antialiased in matplotlibrc to the default you want.
Unfortunately, agg does not yet respect antialiased == False for all
primitives, currently only lines.
See also
http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC
http://matplotlib.sourceforge.net/faq.html#CUSTOM
Can you tell me what you're trying to do?
JDH
|
|
From: John H. <jdh...@ac...> - 2004-03-08 16:51:09
|
>>>>> "Al" == Al Schapira <a.d...@wo...> writes:
Al> [ I posted this directly to
Al> mat...@li... previously, but I
Al> didn't see it show up there. Sorry if you got this
Al> before. --Al]
I have seen it, just haven't had a chance to look at it yet. It's on
the list...
JDH
|
|
From: Kuzminski, S. R <SKu...@fa...> - 2004-03-08 16:41:08
|
I got the .51 release, looks great. I need to set_antialiased() on the Renderer, but I'm not sure how to get the renderer object correctly. If I call gca() I get the SubPlot, but the renderer member is None. Any advice would be appreciated. =20 thanks, S |
|
From: John H. <jdh...@ac...> - 2004-03-08 16:37:32
|
>>>>> "John" == John Wohlbier <jd...@go...> writes:
John> Another clue, when I try another example with wx I get:
John> wohlbier@gyrotwystron examples $ python dynamic_demo_wx.py
John> Traceback (most recent call last): File
John> "dynamic_demo_wx.py", line 34, in ? from
John> matplotlib.backends import Figure, Toolbar, FigureManager
John> ImportError: cannot import name Figure wohlbier@gyrotwystron
John> examples $
John> Does this mean anything?
Well, it appears dynamic_demo_wx has not been updated to the latest
API. Ignore this one for now.
What happens when you do
> python2.3 simple_plot.py -dWX
Does it help to do
> python2.3 embedding_in_wx.py -dWX
It shouldn't because you have selected wx as your default backend in
matplotlibrc, but I find your problem a little mysterious so I'm
grasping here.
Please send me the embedding_in_wx.py you are trying to run as an
attachement so I can see if I can replicate it on my system.
JDH
|
|
From: Al S. <a.d...@wo...> - 2004-03-08 16:28:20
|
[ I posted this directly to mat...@li... previously,
but I didn't see it show up there. Sorry if you got this before. --Al]
I found that multi-line ticklabels work fine in normal (hortizontal)
mode. However, after a "set(t, 'rotation', 'vertical')" the plot fails
as shown below. The plot window pops up, then disappears.
System is RH linux 9, matplotlib 0.51, pygtk 2.0.0,
Are multi-line labels supported? In vertical mode too?
Thanks for your help.
-Al Schapira, a.d...@wo...
### This is based upon the "vertical_ticklabels.py" in /examples.
[ads@ADS1 py]$ cat vertical_ticklabels.py
from matplotlib.matlab import *
plot([1,2,3,4], [1,4,9,16])
set(gca(), 'xticks', [1,2,3,4])
t = set(gca(), 'xticklabels', ['Frogs\nOKAY 1', 'Hogs\nFine 2',
Bogs\nGOOD 3', 'Slogs'])
set(t, 'rotation', 'vertical') # UNCOMMENT THIS to make the above fail
show()
[ads@ADS1 py]$ python vertical_ticklabels.py
The program 'vertical_ticklabels.py' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
(Details: serial 1083 error_code 8 request_code 73 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error()
function.)
|
|
From: Al S. <a.d...@wo...> - 2004-03-08 16:25:54
|
[ I posted this directly to mat...@li... previously,
but I didn't see it show up there. Sorry if you got this before. --Al]
I am generating a plot with multi-line ticklabels.
Although the plot displays normally, clicking on the SAVE icon fails
(after selecting a target file name ending with .ps).
I tracked this down as far as afm.get_str_bbox(), line 307 in afm.py
It appears to me that the '\n' character in my multi-line label is
causing the following error:
File "/usr/local/lib/python2.3/site-packages/matplotlib/afm.py", line
307, in get_str_bbox
wx, name, bbox = self._metrics[ord(c)]
KeyError: 10
Note that '\n' == 10. I confirmed the failure with a tiny example:
Run the following and click on the SAVE icon, enter a file name ending
in .ps, and observe the failure.
################################
from matplotlib.matlab import *
plot([1,2,3,4], [1,4,9,16])
set(gca(), 'xticks', [1,2,3,4])
t = set(gca(), 'xticklabels', ['Frogs\nOKAY 1', 'Hogs\nFine 2',
'Bogs\nGOOD 3', 'Slogs'])
show()
################################
Although I realize that computing the bounding box of a multi-line text
is a bit more complex, I would really like to see this supported.
Also, I don't know in how many other places the embedded '\n' will cause
problems.
Thanks.
--
Al Schapira <a.d...@wo...>
|
|
From: John W. <jd...@go...> - 2004-03-08 16:16:19
|
Another clue, when I try another example with wx I get:
wohlbier@gyrotwystron examples $ python dynamic_demo_wx.py
Traceback (most recent call last):
File "dynamic_demo_wx.py", line 34, in ?
from matplotlib.backends import Figure, Toolbar, FigureManager
ImportError: cannot import name Figure
wohlbier@gyrotwystron examples $
Does this mean anything?
jgw
>
> John> I get the error even using 0.51. Maybe my wxPython is
> John> broken. Do you know of a way I can test it?
>
> The example runs fine on my systm.
>
> Something funny is going on. wx does not attempt to load mathtext,
> either in 0.51 or in CVS. That, and the fact that you are getting a
> gthread error, make me suspect you are actually loading the gtk
> backend.
>
> Are you trying to run embedding_in_wx from the prompt or from a
> development environment such as pycrust? If you run from the prompt,
> you shouldn't see that error. If not, you may be loading the default
> backend (GTK) first in your development environment and then trying to
> run embedding_in_wx.
>
> For example, if you first import matplotlib and later try to run
> embedding_in_wx in the same python/pycrust session, you will get
> yourself into a world of trouble, since the default import loads GTK and
> the second one WX. These two cannot peacefully coexist.
>
> Try running the examples from the linux shell or DOS prompt first. Have
> you read the information about how to select the various backends on
> http://matplotlib.sourceforge.net/backends.html?
>
> You can change your default backend (eg to WX) in you .matplotlibrc
> file.
>
> http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC
> http://matplotlib.sourceforge.net/.matplotlibrc
>
> If you still encounter problems, please tell me exactly what you are
> doing: what platform, how you are trying to run the example etc...
>
> Hope this helps,
> JDH
|
|
From: John W. <jd...@go...> - 2004-03-08 16:09:34
|
I have been running from the prompt all along. The command line is: wohlbier@gyrotwystron examples $ python embedding_in_wx.py Could not import mathtext (build with ft2font) GThread-ERROR **: GThread system may only be initialized once. aborting... Aborted wohlbier@gyrotwystron examples $ If running from the command line, does .matplotlibrc make a difference? I did set the default backend in this file to WX. I am on gentoo linux, python 2.3.3, wxPython 2.4.1.2, matplotlib 0.51, executing from the command line as above, from the directory /usr/lib/python2.3/site-packages/matplotlib-0.51/examples/ Let me know if you need something more about my setup. jgw > John> I get the error even using 0.51. Maybe my wxPython is > John> broken. Do you know of a way I can test it? > > The example runs fine on my systm. > > Something funny is going on. wx does not attempt to load mathtext, > either in 0.51 or in CVS. That, and the fact that you are getting a > gthread error, make me suspect you are actually loading the gtk > backend. > > Are you trying to run embedding_in_wx from the prompt or from a > development environment such as pycrust? If you run from the prompt, > you shouldn't see that error. If not, you may be loading the default > backend (GTK) first in your development environment and then trying to > run embedding_in_wx. > > For example, if you first import matplotlib and later try to run > embedding_in_wx in the same python/pycrust session, you will get > yourself into a world of trouble, since the default import loads GTK and > the second one WX. These two cannot peacefully coexist. > > Try running the examples from the linux shell or DOS prompt first. Have > you read the information about how to select the various backends on > http://matplotlib.sourceforge.net/backends.html? > > You can change your default backend (eg to WX) in you .matplotlibrc > file. > > http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC > http://matplotlib.sourceforge.net/.matplotlibrc > > If you still encounter problems, please tell me exactly what you are > doing: what platform, how you are trying to run the example etc... > > Hope this helps, > JDH |
|
From: John H. <jdh...@ac...> - 2004-03-08 15:50:20
|
>>>>> "John" == John Wohlbier <jd...@go...> writes:
John> I get the error even using 0.51. Maybe my wxPython is
John> broken. Do you know of a way I can test it?
The example runs fine on my systm.
Something funny is going on. wx does not attempt to load mathtext,
either in 0.51 or in CVS. That, and the fact that you are getting a
gthread error, make me suspect you are actually loading the gtk
backend.
Are you trying to run embedding_in_wx from the prompt or from a
development environment such as pycrust? If you run from the prompt,
you shouldn't see that error. If not, you may be loading the default
backend (GTK) first in your development environment and then trying to
run embedding_in_wx.
For example, if you first import matplotlib and later try to run
embedding_in_wx in the same python/pycrust session, you will get
yourself into a world of trouble, since the default import loads GTK
and the second one WX. These two cannot peacefully coexist.
Try running the examples from the linux shell or DOS prompt first.
Have you read the information about how to select the various backends
on http://matplotlib.sourceforge.net/backends.html?
You can change your default backend (eg to WX) in you .matplotlibrc
file.
http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC
http://matplotlib.sourceforge.net/.matplotlibrc
If you still encounter problems, please tell me exactly what you are
doing: what platform, how you are trying to run the example etc...
Hope this helps,
JDH
|
|
From: John W. <jd...@go...> - 2004-03-08 15:38:39
|
I get the error even using 0.51. Maybe my wxPython is broken. Do you know of a way I can test it? Thanks. jgw >John> I am using the latest CVS release of matplotlib from >John> sourceforge, and when I try to run the wx backend example I >John> get > >John> gyrotwystron examples # python embedding_in_wx.py Could not >John> import mathtext (build with ft2font) > >John> GThread-ERROR **: GThread system may only be initialized John> > once. aborting... Aborted > >John> The gtk backend examples work fine (although I still get the >John> mathtext warning). I have python 2.3 and wxPython 2.4.2.4 on >John> a gentoo linux system. > > Not sure why you get this - Jeremy may be working on porting mathtext to > WX. The 0.51 release is quite current, so unless you are looking for a > specific feature from CVS I suggest you use that distribution since > there are extra problems you'll encounter trying to build from CVS (see > my last response to Andrew for details). > > If you want to clear up the cannot import mathtext problem, set > BUILD_FT2FONT to True in setup.py before building. > > JDH |
|
From: John H. <jdh...@ac...> - 2004-03-08 15:15:59
|
>>>>> "Jim" == Jim Benson <jb...@se...> writes:
Jim> ...it worked great. I closed the plot...and tried it again.
Jim> Here is what happened:
.... snip ....
Jim> line 121, in show self.window.deiconify() File
Jim> "/usr/local/lib/python2.3/lib-tk/Tkinter.py", line 1412, in
Jim> wm_deiconify return self.tk.call('wm', 'deiconify', self._w)
Jim> _tkinter.TclError: can't invoke "wm" command: application has
Jim> been destroyed
>>>>
Jim> Should i be doing something different if i want to make
Jim> multiple plots in interactive mode? I also tried using a
Jim> figure(i) command before the plot command...this works
Jim> fine...unless i try to reuse a previously closed i-th figure.
Several people have experienced problems along these lines, and we're
working on a fix. This was the first release of the Tk backend so
please keep us up to date on other problems you find. Using the "close"
command instead of clicking the x to close the window should work
>>> from matplotlib.matlab import *
>>> plot([1,2,3])
>>> close()
>>> plot([1,2,3])
Or you can use multiple figures at the same time with the figure
command
>>> from matplotlib.matlab import *
>>> figure(1)
>>> plot([1,2,3])
>>> figure(2)
>>> plot([1,2,3])
>>> close(2)
>>> xlabel('time') # figure 1 is active
Thanks,
JDH
|
|
From: Jim B. <jb...@se...> - 2004-03-08 01:11:43
|
Hi,
I'm a matplotlib (great package!) newbie. I decided to give the
new TkAgg interactive mode a try. I did the setup
then tried the example:
>>> from matplotlib.matlab import *
>>> plot([1,2,3])
>>> xlabel('hi mom')
...it worked great. I closed the plot...and tried it again.
Here is what happened:
floyd:/home/jbenson/python>python
Python 2.3.3 (#1, Dec 21 2003, 15:13:18)
[GCC 3.3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from matplotlib.matlab import *
>>> plot([1,2,3]) # This plot looked fine
Could not find requested font Times
Please set environment var TTFPATH to point to your true type fonts
(*.ttf)
Could not find Times; falling back on Vera
[<matplotlib.lines.Line2D instance at 0x42c2b20c>]
>>> plot([1,2,3])
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/matplotlib/matlab.py", line
788, in plot
draw_if_interactive()
File
"/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_tkagg.py",
line 46, in draw_if_interactive
figManager.show()
File
"/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_tkagg.py",
line 121, in show
self.window.deiconify()
File "/usr/local/lib/python2.3/lib-tk/Tkinter.py", line 1412, in
wm_deiconify
return self.tk.call('wm', 'deiconify', self._w)
_tkinter.TclError: can't invoke "wm" command: application has been
destroyed
>>>
Should i be doing something different if i want to make multiple
plots in interactive mode? I also tried using a figure(i) command
before the plot command...this works fine...unless i try to reuse
a previously closed i-th figure.
Thanks,
Jim
|
|
From: Andrew S. <str...@as...> - 2004-03-07 04:22:03
|
John Hunter wrote: > Andrew> Also, this is > Andrew> using the version of matplotlib I checked out with CVS. > Andrew> This version fails to build the agg backend with: > > Andrew> running build_py package init file 'ttfquery/__init__.py' > Andrew> not found (or not a regular file) package init file > Andrew> 'FontTools/__init__.py' not found (or not a regular file) > Andrew> package init file 'FontTools/fontTools/__init__.py' not > Andrew> found (or not a regular file) package init file > Andrew> 'FontTools/fontTools/encodings/__init__.py' not found (or > Andrew> not a regular file) error: package directory > Andrew> 'FontTools/fontTools/misc' does not exist > > I won't get a chance to look at your fill code til Monday (which BTW > is something I've been wanting to add for a while), but the main > problem here is that CVS doesn't have a complete version of the > FontTools* and ttf* that are needed to build from src. The 0.51 > release is actually quite up to date and you would probably be best > off just working in that tree for now. vis-a-vis FontTools and > ttfquery - an increasing number of matplotlib backends need ttf font > finding capabilitlities which FontTools and ttfquery provide. > However, they are big and a pain to install and Paul Barrett has been > working on a replacement. At one point I added them to CVS since I > was distributing them with matplotlib but thought twice about it and > tried to remove them. However despite multiple attempts I have not > been able to get them out of CVS (a free beer to anyone with commit > privs who can purge these bastards). No in a nutshell there is an > incomplete version of FontTools and ttfquery in CVS. This is one of the downsides of CVS; it doesn't deal with directories very well (or at all). A SourceForge support request would be required for one of their admins to go into CVSROOT and manually do this. What's wrong with distributing them via CVS, at least while they're distributed in the officially released matplotlib sources? It would made things a bit cleaner for those willing to live on the bleeding edge. (Then again, I suppose those willing to live on the bleeding edge are probably also be happy copy a few directories around, too. At least as long as we know what to do.) > If you want to build from CVS, copy the agg, FontTools* and ttfquery > dirs/files from the 0.51 src distro into the CVS tree and build from > there. Works like a charm! Cheers! Andrew |
|
From: John H. <jdh...@ac...> - 2004-03-06 16:33:03
|
>>>>> "John" == John Wohlbier <jd...@go...> writes:
John> I am using the latest CVS release of matplotlib from
John> sourceforge, and when I try to run the wx backend example I
John> get
John> gyrotwystron examples # python embedding_in_wx.py Could not
John> import mathtext (build with ft2font)
John> GThread-ERROR **: GThread system may only be initialized
John> once. aborting... Aborted
John> The gtk backend examples work fine (although I still get the
John> mathtext warning). I have python 2.3 and wxPython 2.4.2.4 on
John> a gentoo linux system.
Not sure why you get this - Jeremy may be working on porting mathtext
to WX. The 0.51 release is quite current, so unless you are looking
for a specific feature from CVS I suggest you use that distribution
since there are extra problems you'll encounter trying to build from
CVS (see my last response to Andrew for details).
If you want to clear up the cannot import mathtext problem, set
BUILD_FT2FONT to True in setup.py before building.
JDH
|
|
From: John H. <jdh...@ac...> - 2004-03-06 16:28:45
|
>>>>> "Andrew" == Andrew Straw <str...@as...> writes:
Andrew> G'day all! I'm back to using matplotlib after a few
Andrew> months away. I'm very impressed with the recent progress!
Thanks. It's good to see you back around in these parts :-)
Andrew> I often plot the instantaneous variance of repeated
Andrew> recordings made under the same conditions using a shaded
Andrew> area to surround the mean. I'm trying to find a way to do
Andrew> this with matplotlib. Included below is a "filly" (fill
Andrew> y) function I wrote to attempt to do this. It doesn't
Andrew> quite work yet, and I'd like some help. (BTW, I don't
Andrew> know of how this would be done in Matlab, so if there's a
Andrew> more compatible way, I'd be happy to change the approach.)
Andrew> 1) How do I make the data fill the axes automatically,
Andrew> such as the "plot" function?
Andrew> 2) Is it a bug that the polygon is not filled, or am I
Andrew> missing something?
Andrew> I've only tried this in the PS backend -- I'm having
Andrew> troubles with the others at the moment. Also, this is
Andrew> using the version of matplotlib I checked out with CVS.
Andrew> This version fails to build the agg backend with:
Andrew> running build_py package init file 'ttfquery/__init__.py'
Andrew> not found (or not a regular file) package init file
Andrew> 'FontTools/__init__.py' not found (or not a regular file)
Andrew> package init file 'FontTools/fontTools/__init__.py' not
Andrew> found (or not a regular file) package init file
Andrew> 'FontTools/fontTools/encodings/__init__.py' not found (or
Andrew> not a regular file) error: package directory
Andrew> 'FontTools/fontTools/misc' does not exist
I won't get a chance to look at your fill code til Monday (which BTW
is something I've been wanting to add for a while), but the main
problem here is that CVS doesn't have a complete version of the
FontTools* and ttf* that are needed to build from src. The 0.51
release is actually quite up to date and you would probably be best
off just working in that tree for now. vis-a-vis FontTools and
ttfquery - an increasing number of matplotlib backends need ttf font
finding capabilitlities which FontTools and ttfquery provide.
However, they are big and a pain to install and Paul Barrett has been
working on a replacement. At one point I added them to CVS since I
was distributing them with matplotlib but thought twice about it and
tried to remove them. However despite multiple attempts I have not
been able to get them out of CVS (a free beer to anyone with commit
privs who can purge these bastards). No in a nutshell there is an
incomplete version of FontTools and ttfquery in CVS.
If you want to build from CVS, copy the agg, FontTools* and ttfquery
dirs/files from the 0.51 src distro into the CVS tree and build from
there. This will all be cleared up in a few weeks time.
JDH
|
|
From: Al S. <a.d...@wo...> - 2004-03-05 17:47:19
|
I am generating a plot with multi-line ticklabels.
Although the plot displays normally, clicking on the SAVE icon fails
(after selecting the target file name).
I tracked this down as far as afm.get_str_bbox(), line 307 in afm.py
It appears to me that the '\n' character in my multi-line label is
causing the following error:
File "/usr/local/lib/python2.3/site-packages/matplotlib/afm.py", line
307, in get_str_bbox
wx, name, bbox = self._metrics[ord(c)]
KeyError: 10
Note that '\n' == 10. I confirmed the failure with a tiny example:
Run the following and click on the SAVE icon, enter a file name, and
observe the failure.
################################
from matplotlib.matlab import *
plot([1,2,3,4], [1,4,9,16])
set(gca(), 'xticks', [1,2,3,4])
t = set(gca(), 'xticklabels', ['Frogs\nOKAY 1', 'Hogs\nFine 2',
'Bogs\nGOOD 3', 'Slogs'])
show()
################################
Although I realize that computing the bounding box of a multi-line text
is a bit more complex, I would really like to see this supported.
Also, I don't know in how many other places the embedded '\n' will cause
problems.
Thanks.
--
Al Schapira <a.d...@wo...>
|
|
From: John W. <jd...@go...> - 2004-03-05 17:11:30
|
I am using the latest CVS release of matplotlib from sourceforge, and when I try to run the wx backend example I get gyrotwystron examples # python embedding_in_wx.py Could not import mathtext (build with ft2font) GThread-ERROR **: GThread system may only be initialized once. aborting... Aborted The gtk backend examples work fine (although I still get the mathtext warning). I have python 2.3 and wxPython 2.4.2.4 on a gentoo linux system. Thanks! jgw |
|
From: Al S. <a.d...@wo...> - 2004-03-05 16:21:56
|
I found that multi-line ticklabels work fine in normal (hortizontal)
mode. However, after a set(t, 'rotation', 'vertical') the plot fails
as shown below. The plot window pops up, then disappears.
System is RH linux 9, matplotlib 0.51, pygtk 2.0.0,
Are multi-line labels supported? In vertical mode too?
Thanks for your help.
-Al Schapira, a.d...@wo...
### This is based upon the "vertical_ticklabels.py" in /examples.
[ads@ADS1 py]$ cat vertical_ticklabels.py
from matplotlib.matlab import *
plot([1,2,3,4], [1,4,9,16])
set(gca(), 'xticks', [1,2,3,4])
t = set(gca(), 'xticklabels', ['Frogs\nOKAY 1', 'Hogs\nFine 2',
Bogs\nGOOD 3', 'Slogs'])
set(t, 'rotation', 'vertical') # UNCOMMENT THIS to make the above fail
show()
[ads@ADS1 py]$ python vertical_ticklabels.py
The program 'vertical_ticklabels.py' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
(Details: serial 1083 error_code 8 request_code 73 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error()
function.)
|
|
From: Andrew S. <str...@as...> - 2004-03-05 12:06:05
|
G'day all!
I'm back to using matplotlib after a few months away. I'm very
impressed with the recent progress!
I often plot the instantaneous variance of repeated recordings made
under the same conditions using a shaded area to surround the mean. I'm
trying to find a way to do this with matplotlib. Included below is a
"filly" (fill y) function I wrote to attempt to do this. It doesn't
quite work yet, and I'd like some help. (BTW, I don't know of how this
would be done in Matlab, so if there's a more compatible way, I'd be
happy to change the approach.)
1) How do I make the data fill the axes automatically, such as the
"plot" function?
2) Is it a bug that the polygon is not filled, or am I missing
something?
I've only tried this in the PS backend -- I'm having troubles with the
others at the moment. Also, this is using the version of matplotlib I
checked out with CVS. This version fails to build the agg backend with:
running build_py
package init file 'ttfquery/__init__.py' not found (or not a regular
file)
package init file 'FontTools/__init__.py' not found (or not a regular
file)
package init file 'FontTools/fontTools/__init__.py' not found (or not a
regular file)
package init file 'FontTools/fontTools/encodings/__init__.py' not found
(or not a regular file)
error: package directory 'FontTools/fontTools/misc' does not exist
Cheers!
Andrew
-=-=-=-=-=-=-= filly.py -=-=-=-=-=-=-=-=
from matplotlib.matlab import *
from matplotlib.patches import Rectangle, Polygon
def filly(x,y1,y2,**kwargs):
ax = gca()
xy = []
for xi, yi in zip(x,y1):
xy.append( (xi,yi) )
for xi, yi in zip(x[::-1],y2[::-1]):
xy.append( (xi,yi) )
xy.append( xy[0] )
polygon = Polygon(
ax.dpi, ax.bbox,
xy,
transx = ax.xaxis.transData, # what does this do?
transy = ax.yaxis.transData, # and this??
**kwargs)
ax.add_patch(polygon)
return polygon
figure(1)
t = arange(0.0, 1.0, 0.01)
s_mean = 0.5*sin(2*2*pi*t)
s_lo = s_mean-0.1
s_hi = s_mean+0.1
#plot(t,s_mean,'k')
filly(t,s_lo,s_hi,fill=1,facecolor='g')
gca().xaxis.autoscale_view() # why doesn't this help?
gca().yaxis.autoscale_view()
savefig('filly')
#show()
|