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
(5) |
2
(13) |
3
(1) |
4
(4) |
5
(10) |
6
(13) |
7
(14) |
8
(3) |
9
(10) |
10
(3) |
11
|
12
(2) |
13
(8) |
14
(4) |
15
(4) |
16
(12) |
17
|
18
|
19
(7) |
20
(3) |
21
(1) |
22
(1) |
23
(28) |
24
(2) |
25
(3) |
26
(4) |
27
(8) |
28
(4) |
29
(4) |
30
(6) |
31
(3) |
From: Goyo <goy...@gm...> - 2013-08-26 16:21:59
|
2013/7/19 Nicolas Mailhot <nic...@la...>: > Le Mer 17 juillet 2013 14:56, Michael Droettboom a écrit : >> Can you please provide a completely standalone example? The following >> code has undefined variables etc. > > Here it is, I'm afraid this testcase intent is less clear than what I > pasted previously (I replaced variables with precomputed values) > > As shown in the attached png, the bottom tick labels (month names) are > missing. It worked in matplotlib ≤ 1.2.0 I can confirm the issue with 1.2.1 but it works with a recent development version (output attached) so it must have been fixed at some point. Goyo |
From: Kari A. <kar...@st...> - 2013-08-26 12:10:08
|
On 08/25/13 19:12, Goyo wrote: > >> Thank you. I'd like to stick to pure OO, but I'm using some >> third party open source code that uses pylab extensively for >> rather large and interactive (as in "includes scrollbars, >> buttons and several types of events") figures. The code >> works nicely in itself, and has an option to return the >> figure object without actually showing the plot. >> >> I was hoping to take the returned figure as an object and >> reset the related state environment information, effectively >> "smuggling" the created figure out of the state environment. >> If there is a simple way to do this in Matplotlib, that >> would be quite useful. > Does pyplot.close(fig) not do what you need? > > Goyo The problem is when to call pyplot.close(fig). The actual visible figure on the canvas is often resized along with window it is in, in addition to being interacted with in other ways. In these cases you can't just close the figure after drawing it - if you do, the resizing results in a blank canvas and a PyDeadObjectError. The easiest workaround to the problem is simply making the whole window modal, and closing the figure if the window is closed for any reason - or before you create a new figure. This is less than ideal, but lets the life go on in this case. Kari |
From: Peter Z. <pet...@gm...> - 2013-08-26 09:35:29
|
Hello, I set the x data only once now. It is a little bit faster (about 10%). I'm still looking for a solution which only redraws the line and not the whole widget. Peter Am 25.08.2013 15:00, schrieb Skip Montanaro: >> def updateGraph(self,data): >> datacut = data[10000 - self.DiagrammBreite.get_value():10000] >> self.line.set_ydata(datacut) >> self.line.set_xdata(numpy.arange(0, datacut.size, 1)) >> self.fig.canvas.draw() > If nothing else, it appears that the plot's x data are constant. Have > you tried just setting it once when you create self.line? > > Skip |
From: Nicolas M. <nic...@la...> - 2013-08-26 08:16:14
|
Le Ven 19 juillet 2013 17:47, Nicolas Mailhot a écrit : > Le Mer 17 juillet 2013 14:56, Michael Droettboom a écrit : Hi, >> Can you please provide a completely standalone example? The following >> code has undefined variables etc. > > Here it is, I'm afraid this testcase intent is less clear than what I > pasted previously (I replaced variables with precomputed values) > > As shown in the attached png, the bottom tick labels (month names) are > missing. It worked in matplotlib ≤ 1.2.0 Can you confirm the example was good enough for identifying the problem or did I forget something again? Regards, -- Nicolas Mailhot |
From: Goyo <goy...@gm...> - 2013-08-25 16:12:10
|
2013/8/23 Kari Aliranta <kar...@st...>: > 23.08.2013 20:57, Eric Firing kirjoitti: > Thank you. I'd like to stick to pure OO, but I'm using some > third party open source code that uses pylab extensively for > rather large and interactive (as in "includes scrollbars, > buttons and several types of events") figures. The code > works nicely in itself, and has an option to return the > figure object without actually showing the plot. > > I was hoping to take the returned figure as an object and > reset the related state environment information, effectively > "smuggling" the created figure out of the state environment. > If there is a simple way to do this in Matplotlib, that > would be quite useful. Does pyplot.close(fig) not do what you need? Goyo |
From: Skip M. <sk...@po...> - 2013-08-25 13:00:33
|
> def updateGraph(self,data): > datacut = data[10000 - self.DiagrammBreite.get_value():10000] > self.line.set_ydata(datacut) > self.line.set_xdata(numpy.arange(0, datacut.size, 1)) > self.fig.canvas.draw() If nothing else, it appears that the plot's x data are constant. Have you tried just setting it once when you create self.line? Skip |
From: Peter Z. <pet...@gm...> - 2013-08-25 07:50:38
|
Hello, I want a real-time animation. There is no loop in the animation because the data comes from the real world (AD data). I wrote this class: class Eigendiagramm(object): def __init__(self,daten): self.DiagrammBreite = gtk.Adjustment(100,20,10000,1,10,10) self.DiagrammBreiteWidget = gtk.VScale(self.DiagrammBreite) self.DiagrammBreiteWidget.connect("value_changed", self.updateBreite, None) self.data = daten self.fig = Figure() self.fig.set_animated(True) self.graph = self.fig.add_subplot(111) self.line, = self.graph.plot(self.data.get_ekg_data(),) self.graph.axis([0, self.DiagrammBreite.get_value(), 0, 4096]) self.canvas = FigureCanvas(self.fig) self.DiagrammBreite = gtk.Adjustment(100,20,10000,1,10,10) self.DiagrammBreiteWidget = gtk.VScale(self.DiagrammBreite) self.DiagrammBreiteWidget.connect("value_changed", self.updateBreite, None) def updateGraph(self,data): datacut = data[10000 - self.DiagrammBreite.get_value():10000] self.line.set_ydata(datacut) self.line.set_xdata(numpy.arange(0, datacut.size, 1)) self.fig.canvas.draw() def updateBreite(self,widget, data = None): self.graph.axis([0, self.DiagrammBreite.get_value(), 0, 4096]) It works but it is very slow. (About 160mS for updateGraph when I have two graphs) Is there any possibility to improve the performance? I embedded the figure in GTK. I looked to animation examples but every example there is a loop. So I don't know how to use this class for my problem. Peter |
From: Francesco M. <fra...@gm...> - 2013-08-24 10:26:08
|
use the "zorder" keyword. higher zorder stay above lower values. cheers Francesco Il giorno 24/ago/2013 11:27, "vwf" <vw...@vu...> ha scritto: > Hello, > > In the attached example I would like to have the wedges under the > arrows. Can someone tell me how do this? I tried to follow the tutorial > from http://matplotlib.org/users/artists.html but I didn't really get > it all. > > Thank you > > > from pylab import * > from numpy import ma > import math > import matplotlib.pyplot as plt > from matplotlib.patches import Wedge > > X,Y = meshgrid( arange(0,2*pi,1),arange(0,2*pi,1) ) > U = cos(X) > V = sin(Y) > > def draw_w(x, y, p1, v, ax=None, **kwargs): > if ax is None: > ax = plt.gca() > p1*=180/math.pi > t1= (p1-v) > t2= (p1+v) > c=(x,y) > radius=0.5 > w1 = Wedge(c, radius, t1, t2, fc='0.0', ec='None', alpha=1.0, **kwargs) > ax.add_artist(w1) > > fig, ax = plt.subplots() > Q = plt.quiver( U, V, color='LightSalmon', edgecolors='LightSalmon') > (a,b)=shape(X) > for i in range(a): > for j in range(b): > draw_w(X[i,j],Y[i,j],X[i,j], 25, ax=ax) > plt.show() > > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: vwf <vw...@vu...> - 2013-08-24 09:26:04
|
Hello, In the attached example I would like to have the wedges under the arrows. Can someone tell me how do this? I tried to follow the tutorial from http://matplotlib.org/users/artists.html but I didn't really get it all. Thank you from pylab import * from numpy import ma import math import matplotlib.pyplot as plt from matplotlib.patches import Wedge X,Y = meshgrid( arange(0,2*pi,1),arange(0,2*pi,1) ) U = cos(X) V = sin(Y) def draw_w(x, y, p1, v, ax=None, **kwargs): if ax is None: ax = plt.gca() p1*=180/math.pi t1= (p1-v) t2= (p1+v) c=(x,y) radius=0.5 w1 = Wedge(c, radius, t1, t2, fc='0.0', ec='None', alpha=1.0, **kwargs) ax.add_artist(w1) fig, ax = plt.subplots() Q = plt.quiver( U, V, color='LightSalmon', edgecolors='LightSalmon') (a,b)=shape(X) for i in range(a): for j in range(b): draw_w(X[i,j],Y[i,j],X[i,j], 25, ax=ax) plt.show() |
From: Chris B. <cbe...@cf...> - 2013-08-23 21:29:25
|
Thanks for the tips -- I wish there was a way to do this within MPL, but it sounds like I'll have to live with external hackery. > > > PS. Try to convince the Dark Powers of the journal you send your work, > > that they modernize their processing and accept PDF. > +1 I know, right? chris |
From: Russell E. O. <ro...@uw...> - 2013-08-23 20:52:58
|
In article <E94...@gm...>, James Boyle <jsb...@gm...> wrote: > I built MPL 1.3 from source, all seem to go OK but I ran into the problem of > not finding libfreetype.6.dylib when importing. Hmmm, it works for me. (I tried it again, just now). Here is what I did: * Make sure you have XQuartz installed. I have 2.7.4 which I got from Apple. * Edit setupext.py. Change this line: 'darwin': ['/usr/local/', '/usr', '/usr/X11', '/opt/local'], to: 'darwin': ['/usr', '/usr/X11'], to avoid any conflicts with any extra software you might have installed. * Copy setup.cfg.template to setup.cfg to change: #backend = TkAgg to: backend = TkAgg * python setup.py build * python setup.py install I found this resulted in a matplotlib I could use just fine on 10.8. (It won't work on 10.6 because the X11 libraries are in the wrong place). -- Russell |
From: Benjamin R. <ben...@ou...> - 2013-08-23 20:45:52
|
On Fri, Aug 23, 2013 at 4:08 PM, Kari Aliranta < kar...@st...> wrote: > 23.08.2013 20:57, Eric Firing kirjoitti: > > On 2013/08/23 3:55 AM, Kari Aliranta wrote: > >> Hello, fellow Matplotlib users, > >> > >> > >> I'm embedding some Matplotlib figures into GUI (PyQt4) windows or widget > >> canvases using qt4agg as the backend. I'm having problems with these > >> figures popping up any time when some other part of the program calls > >> pyplot.show(). > > > > Generally, when embedding, one simply does not use the pyplot interface > > at all, so this sort of problem does not arise. Is there any reason why > > you can't use this approach? > > Thank you. I'd like to stick to pure OO, but I'm using some > third party open source code that uses pylab extensively for > rather large and interactive (as in "includes scrollbars, > buttons and several types of events") figures. The code > works nicely in itself, and has an option to return the > figure object without actually showing the plot. > > I was hoping to take the returned figure as an object and > reset the related state environment information, effectively > "smuggling" the created figure out of the state environment. > If there is a simple way to do this in Matplotlib, that > would be quite useful. > > There is one quick-n-dirty way of doing it. And it ain't pretty. Using the third-party code in a subprocess that creates a pickle of the figure. Then load up the pickle and extract the figure object in your parent process. Your instance of matplotlib will never be touched. Told you it wasn't pretty... Ben Root |
From: Sterling S. <sm...@fu...> - 2013-08-23 20:24:58
|
> > > PS. Try to convince the Dark Powers of the journal you send your work, > that they modernize their processing and accept PDF. +1 |
From: Kari A. <kar...@st...> - 2013-08-23 20:09:10
|
23.08.2013 20:57, Eric Firing kirjoitti: > On 2013/08/23 3:55 AM, Kari Aliranta wrote: >> Hello, fellow Matplotlib users, >> >> >> I'm embedding some Matplotlib figures into GUI (PyQt4) windows or widget >> canvases using qt4agg as the backend. I'm having problems with these >> figures popping up any time when some other part of the program calls >> pyplot.show(). > > Generally, when embedding, one simply does not use the pyplot interface > at all, so this sort of problem does not arise. Is there any reason why > you can't use this approach? Thank you. I'd like to stick to pure OO, but I'm using some third party open source code that uses pylab extensively for rather large and interactive (as in "includes scrollbars, buttons and several types of events") figures. The code works nicely in itself, and has an option to return the figure object without actually showing the plot. I was hoping to take the returned figure as an object and reset the related state environment information, effectively "smuggling" the created figure out of the state environment. If there is a simple way to do this in Matplotlib, that would be quite useful. |
From: Jerzy K. <jer...@un...> - 2013-08-23 19:47:05
|
Le 23/08/2013 03:32, Chris Beaumont a écrit : > It looks like some programs (like illustrator, and pdf2ps) are > semi-smart about handling transparency when converting to ps. Both > have their quirks (illustrator seems to mess up the bounding box, > pdf2ps makes the text look worse/fuzzy). > > Is this the recommended/best strategy? Who can really say what is a/the recommended strategy?... I am almost certain that the process described by Jon Ramsey - passing through jpeg - is better to be avoided. It probably works decently, and the JPEG is quite economic, but the conversion of a raster into EPS produces large files, and - as you said - the rasterization makes it not so scalable. And in general, a lossy compression is methodologically wrong here... I compared on a sample picture (similar to yours, but simpler, from the matplotlib documentation) these two methods: 1. Generate pdf, use pdf2ps (and convert to eps) 2. Generate svg, use inkscape to export eps. The results are visually comparable. I don't notice much of fuzziness; perhaps this is the anti-aliasing on your display? My version, the passage through svg produces a file which is more than 3 times shorter. Good luck. Jerzy Karczmarczuk PS. Try to convince the Dark Powers of the journal you send your work, that they modernize their processing and accept PDF. |
From: Benjamin R. <ben...@ou...> - 2013-08-23 18:25:10
|
On Fri, Aug 23, 2013 at 1:57 PM, Eric Firing <ef...@ha...> wrote: > On 2013/08/23 3:55 AM, Kari Aliranta wrote: > > Hello, fellow Matplotlib users, > > > > > > I'm embedding some Matplotlib figures into GUI (PyQt4) windows or widget > > canvases using qt4agg as the backend. I'm having problems with these > > figures popping up any time when some other part of the program calls > > pyplot.show(). > > Generally, when embedding, one simply does not use the pyplot interface > at all, so this sort of problem does not arise. Is there any reason why > you can't use this approach? > > > > How do you avoid this showing of previous figures? Is there some hidden > > buffer where the figures go? If there is, what is the way to clear this > > buffer, or preferably avoid putting figures in this buffer altogether? > > I'd be happy to handle these figures as simple individual objects. > > To remove a figure created by pyplot, use pyplot.close(fig); but still, > trying to use the pyplot interface for anything more complicated than > direct interactive use and simple non-interactive scripts is likely to > cause more problems than it solves. It's just not what pyplot is > designed for. > > Eric > I am wondering if the problem being described here is one where someone creates a module to do some particular thing using matplotlib, and someone else has the script that is using pyplot and that module. I am fairly certain that the pure OO approach should still work for the code in the module without interference from the script's usage of pyplot, though, but I am not 100% certain. Cheers! Ben Root |
From: Benjamin R. <ben...@ou...> - 2013-08-23 17:57:37
|
On Fri, Aug 23, 2013 at 9:55 AM, Kari Aliranta < kar...@st...> wrote: > Hello, fellow Matplotlib users, > > > I'm embedding some Matplotlib figures into GUI (PyQt4) windows or widget > canvases using qt4agg as the backend. I'm having problems with these > figures popping up any time when some other part of the program calls > pyplot.show(). > > How do you avoid this showing of previous figures? Is there some hidden > buffer where the figures go? If there is, what is the way to clear this > buffer, or preferably avoid putting figures in this buffer altogether? > I'd be happy to handle these figures as simple individual objects. > > (I'm aware that this "hidden buffer" may be the pylab/pyplot buffer. I > tried deepcopying the figure and then clearing the pylab buffer with > pylab.clf() , but figures don't seem to be deepcopyable.) > > > A typical situation is the following: > > - There is a window with a widget. The widget (widgetMpl in the code > below) has a slightly customized FigureCanvas in it. The drawing code is > activated by clicking a button in the window. The code goes as follows. > > # The plot method returns a complicated instance of Figure with > several axes, constructed with Pylab. > previewFigure = > self.parent.experiment.file_to_plot.plot(show=False, n_channels=10) > > self.ui.widgetMpl.canvas.figure = previewFigure > self.ui.widgetMpl.canvas.draw() > > > - I draw the figure in the window once, or several times with different > file_to_plot, by pressing the button. I may or may not close the window > with the aforementioned widget. > > - Elsewhere in the program there is another window with very simple > drawing code using pyplot. When this code calls pyplot.show(), all the > figures drawn in the first window will show up. > > > It is called the "pyplot state environment". When code uses pylab or pyplot, the pyplot state implicitly keeps track of all the axes and figures that are generated. The way to avoid the pyplot state environment is to completely avoid any and all usage of pyplot. Don't even import it. Work strictly down in the OO layer. Of course, this is difficult to do for a variety of reasons, but it should be achievable. There are other people on this mailing list that are much more experienced than I with the pure OO-approach and embedding, and hopefully they can chime in with pointers and tips. Cheers! Ben Root |
From: Eric F. <ef...@ha...> - 2013-08-23 17:57:23
|
On 2013/08/23 3:55 AM, Kari Aliranta wrote: > Hello, fellow Matplotlib users, > > > I'm embedding some Matplotlib figures into GUI (PyQt4) windows or widget > canvases using qt4agg as the backend. I'm having problems with these > figures popping up any time when some other part of the program calls > pyplot.show(). Generally, when embedding, one simply does not use the pyplot interface at all, so this sort of problem does not arise. Is there any reason why you can't use this approach? > > How do you avoid this showing of previous figures? Is there some hidden > buffer where the figures go? If there is, what is the way to clear this > buffer, or preferably avoid putting figures in this buffer altogether? > I'd be happy to handle these figures as simple individual objects. To remove a figure created by pyplot, use pyplot.close(fig); but still, trying to use the pyplot interface for anything more complicated than direct interactive use and simple non-interactive scripts is likely to cause more problems than it solves. It's just not what pyplot is designed for. Eric > > (I'm aware that this "hidden buffer" may be the pylab/pyplot buffer. I > tried deepcopying the figure and then clearing the pylab buffer with > pylab.clf() , but figures don't seem to be deepcopyable.) > > > A typical situation is the following: > > - There is a window with a widget. The widget (widgetMpl in the code > below) has a slightly customized FigureCanvas in it. The drawing code is > activated by clicking a button in the window. The code goes as follows. > > # The plot method returns a complicated instance of Figure with > several axes, constructed with Pylab. > previewFigure = > self.parent.experiment.file_to_plot.plot(show=False, n_channels=10) > > self.ui.widgetMpl.canvas.figure = previewFigure > self.ui.widgetMpl.canvas.draw() > > > - I draw the figure in the window once, or several times with different > file_to_plot, by pressing the button. I may or may not close the window > with the aforementioned widget. > > - Elsewhere in the program there is another window with very simple > drawing code using pyplot. When this code calls pyplot.show(), all the > figures drawn in the first window will show up. > > > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Chris B. - N. F. <chr...@no...> - 2013-08-23 17:54:26
|
On Fri, Aug 23, 2013 at 8:14 AM, Matt Terry <mat...@gm...> wrote: > I'm banging away at installing MPL on top of python.org's python. This is why binary installers are good idea! > the libfreetype/freetype issue. yeah, that's kind of ugly....and where is doesn't "just work" for me... > 1) install libpng[1] and freetype[2] from source libpng and freetype are different, though install from source may be the way to go: libpng is there, but is not properly installed, I'm not sure it's got the header for the same version as the lib, and libpng-config is either not there or not for the right version or somethign ugly. It look, form messages at build time, that someone has hacked some code into the MPL build that figures all that out, but for other stuff I'm doing, I just punt and build libpng -- that's pretty straighforward, at least. But teh solution in the MPL code now seems to work. > 2) install XQuartz[3] and twiddle /opt/X11, /usr/X11 (per Russell's > directions[4]) so MPL finds XQuartz's libpng/freetype I _think_ that OS-X now ships with X11, which has freetype (though installed weirdly once again...) we certainly should NOT expect people to install anything big to build MPL, and binaries should not depend on anything not shipped by Apple by default. According to Russell, you do need to install something, so I think that's out. > 4) create the MPL binary installer and use that That's what most people should do -- but one of us needs to build it. > Option 1 seems simple-est, but installing freetype requires more than > ./configure && make && sudo make install. darn. But hopefully we can figure it out. > Option 4: This would require some input from whoever (Gohlke?, Owen?) makes > the binary installers. I think Russell has been doing it for MPL lately. My thoughts: We want to support two user-bases: 1) folks that don't mind a little command line work, and probably need other scientific libs, etc anyway, an want an MPL that runs on their machine: - these folks should use homebrew or macports to build the dependencies (or even hand-compile them). Ideally we have setup.py that will find those libs, and test to see that the builds work once in a while. 2) folks that "just want to use it" and/or want a binary they can re-distribute via py2app, etc. - for these folks, we need to provide binaries. These binaries should: 1) Match the python.org python builds. (probably only the Intel ones now...) 2) statically link the non-sytem libs This has been done for a while, off and on, most recently by Russell, AFAIK. But this is not a problem unique to MPL. All sorts of python packages need this, and only some of the package maintainers do it (well). Also, a bunch of packages require the same dependencies (i.e. PIL and MPL both need png and freetype) So, rather than re-inventing the wheel over and over again, It would be great to have a central repository where we can develop build scripts, etc that share an infrustructure for building these binaries. I've started one: https://github.com/MacPython/mac-builds there is not much there, only a couple things I'm working on at the moment (netCDF4, which is of interest to scipy folks, and py_gd, which is my own simple drawing lib, that no one else uses (yet?) If anyone wants to join the project let me know -- if I know you from your work with this community, I'll gladly add you. I'm using the gattai build system: (https://sourceforge.net/projects/gattai/). I decided to do that, as I was sick of re-writing essentially the same build scripts, and I kept adding features to mine that would have resulted in re-implementing gattai anyway. I've been hacking at gattai, and its author is quite open to moving it forward. That being said, there is no reason that we need to use the same build system -- we could easily have custom build scripts for a project, and still have it share the dependencies. I was planning on getting it all further along before announcing the project and looking for help, but since is came up... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Russell O. <ro...@uw...> - 2013-08-23 17:42:14
|
On Aug 22, 2013, at 8:24 PM, Matt Terry <mat...@gm...> wrote: > > with/without third party X > I'm not quite sure what you mean by with/without third party X. If you > are referring to Tck/Tk: > > I had an issue where MPL found the headers to freetype in /opt/local, but library in /usr/X11. Hilarity ensues. I *think* /usr/X11 showed up when I installed XQuartz, but I don't have a clean image to compare against. > > The with-X / without-X builds would be there to check that the default search paths are compatible with common environments. Have you tried eliminating /opt from the search path in setupext.py? If that does the trick, I think we may be stuck. The default search paths are trying to work for default python, python.org python, macports and homebrew, plus user-built libraries in /usr/local. I'm not convinced one file can do it all. Apple moving X from /usr/X11 to /opt/X11 did not help. Regards, -- Russell |
From: Russell O. <ro...@uw...> - 2013-08-23 17:07:17
|
On Aug 23, 2013, at 8:14 AM, Matt Terry <mat...@gm...> wrote: > I'm banging away at installing MPL on top of python.org's python. I'm at the libfreetype/freetype issue. There seems to be three approaches to getting MPL's dependencies. > > 1) install libpng[1] and freetype[2] from source > 2) install XQuartz[3] and twiddle /opt/X11, /usr/X11 (per Russell's directions[4]) so MPL finds XQuartz's libpng/freetype > 3) install XQuartz[3] and install pkg-config[5] so MPL can find the cleverly installed libraries > 4) create the MPL binary installer and use that > > Option 1 seems simple-est, but installing freetype requires more than ./configure && make && sudo make install. > Option 2 worries me with the manual symlinking and such. Who knows what we'll clobber. > Option 3: haven't fully explored. > Option 4: This would require some input from whoever (Gohlke?, Owen?) makes the binary installers. > > [1] http://www.libpng.org/pub/png/libpng.html > [2] http://www.freetype.org/index.html > [3] http://xquartz.macosforge.org/landing/ > [4] http://www.astro.washington.edu/users/rowen/BuildingMatplotlibForMac.html > [5] http://www.freedesktop.org/wiki/Software/pkg-config/ I'm a bit puzzled what you are trying to do. I've found that matplotlib "just builds" if I only want to use it on the Mac I'm building it on. Depending on what you've added to your Mac you may find you have to restrict the search dirs in setupext.py, but that's all I have ever had to do for years. For me the problems arise when trying to build a binary installer that runs on multiple versions of MacOS. The following comments all deal with that case (making a binary installer): I would eliminate (2) as an option; I thought it would help but it doesn't (perhaps I need to update my matplotlib build instructions). The issue is that when I build a binary installer on 10.8, it cannot be used on 10.6 because it is looking for some libraries in /opt/X11 (which is where XQuartz is installed on 10.8) instead of /usr/X11 (which is where X11 is installed on 10.6). It's only an issue for binary installers; I haven't had any problem just building matplotlib for python.org python. I have pretty much given up building binary installers on anything but the oldest version of MacOS X that they can be used on (or as close as I can get). I've just run into too many problems like this. I like (1) for binary installers. It eliminates the need for a user to have installed X11 at all. The hassle is making sure matplotlib statically links these libraries. I've always done this by taking the crude approach of deleting the shared object libraries, leaving only the static libraries; it always worked in the past, but recently I ran into a problem where something I was building simply refused to use a static library (I don't remember the details). Regarding option [4]. You can get a binary installer for matplotlib 1.3 from here: <http://www.astro.washington.edu/users/rowen/python/> but it may clobber your python-dateutil and pytz (especially likely if they were installed by the matplotlib 1.2.1 binary installer). That's the main reason it's not an official binary installer. -- Russell |
From: Skip M. <sk...@po...> - 2013-08-23 17:02:24
|
I'm using Matplotlib 1.2.0 (provided as a package by an external supplier) on an OpenSuSE 12.2 system using Python 2.7 and (I think) the GtkAgg backend. I wrote a simple application that reads a CSV file and displays one or more pairs of columns. I use it pretty much constantly. Yesterday I discovered pylab.Figure.tight_layout, and love it because I get a significant chunk of my screen back. Alas, interactive display of x,y coordinates seems to have gotten rather spotty. Consider the two attached PNG files. Same plot. One shows the x,y coordinates in the lower right-hand corner, the other doesn't. The only thing different is the motion/position of the mouse. Any thoughts about this? Is it a known problem (that is hopefully fixed in 1.3)? Thanks, Skip Montanaro |
From: Peter B. <pet...@ca...> - 2013-08-23 16:02:57
|
On 08/23/2013 11:31 AM, Benjamin Root wrote: > > On Fri, Aug 23, 2013 at 11:21 AM, Peter Bloomfield > <pet...@ca... <mailto:pet...@ca...>> wrote: > > > On 08/23/2013 10:43 AM, Benjamin Root wrote: >> >> >> On Fri, Aug 23, 2013 at 9:57 AM, Peter Bloomfield >> <pet...@ca... >> <mailto:pet...@ca...>> wrote: >> >> Good morning, >> >> I am running openSuSE 12.2, and this morning I upgraded >> matplotlib to v1.3, and now I am having a problem with suptitle. >> I use the following lines to put a title and legend onto a >> plot figure >> >> import matplotlib.pyplot as plt >> >> plt.figure(1) >> >> plt.suptitle( "Study# : " + os.path.basename( >> inImage_IO.IO_FileName ) + \ >> >> "\n" + "{ Acquired : " + \ >> >> AcqDateTime.strftime( "%b %d, %Y - $T_o$ @ %H:%M:%S" ) + " }", \ >> >> y=0.98, weight="roman", size="large" ) >> >> plt.suptitle( "{Creation Date : " + AnalysisTOD + "}", >> >> x=0.86, y=0.03, weight="roman", size="x-small" ) >> >> >> Under v1.3, I only get the 'Creation Date : ...' text at the >> bottom of the figure the 'Study# ...' string is not present >> at the top. If I change >> it to >> >> import matplotlib.pyplot as plt >> >> plt.figure(1) >> >> plt.suptitle( "Study# : ", y=0.98, weight="roman", size="large" ) >> >> plt.suptitle( "{Creation Date : " + AnalysisTOD + "}", >> >> x=0.86, y=0.03, weight="roman", size="x-small" ) >> >> the 'Creation Date : ...' text at the bottom of the figure >> the 'Study# : ' string is at the top. >> >> >> So the problem is in the string construct in the first >> example. Does anybody know of a way to get around this? >> >> >> Thanks in advance >> >> >> Peter >> >> >> Oh, wow... we didn't think anybody was using that "misfeature". >> This was a bug we fixed for 1.3, in that users complained that >> calling plt.title() would update an existing title, but >> plt.suptitle() would not (multiple calls would just result in >> text overlaid on top of each other). We fixed this for 1.3 so >> that there is a single text object that is kept and is revised in >> subsequent calls to suptitle(). To get what you want, you will >> have to consolidate those strings into one. >> >> Cheers! >> Ben >> > Thanks for getting back to me, but I have tried to do as you > suggest, but to no avail, and here I apologise for my lack of > knowledge of python/matplotlib. > I consolidated the strings into one, titleStr > > titleStr = "Study# : " + os.path.basename( > inImage_IO.IO_FileName ) + \ > > "\n" + "{ Acquired : " + \ > AcqDateTime.strftime( "%b %d, %Y - $T_o$ @ > %H:%M:%S" ) + " }" > plt.suptitle( titleStr, y=0.98, weight="roman", size="large" ) > > which should write the string > 'Study# : Pos9.img\n{ Acquired : Feb 18, 2003 - $T_o$ @ > 14:55:02 }' > at the top of the figure, but it did not, so I thought it is the > "\n", and tried > > titleStr = "Study# : " + os.path.basename( > inImage_IO.IO_FileName ) > plt.suptitle( titleStr, y=0.98, weight="roman", size="large" ) > > which should write the string > 'Study# : Pos9.img' > and this again failed to write the suptitle in the figure. > > Am I being dumb (rhetorical)? What is the best way to consolidate > the strings to work with suptitle, many thanks in advance. > > Cheers > > Peter > > > No issues here. Let's try simplifying it further and further. Try > the following script. > > import matplotlib.pyplot as plt > plt.suptitle("Study# : Pos9.img") > plt.show() > > Does that work for you? If it does, iterate on that code example, > adding pieces back into it and see when it breaks. > > Ben Root The example works, and changing it to import matplotlib.pyplot as plt plt.suptitle( "Study# : Pos9.img\n{ Acquired : Feb 18, 2003 - $T_o$ @ 14:55:02 }") plt.show() also works. Though now, I need to apologise, in my original email I should have added that I am using from matplotlib.backends.backend_pdf import PdfPages to write a pdf file of the save the figure. I extended the example to a small script from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt PDF_Filename = "Test.pdf" OutPDF = PdfPages( PDF_Filename ) plt.suptitle("Study# : Pos9.img\n{ Acquired : Feb 18, 2003 - $T_o$ @ 14:55:02 }") plt.savefig( OutPDF, dpi=600, format="pdf" ) OutPDF.close() and this also works, the text is now written correctly in Test.pdf. However, if I add a second call to plt.suptitle in the script the text added from the first call is removed, which is what was refered to in the first response. Cheers Peter |
From: Benjamin R. <ben...@ou...> - 2013-08-23 15:32:09
|
On Fri, Aug 23, 2013 at 11:21 AM, Peter Bloomfield < pet...@ca...> wrote: > > On 08/23/2013 10:43 AM, Benjamin Root wrote: > > > > On Fri, Aug 23, 2013 at 9:57 AM, Peter Bloomfield < > pet...@ca...> wrote: > >> Good morning, >> >> I am running openSuSE 12.2, and this morning I upgraded matplotlib to >> v1.3, and now I am having a problem with suptitle. >> I use the following lines to put a title and legend onto a plot figure >> >> import matplotlib.pyplot as plt >> plt.figure(1) >> >> plt.suptitle( "Study# : " + os.path.basename( inImage_IO.IO_FileName ) + \ >> >> "\n" + "{ Acquired : " + \ >> >> AcqDateTime.strftime( "%b %d, %Y - $T_o$ @ %H:%M:%S" ) + " }", \ >> >> y=0.98, weight="roman", size="large" ) >> >> plt.suptitle( "{Creation Date : " + AnalysisTOD + "}", >> >> x=0.86, y=0.03, weight="roman", size="x-small" ) >> >> >> Under v1.3, I only get the 'Creation Date : ...' text at the bottom of >> the figure the 'Study# ...' string is not present at the top. If I change >> it to >> >> import matplotlib.pyplot as plt >> plt.figure(1) >> >> plt.suptitle( "Study# : ", y=0.98, weight="roman", size="large" ) >> >> plt.suptitle( "{Creation Date : " + AnalysisTOD + "}", >> >> x=0.86, y=0.03, weight="roman", size="x-small" ) >> >> the 'Creation Date : ...' text at the bottom of the figure the 'Study# >> : ' string is at the top. >> >> >> So the problem is in the string construct in the first example. Does >> anybody know of a way to get around this? >> >> >> Thanks in advance >> >> >> Peter >> >> > Oh, wow... we didn't think anybody was using that "misfeature". This was > a bug we fixed for 1.3, in that users complained that calling plt.title() > would update an existing title, but plt.suptitle() would not (multiple > calls would just result in text overlaid on top of each other). We fixed > this for 1.3 so that there is a single text object that is kept and is > revised in subsequent calls to suptitle(). To get what you want, you will > have to consolidate those strings into one. > > Cheers! > Ben > > Thanks for getting back to me, but I have tried to do as you suggest, > but to no avail, and here I apologise for my lack of knowledge of > python/matplotlib. > I consolidated the strings into one, titleStr > > titleStr = "Study# : " + os.path.basename( inImage_IO.IO_FileName ) + \ > > "\n" + "{ Acquired : " + \ > AcqDateTime.strftime( "%b %d, %Y - $T_o$ @ %H:%M:%S" ) + " > }" > plt.suptitle( titleStr, y=0.98, weight="roman", size="large" ) > > which should write the string > 'Study# : Pos9.img\n{ Acquired : Feb 18, 2003 - $T_o$ @ 14:55:02 }' > at the top of the figure, but it did not, so I thought it is the "\n", > and tried > > titleStr = "Study# : " + os.path.basename( inImage_IO.IO_FileName ) > plt.suptitle( titleStr, y=0.98, weight="roman", size="large" ) > > which should write the string > 'Study# : Pos9.img' > and this again failed to write the suptitle in the figure. > > Am I being dumb (rhetorical)? What is the best way to consolidate the > strings to work with suptitle, many thanks in advance. > > Cheers > > Peter > > No issues here. Let's try simplifying it further and further. Try the following script. import matplotlib.pyplot as plt plt.suptitle("Study# : Pos9.img") plt.show() Does that work for you? If it does, iterate on that code example, adding pieces back into it and see when it breaks. Ben Root |
From: Peter B. <pet...@ca...> - 2013-08-23 15:21:13
|
On 08/23/2013 10:43 AM, Benjamin Root wrote: > > > On Fri, Aug 23, 2013 at 9:57 AM, Peter Bloomfield > <pet...@ca... <mailto:pet...@ca...>> wrote: > > Good morning, > > I am running openSuSE 12.2, and this morning I upgraded matplotlib > to v1.3, and now I am having a problem with suptitle. > I use the following lines to put a title and legend onto a plot figure > > import matplotlib.pyplot as plt > > plt.figure(1) > > plt.suptitle( "Study# : " + os.path.basename( > inImage_IO.IO_FileName ) + \ > > "\n" + "{ Acquired : " + \ > > AcqDateTime.strftime( "%b %d, %Y - $T_o$ @ %H:%M:%S" ) + " }", \ > > y=0.98, weight="roman", size="large" ) > > plt.suptitle( "{Creation Date : " + AnalysisTOD + "}", > > x=0.86, y=0.03, weight="roman", size="x-small" ) > > > Under v1.3, I only get the 'Creation Date : ...' text at the > bottom of the figure the 'Study# ...' string is not present at the > top. If I change > it to > > import matplotlib.pyplot as plt > > plt.figure(1) > > plt.suptitle( "Study# : ", y=0.98, weight="roman", size="large" ) > > plt.suptitle( "{Creation Date : " + AnalysisTOD + "}", > > x=0.86, y=0.03, weight="roman", size="x-small" ) > > the 'Creation Date : ...' text at the bottom of the figure the > 'Study# : ' string is at the top. > > > So the problem is in the string construct in the first example. > Does anybody know of a way to get around this? > > > Thanks in advance > > > Peter > > > Oh, wow... we didn't think anybody was using that "misfeature". This > was a bug we fixed for 1.3, in that users complained that calling > plt.title() would update an existing title, but plt.suptitle() would > not (multiple calls would just result in text overlaid on top of each > other). We fixed this for 1.3 so that there is a single text object > that is kept and is revised in subsequent calls to suptitle(). To get > what you want, you will have to consolidate those strings into one. > > Cheers! > Ben > Thanks for getting back to me, but I have tried to do as you suggest, but to no avail, and here I apologise for my lack of knowledge of python/matplotlib. I consolidated the strings into one, titleStr titleStr = "Study# : " + os.path.basename( inImage_IO.IO_FileName ) + \ "\n" + "{ Acquired : " + \ AcqDateTime.strftime( "%b %d, %Y - $T_o$ @ %H:%M:%S" ) + " }" plt.suptitle( titleStr, y=0.98, weight="roman", size="large" ) which should write the string 'Study# : Pos9.img\n{ Acquired : Feb 18, 2003 - $T_o$ @ 14:55:02 }' at the top of the figure, but it did not, so I thought it is the "\n", and tried titleStr = "Study# : " + os.path.basename( inImage_IO.IO_FileName ) plt.suptitle( titleStr, y=0.98, weight="roman", size="large" ) which should write the string 'Study# : Pos9.img' and this again failed to write the suptitle in the figure. Am I being dumb (rhetorical)? What is the best way to consolidate the strings to work with suptitle, many thanks in advance. Cheers Peter -- Peter M. Bloomfield Physicist, PET Centre, Centre for Addiction and Mental Health, 250 College St., Toronto, Ontario, Canada M5T 1R8 Tel: 416 535 8501 Ext. 4243 |