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
(13) |
2
(11) |
3
|
4
(9) |
|
5
(3) |
6
(17) |
7
(24) |
8
(11) |
9
(26) |
10
(19) |
11
(4) |
|
12
(4) |
13
(14) |
14
(9) |
15
(5) |
16
(18) |
17
(23) |
18
(3) |
|
19
(1) |
20
(7) |
21
(27) |
22
(26) |
23
(6) |
24
(17) |
25
(1) |
|
26
|
27
(7) |
28
(1) |
29
(4) |
30
(5) |
|
|
|
From:
<Mar...@as...> - 2006-11-12 07:20:55
|
Hello All, I've been using matplotlib for some time now, and I want to connect it with zope. I'am using the example code from page: http://www.scipy.org/Cookbook/Matplotlib/Matplotlib_and_Zope , but whenever I try to import matplotlib, and/or pylab packages i get this error from zope: Error Type: RuntimeError Error Value: '/' is not a writable dir; you must set environment variable HOME to be a writable dir Have You got any ideas, on what might go wrong? I'am using matplotlib 0.87.4, and zope 2.9.5 with python 2.4.3 on gentoo linux box. Thanks in advance for any help. Marek Szczypinski |
|
From: Charles R. T. <ct...@gm...> - 2006-11-12 05:58:10
|
John et al, I get this error, suggesting that yerr in bar() is not allowed to have the same format as yerr in errorbar() << if yerr is not None: assert len(yerr)==nbars, 'bar() argument \'yerr\' must be len(%s) or scalar' % lenarg >> So this works: pylab.errorbar(xrange(5), [2,5,3,4,7], yerr=[[1,4,2,3,6],[4,10,6,8,14]]) But this does not: pylab.bar(xrange(5), [2,5,3,4,7], yerr=[[1,4,2,3,6],[4,10,6,8,14]]) Version 0.87.5 (Debian) If I'm right, then the assertion in bar() is misformed. -C On 11/6/06, John Hunter <jdh...@ni...> wrote: > >>>>> "Charles" == Charles R Twardy <ct...@gm...> writes: > > Charles> Hi folks, It seems that 'bar' no longer supports > Charles> asymmetric errorbars. Am I meant to call both 'bar' and > Charles> 'errorbar' if I want asymmetric errorbars on my > Charles> histograms? Is there a canonical idiom? > > Charles> Sorry if I missed a previous answer to this. > > I don't use asymmetric error bars so don't have any ready test code, > but looking at the implementation, the xerr and yerr kwargs to bar are > passed on to errorbar after a bit of array conversion and length > checking. Does this not work for you? If not, can you send a snippet > of freestanding test code? > > Thanks, > JDH > -- Charles R. Twardy |
|
From: Charlie M. <cw...@gm...> - 2006-11-12 02:40:43
|
On 11/10/06, Joris De Ridder <jo...@st...> wrote: > Hi, > > We're trying (for the first time) to install matplotlib on OSX (Tiger on PPC Mac). > > Before we installed matplolib we ensured that BUILD_TKAGG = 1 in setup.py. > Then we typed 'python setup.py install' which went fine. Importing pylab goes fine, > making a plot with pylab.plot() also works fine, but pylab.show() gives: > > alloc: invalid block: 0xa08bca0: a 1c 0 > Abort trap > > I guess this is a backend problem. Any pointers in which direction we can find > a solution for this? > > We're using Python 2.4.1, Numpy 1.0, TclTkAquaBI-8.4.10.0 and we're trying > to install Matplotlib 0.87.7. We recently posted OSX binaries. Can you try one of those? |
|
From: Eric F. <ef...@ha...> - 2006-11-11 17:44:47
|
That problem was fixed quite a few months ago; I don't recall exactly when. Eric W Netzberg wrote: > The following code throws ZeroDivisionError: > import numpy, pylab > z = numpy.random.normal(-0.37727, 0.1, size=10) > pylab.plot(z) > pylab.show () > The stack trace: > Traceback (most recent call last): > File "<stdin>", line 3, in ? > File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line > 2018, in plot > ret = gca().plot(*args, **kwargs) > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 2790, > in plot > self.autoscale_view() > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 817, > in autoscale_view > self.set_ylim(locator.autoscale()) > File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line > 798, in autoscale > return take(self.bin_boundaries(dmin, dmax), [0,-1]) > File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line > 768, in bin_boundaries > scale, offset = scale_range(vmin, vmax, nbins) > File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line > 733, in scale_range > var = dv/max(abs(vmin), abs(vmax)) > ZeroDivisionError: float division > > Any ideas? > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: yardbird <yar...@ne...> - 2006-11-11 16:07:07
|
Thanks for your responses, David and Bill. I'm quite busy at the moment to go into detail in this, but strangely enough when I changed the backend from the default (GTK(Agg?) - I'm on linux) to QtAgg the bug disappeared. I think too that there could be an issue with numpy, so I just recompiled the whole python-numpy-mpl toolchain using the latest versions of everything available. I'll test ASAP if the problem under GTK persists, and then I'll report here. Thanks again, Francesco |
|
From: Steve S. <el...@gm...> - 2006-11-11 13:47:07
|
W Netzberg wrote: > The following code throws ZeroDivisionError: > import numpy, pylab > z = numpy.random.normal(-0.37727, 0.1, size=10) > pylab.plot(z) > pylab.show () > The stack trace: > Traceback (most recent call last): > File "<stdin>", line 3, in ? > File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line > 2018, in plot > ret = gca().plot(*args, **kwargs) > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 2790, > in plot > self.autoscale_view() > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 817, > in autoscale_view > self.set_ylim(locator.autoscale()) > File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line > 798, in autoscale > return take(self.bin_boundaries(dmin, dmax), [0,-1]) > File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line > 768, in bin_boundaries > scale, offset = scale_range(vmin, vmax, nbins) > File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line > 733, in scale_range > var = dv/max(abs(vmin), abs(vmax)) > ZeroDivisionError: float division > > Any ideas? > Works fine here. pylab.matplotlib.__version__ '0.87.5' pylab.matplotlib.__revision__ '$Revision: 2761 $' Which version are you using? cheers, steve Random number generation is the art of producing pure gibberish as quickly as possible. |
|
From: W N. <net...@gm...> - 2006-11-11 12:41:15
|
The following code throws ZeroDivisionError:
import numpy, pylab
z = numpy.random.normal(-0.37727, 0.1, size=10)
pylab.plot(z)
pylab.show ()
The stack trace:
Traceback (most recent call last):
File "<stdin>", line 3, in ?
File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 2018, in
plot
ret = gca().plot(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 2790, in
plot
self.autoscale_view()
File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 817, in
autoscale_view
self.set_ylim(locator.autoscale())
File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line 798, in
autoscale
return take(self.bin_boundaries(dmin, dmax), [0,-1])
File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line 768, in
bin_boundaries
scale, offset = scale_range(vmin, vmax, nbins)
File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line 733, in
scale_range
var = dv/max(abs(vmin), abs(vmax))
ZeroDivisionError: float division
Any ideas?
|
|
From: pranal s. <sha...@gm...> - 2006-11-10 21:56:58
|
---------- Forwarded message ---------- From: pranal shah <sha...@gm...> Date: Nov 9, 2006 3:34 PM Subject: Getting X & Y value for every point plotted, without wx-python To: mat...@li... HI all I am a newbie at both matplotlib(0.86) and python(2.4). I am trying to develop a web application which can plot some historical data of which, i want the values for any given data point to be poped up using something like html mouseover. I know that it is easy using wxpython...or when python package is installed on you PC. But as this is a browser based application...it should ideally work from any PC.Dont know how to do that. It essentially boils down to saving the X and Y value for every xticks on the graph. Can anyone help me out with this one? And by the way I am using Django as web framework. |
|
From: John H. <jdh...@ac...> - 2006-11-10 18:29:15
|
>>>>> "Fernando" == Fernando Perez <fpe...@gm...> writes:
Fernando> Have you had a look at what SAGE did with mpl? Their
Fernando> axes are Mathematica-like, and their API exposes the
Fernando> geometric primitives in Mathematica's plotting API. For
Fernando> example:
Fernando> http://modular.math.washington.edu/sage/screen_shots/.html/37a.html
Fernando> That plot is actually done with MPL.
I know what they did, and it is basically a hack so it is not suitable
for the core. Basically, they just turn off our axes and rewrite
their own with lines ticks and labels. We can do something similar
(and need to) but we'll need something more flexible that is built in
rather than tacked on. Just a matter of finding the time...
JDH
|
|
From: Fernando P. <fpe...@gm...> - 2006-11-10 17:57:40
|
On 11/10/06, John Hunter <jdh...@ac...> wrote: > >>>>> "Nicolas" == Nicolas Grilly <nic...@ga...> writes: > > Nicolas> Hello, I'm trying to draw only left and bottom borders of > Nicolas> the frame surrounding each plot, like in the attached > Nicolas> chart. > > Nicolas> I've checked matplotlib source code and it seems there is > Nicolas> no way to do that with a simple parameter. Do you confirm > Nicolas> that? If yes, can I submit a patch for such a "feature"? > > It's been a long standing wish to support something like this -- axis > lines that an be placed arbitrarily, eg in the center like > mathematica, or only on the left, only on the right, etc... So a > patch would definitely be welcome. Have you had a look at what SAGE did with mpl? Their axes are Mathematica-like, and their API exposes the geometric primitives in Mathematica's plotting API. For example: http://modular.math.washington.edu/sage/screen_shots/.html/37a.html That plot is actually done with MPL. Cheers, f |
|
From: John H. <jdh...@ac...> - 2006-11-10 17:53:57
|
>>>>> "Glen" == Glen W Mabey <Gle...@sw...> writes:
Glen> I'm a bit confused as to where the exception is actually
Glen> getting raised. I suppose the renderer's write_png method
Glen> must be in C?
Glen> I implemented a tempfile solution, but I'm surprised that
Glen> the cStringIO doesn't already work.
Glen> <fellowsophical_question>
Glen> Should it?
Glen> </fellowsophical_question>
It should and I've looked at it but couldn't figure it out. The relevant method is
RendererAgg::write_png in src/_backend_agg.cpp. Someone should pull
up some PIL code (which I think supports this) and figure out how it
is done. The png method I am using uses a FILE* pointer -- I've
posted on python list how to get a FILE* from cStringIO but got no
help. There may be a more-better-different libpng method that can
work with some other interface.
JDH
|
|
From: Joris De R. <jo...@st...> - 2006-11-10 16:46:50
|
Hi, We're trying (for the first time) to install matplotlib on OSX (Tiger on PPC Mac). Before we installed matplolib we ensured that BUILD_TKAGG = 1 in setup.py. Then we typed 'python setup.py install' which went fine. Importing pylab goes fine, making a plot with pylab.plot() also works fine, but pylab.show() gives: alloc: invalid block: 0xa08bca0: a 1c 0 Abort trap I guess this is a backend problem. Any pointers in which direction we can find a solution for this? We're using Python 2.4.1, Numpy 1.0, TclTkAquaBI-8.4.10.0 and we're trying to install Matplotlib 0.87.7. Joris Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm |
|
From: John H. <jdh...@ac...> - 2006-11-10 16:40:58
|
>>>>> "Nicolas" == Nicolas Grilly <nic...@ga...> writes:
Nicolas> Hello, I'm trying to draw only left and bottom borders of
Nicolas> the frame surrounding each plot, like in the attached
Nicolas> chart.
Nicolas> I've checked matplotlib source code and it seems there is
Nicolas> no way to do that with a simple parameter. Do you confirm
Nicolas> that? If yes, can I submit a patch for such a "feature"?
It's been a long standing wish to support something like this -- axis
lines that an be placed arbitrarily, eg in the center like
mathematica, or only on the left, only on the right, etc... So a
patch would definitely be welcome.
Here is some example code that will get you pretty close to the
figure you sent
import matplotlib
from pylab import figure, show, nx
defaults = {
'xtick.major.size' : 6,
'xtick.direction' : 'out',
'ytick.major.size' : 6,
'ytick.direction' : 'out',
'grid.color' : 'gray',
'grid.linestyle' : '-',
'grid.linewidth' : 0.5
}
matplotlib.rcParams.update(defaults)
fig = figure()
ax = fig.add_subplot(111)
ax.axesPatch.set_edgecolor('white')
props = dict(color='black', lw=1.5, transform=ax.transAxes,
clip_on=False)
line1, = ax.plot([0,0], [0,1])
line2, = ax.plot([0,1], [0,0])
line1.update(props)
line2.update(props)
ax.plot(nx.rand(10), '-o', lw=2)
ax.xaxis.grid(False)
ax.yaxis.grid(True)
for tick in ax.xaxis.get_major_ticks() + ax.yaxis.get_major_ticks():
tick.tick2On = False # turn of right and top ticking
show()
|
|
From: John H. <jdh...@ac...> - 2006-11-10 13:56:58
|
>>>>> "Andrea" == Andrea Gavana <and...@gm...> writes:
Andrea> Hi Gang, Thank you guys, and thanks for the Wiki entry ;-)
Andrea> Andrea.
Andrea> I have a further small question. When I add a line to my
Andrea> plot, the axes gracefully rescale to accomodate the new
Andrea> data plotted. However, when I remove a line, they do not
Andrea> rescale, even if I call:
Andrea> locator = self.leftaxis.yaxis.get_major_locator()
Andrea> locator.autoscale()
Andrea> Or:
Andrea> self.leftaxis.autoscale_view(scalex=False, scaley=True)
Andrea> I also call self.canvas.draw(), self.Refresh()... nothing
Andrea> happens. Is there a way to make the axes rescale after
Andrea> removing a line from a plot?
The Axes instance has two BBox (bounding box) instances -- the dataLim
and the viewLim. The dataLim store a rectangle that bounds all the
data in the Axes, and the viewLim are the x and y view limits, ie,
xlim and ylim. Autoscaling sets the viewLim based on the dataLim.
When you add lines to the plot, the dataLim are updated, but when you
remove data with del ax.lines[-1] etc, the dataLim are not updated.
If all you have in the Axes are line instances, you can update the
dataLim with the remaining lines, but first you must tell it to ignore
it's current limits. You do this with the ignore flag
# after removing a line, do
ignore = True
for line in ax.lines:
x = line.get_xdata()
y = line.get_ydata()
ax.dataLim.update_numerix(x, y, ignore)
ignore = False
If you have other data in your Axes, eg Polygons or Collections, it is
a bit more complicated. It would be useful to have an Axes method
like "auto_datalim" to for the datalim to readjust to all the current
data.
After you have tested this, would you mind updating the wiki with this
information?
Thanks,
JDH
|
|
From: John H. <jdh...@ac...> - 2006-11-10 13:51:10
|
>>>>> "Bart" == Bart van Kuik <b.v...@sr...> writes:
Bart> Hi list, I have inherited a piece of code. It uses
Bart> LineCollection and works allright, except lines are plotted
Bart> and I want to see the points, not the interpolated line. Is
Bart> this a contradiction in itself, or might it be possible? I
Bart> see 'solid', 'dotted', 'dashed' and 'dashdot' as linestyle
Bart> options, but don't see 'points' among them.
Bart> The reason LineCollection is used, is that each point needs
Bart> to have a particular color; the plot has a third dimension
Bart> so as to say.
You can probably use "scatter" for this -- it allows you to create and
x,y plot of polygonal markers with different colors. But these are
intensities mapped to a color. If you need to specify the exact color
of the markers, use a PolygonCollection.
JDH
|
|
From: Andrea G. <and...@gm...> - 2006-11-10 13:22:33
|
Hi Gang, Andrea> Thank you guys, and thanks for the Wiki entry ;-) Andrea. I have a further small question. When I add a line to my plot, the axes gracefully rescale to accomodate the new data plotted. However, when I remove a line, they do not rescale, even if I call: locator = self.leftaxis.yaxis.get_major_locator() locator.autoscale() Or: self.leftaxis.autoscale_view(scalex=False, scaley=True) I also call self.canvas.draw(), self.Refresh()... nothing happens. Is there a way to make the axes rescale after removing a line from a plot? Thank you. Andrea. "Imagination Is The Only Weapon In The War Against Reality." http://xoomer.virgilio.it/infinity77/ |
|
From: Bart v. K. <b.v...@sr...> - 2006-11-10 11:22:00
|
Hi list, I have inherited a piece of code. It uses LineCollection and works allright, except lines are plotted and I want to see the points, not the interpolated line. Is this a contradiction in itself, or might it be possible? I see 'solid', 'dotted', 'dashed' and 'dashdot' as linestyle options, but don't see 'points' among them. The reason LineCollection is used, is that each point needs to have a particular color; the plot has a third dimension so as to say. Thanks, Bart van Kuik |
|
From: Emmanuel Favre-N. <man...@gm...> - 2006-11-10 10:55:49
|
Le Vendredi 10 Novembre 2006 00:50, vous avez =E9crit : > >>>>> "John" =3D=3D John Hunter <jdh...@ac...> writes: > > John> It's not about wx or wxpython, it's a matplotlib issue. > > Let me add some color to that statement -- when I took a look at your > screenshot, I realized you are using the WX backend and not the WXAgg > backend. If you don't understand the difference, peruse > http://matplotlib.sf.net/backends.html . WXAgg may have the same > problem (and the same solution from my last post) but will give you > more consistent rendering and layout. > > JDH Thank you John!! In fact WXAgg does not have the same problems. I mean, there is no problem= =20 with WXAgg and fig.subplots_adjust(left=3D0.15, bottom=3D0.15) is even not= =20 needed! It looks much nicer : =20 http://emmanuelfavrenicolin.free.fr/Public/Divers/Snapshots1/wx_snap1.png It means that WXAgg is to be the "recommend" way for embedding in wxpython? Just for reference, a "sample" code derived from dynamic_image_wxagg.py : #!/usr/bin/env python import sys, time, os, gc import matplotlib matplotlib.use('WXAgg') from matplotlib import rcParams rcParams['numerix'] =3D 'numarray' import matplotlib.cm as cm from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg from matplotlib.figure import Figure import matplotlib.numerix as numpy from wxPython.wx import * TIMER_ID =3D wxNewId() class PlotFigure(wxFrame): def __init__(self): wxFrame.__init__(self, None, -1, "Test embedded wxFigure") self.fig =3D Figure((7,5), 75) #self.fig.subplots_adjust(left=3D0.15, bottom=3D0.15) self.canvas =3D FigureCanvasWxAgg(self, -1, self.fig) self.toolbar =3D Toolbar(self.canvas) self.toolbar.Realize() # On Windows, default frame size behaviour is incorrect # you don't need this under Linux tw, th =3D self.toolbar.GetSizeTuple() fw, fh =3D self.canvas.GetSizeTuple() self.toolbar.SetSize(wxSize(fw, th)) # Create a figure manager to manage things # Now put all into a sizer sizer =3D wxBoxSizer(wxVERTICAL) # This way of adding to sizer allows resizing sizer.Add(self.canvas, 1, wxLEFT|wxTOP|wxGROW) # Best to allow the toolbar to resize! sizer.Add(self.toolbar, 0, wxGROW) self.SetSizer(sizer) self.Fit() EVT_TIMER(self, TIMER_ID, self.onTimer) def init_plot_data(self): # jdh you can add a subplot directly from the fig rather than # the fig manager a =3D self.fig.add_subplot(111) a.set_title('Title') a.set_xlabel('Xaxis [u.a.]') a.set_ylabel('Yaxis [u.a.]') #a.xaxis.set_major_formatter(matplotlib.ticker.FormatStrFormatter('%5.2f')) #a.yaxis.set_major_formatter(matplotlib.ticker.FormatStrFormatter('%5.2f')) self.ind =3D numpy.arange(60) tmp =3D [] for i in range(60): tmp.append(numpy.sin((self.ind+i)*numpy.pi/15)) self.X =3D numpy.array(tmp) self.lines =3D a.plot(self.X[:,0],'o') self.count =3D 0 def GetToolBar(self): # You will need to override GetToolBar if you are using an=20 # unmanaged toolbar in your frame return self.toolbar def onTimer(self, evt): self.count +=3D 1 if self.count >=3D 60: self.count =3D 0 self.lines[0].set_data(self.ind, self.X[:,self.count]) self.canvas.draw() #self.canvas.gui_repaint() # jdh wxagg_draw calls this already def onEraseBackground(self, evt): # this is supposed to prevent redraw flicker on some X servers... pass =20 if __name__ =3D=3D '__main__': app =3D wxPySimpleApp() frame =3D PlotFigure() frame.init_plot_data() =20 # Initialise the timer - wxPython requires this to be connected to # the receiving event handler t =3D wxTimer(frame, TIMER_ID) t.Start(100) =20 frame.Show() app.MainLoop() |
|
From: John H. <jdh...@ac...> - 2006-11-10 02:53:16
|
>>>>> "John" == John Hunter <jdh...@ac...> writes:
John> It's not about wx or wxpython, it's a matplotlib issue.
Let me add some color to that statement -- when I took a look at your
screenshot, I realized you are using the WX backend and not the WXAgg
backend. If you don't understand the difference, peruse
http://matplotlib.sf.net/backends.html . WXAgg may have the same
problem (and the same solution from my last post) but will give you
more consistent rendering and layout.
JDH
|
|
From: John H. <jdh...@ac...> - 2006-11-10 02:50:19
|
>>>>> "Emmanuel" == Emmanuel Favre-Nicolin <man...@gm...> writes:
Emmanuel> Hi, (I'm sending again because email was probably
Emmanuel> filtered?)
Emmanuel> I have problem with xlabel and ylabel when embedding in
Emmanuel> wx. See snapshot :
Emmanuel> http://emmanuelfavrenicolin.free.fr/Public/Divers/Snapshots1/wx_snap.png
Emmanuel> Do I need twiking and/or understand better wxpython ?
Emmanuel> Anyone can help me?
It's not about wx or wxpython, it's a matplotlib issue. Whether you
consider it a feature or a bug, mpl doesn't try to resize your Axes to
make sure your axis labels fit. But it makes it easy for you to do
so. Try something like
fig.subplots_adjust(left=0.15, bottom=0.15)
which will move your left border to the right and your bottom border
up and make more room for your text labels.
JDH
|
|
From: Christopher B. <Chr...@no...> - 2006-11-10 02:50:11
|
Russell E Owen wrote: > Thanks! That should be enough info to go on. Let us know how it works out -- or use the packages recently posted on pythonmac.org/packages > I'm surprised, though. I know /usr/local/bin is on my path before > /usr/bin and I thought /Library/Frameworks/Python.../bin was before > either of them, but maybe not. I'm not sure where wxPython puts its wx-config, but it's probably not /Library/Frameworks/Python.../bin. Maybe it should be. > Have you tried to have two wxPythons installed at the same time...one > for Python 2.4 and one for Python 2.5? I'm just now switching over and > am reluctant to ditch all my python 2.4 stuff quite yet, but wxPython > installs a pile of stuff and I'm afraid of conflicts. That should be no problem at all. In fact, having multiple wxPythons in one version of Python works fine too. -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: Emmanuel Favre-N. <man...@gm...> - 2006-11-10 02:40:59
|
Hi, (I'm sending again because email was probably filtered?) I have problem with xlabel and ylabel when embedding in wx. See snapshot : http://emmanuelfavrenicolin.free.fr/Public/Divers/Snapshots1/wx_snap.png I put a test code which is based on dynamic_demo_wx.py, adding only the 3 lines : a.set_title('Title') a.set_xlabel('Xaxis [u.a.]') a.set_ylabel('Yaxis [u.a.]') Just to add title, and label. In this case Ylabel is superposed on ytics labels and xlabel is hidden by the navigation toolbar. Do I need twiking and/or understand better wxpython ? Anyone can help me? "sample code" : import matplotlib matplotlib.use('WX') from matplotlib.backends.backend_wx import FigureCanvasWx,\ FigureManager, NavigationToolbar2Wx from matplotlib.figure import Figure from matplotlib.axes import Subplot import matplotlib.numerix as numpy from wxPython.wx import * TIMER_ID = wxNewId() class PlotFigure(wxFrame): def __init__(self): wxFrame.__init__(self, None, -1, "Test embedded wxFigure") self.fig = Figure((6,4), 75) self.canvas = FigureCanvasWx(self, -1, self.fig) self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() # On Windows, default frame size behaviour is incorrect # you don't need this under Linux tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() self.toolbar.SetSize(wxSize(fw, th)) # Create a figure manager to manage things self.figmgr = FigureManager(self.canvas, 1, self) # Now put all into a sizer sizer = wxBoxSizer(wxVERTICAL) # This way of adding to sizer allows resizing sizer.Add(self.canvas, 1, wxLEFT|wxTOP|wxGROW) # Best to allow the toolbar to resize! sizer.Add(self.toolbar, 0, wxGROW) self.SetSizer(sizer) self.Fit() EVT_TIMER(self, TIMER_ID, self.onTimer) def init_plot_data(self): a = self.fig.add_subplot(111) a.set_title('Title') a.set_xlabel('Xaxis [u.a.]') a.set_ylabel('Yaxis [u.a.]') self.ind = numpy.arange(60) tmp = [] for i in range(60): tmp.append(numpy.sin((self.ind+i)*numpy.pi/15)) self.X = numpy.array(tmp) self.lines = a.plot(self.X[:,0],'o') self.count = 0 def GetToolBar(self): # You will need to override GetToolBar if you are using an # unmanaged toolbar in your frame return self.toolbar def onTimer(self, evt): self.count += 1 if self.count >= 60: self.count = 0 self.lines[0].set_data(self.ind, self.X[:,self.count]) self.canvas.draw() self.canvas.gui_repaint() if __name__ == '__main__': app = wxPySimpleApp() frame = PlotFigure() frame.init_plot_data() # Initialise the timer - wxPython requires this to be connected to the # receivicng event handler t = wxTimer(frame, TIMER_ID) t.Start(100) frame.Show() app.MainLoop() |
|
From: Christopher B. <Chr...@no...> - 2006-11-10 01:31:51
|
Russell E Owen wrote: > I should probably be using wxPython 2.6.x. I originally thought wxPython > 2.7 was the current release but as you pointed out, that was a > misconception. Unfortunately, it's the only binary package available for > Python 2.5 at pythonmac.org. There is a binary of wxPython 2.6 for Python2.5 at: http://www.wxpython.org/download-2.6.3.3.php Maybe I'll ask Bob to put that up on pythonmac -- the 2.7 one is out of date already anyway. Let me know how it works. -CHB -- 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: Christopher B. <Chr...@no...> - 2006-11-10 01:23:00
|
On second thought ---
Russell E Owen wrote:
> Now when I try to build matplotlib it fails. Ouch.
> It starts out with the same warning as last time:
> setup.py:267: DeprecationWarning: The wxPython compatibility package is
> no longer automatically generated or activly maintained. Please switch
> to the wx package as soon as possible.
This really is just a warning -- I doubt it has anything to do with your
issue.
> $ which wx-config
> /usr/local/bin/wx-config
> $ ls -l /usr/local/bin/wx-config
> lrwxr-xr-x 1 root admin 75 Nov 8 13:50 /usr/local/bin/wx-config ->
> /usr/local/lib/wxPython-unicode-2.7.1.3/lib/wx/config/mac-unicode-debug-2.7
> $ wx-config --version-full
> 2.7.1.3
> $ wx-config --libs
> -L/usr/local/lib/wxPython-unicode-2.7.1.3/lib -isysroot
> /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -framework
> QuickTime -framework IOKit -framework Carbon -framework Cocoa -framework
> System -lwx_macud-2.7
That does look right.
> gcc: src/_wxagg.cpp
> src/_wxagg.cpp: In function 'wxBitmap* convert_agg2bitmap(RendererAgg*,
> Bbox*)':
> src/_wxagg.cpp:238: error: conversion from 'wxImage*' to 'const
> wxString' is ambiguous
That looks like a real error, though one I'm out of my (very limited)
C++ depth to help with.
I'm going to see if I can give it a try with the new wxPython 2.7.2 --
and I'll post a note to the wxPython list -- someone there might
understand this.
-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: Emmanuel Favre-N. <man...@gm...> - 2006-11-10 00:47:29
|
I have problem with xlabel and ylabel when embedding in wx. See snapshot : http://emmanuelfavrenicolin.free.fr/Public/Divers/Snapshots1/wx_snap.png I put a test code which is based on dynamic_demo_wx.py, adding only the 3 lines : a.set_title('Title') a.set_xlabel('Xaxis [u.a.]') a.set_ylabel('Yaxis [u.a.]') Just to add title, and label. In this case Ylabel is superposed on ytics labels and xlabel is hidden by the navigation toolbar. Do I need twiking and/or understand better wxpython ? Anyone can help me? "sample code" : import matplotlib matplotlib.use('WX') from matplotlib.backends.backend_wx import FigureCanvasWx,\ FigureManager, NavigationToolbar2Wx from matplotlib.figure import Figure from matplotlib.axes import Subplot import matplotlib.numerix as numpy from wxPython.wx import * TIMER_ID = wxNewId() class PlotFigure(wxFrame): def __init__(self): wxFrame.__init__(self, None, -1, "Test embedded wxFigure") self.fig = Figure((6,4), 75) self.canvas = FigureCanvasWx(self, -1, self.fig) self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() # On Windows, default frame size behaviour is incorrect # you don't need this under Linux tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() self.toolbar.SetSize(wxSize(fw, th)) # Create a figure manager to manage things self.figmgr = FigureManager(self.canvas, 1, self) # Now put all into a sizer sizer = wxBoxSizer(wxVERTICAL) # This way of adding to sizer allows resizing sizer.Add(self.canvas, 1, wxLEFT|wxTOP|wxGROW) # Best to allow the toolbar to resize! sizer.Add(self.toolbar, 0, wxGROW) self.SetSizer(sizer) self.Fit() EVT_TIMER(self, TIMER_ID, self.onTimer) def init_plot_data(self): a = self.fig.add_subplot(111) a.set_title('Title') a.set_xlabel('Xaxis [u.a.]') a.set_ylabel('Yaxis [u.a.]') self.ind = numpy.arange(60) tmp = [] for i in range(60): tmp.append(numpy.sin((self.ind+i)*numpy.pi/15)) self.X = numpy.array(tmp) self.lines = a.plot(self.X[:,0],'o') self.count = 0 def GetToolBar(self): # You will need to override GetToolBar if you are using an # unmanaged toolbar in your frame return self.toolbar def onTimer(self, evt): self.count += 1 if self.count >= 60: self.count = 0 self.lines[0].set_data(self.ind, self.X[:,self.count]) self.canvas.draw() self.canvas.gui_repaint() if __name__ == '__main__': app = wxPySimpleApp() frame = PlotFigure() frame.init_plot_data() # Initialise the timer - wxPython requires this to be connected to the # receivicng event handler t = wxTimer(frame, TIMER_ID) t.Start(100) frame.Show() app.MainLoop() |