SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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)

Showing results of 28

1 2 > >> (Page 1 of 2)
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
Attachments: present.png missing.png
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
From: Matt T. <mat...@gm...> - 2013年08月23日 15:14:14
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/
On Thu, 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.
>
> -matt
>
From: Sterling S. <sm...@fu...> - 2013年08月23日 15:12:01
On Aug 23, 2013, at 7:43AM, 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
Ben,
I am glad for the fix.
Peter,
You could use 
gcf().text(x,y,'String 1',**keyw)
gcf().text(x2,y2,'String 2',**keyw)
-Sterling
From: Benjamin R. <ben...@ou...> - 2013年08月23日 14:44:25
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
From: Peter B. <pet...@ca...> - 2013年08月23日 14:31:27
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
From: Kari A. <kar...@st...> - 2013年08月23日 14:21:15
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.
From: Jon R. <jon...@gm...> - 2013年08月23日 08:14:30
Dear Chris and List,
pdf2ps is usually just a front end to a long-winded ghostscript ("gs")
command. On my system this comes out as:
gs -q -dNOPAUSE -dBATCH -P- -dSAFER -sDEVICE=ps2write
"-sOutputFile=$outfile" -c save pop -f "1ドル"
If you're feeling brave, you can look at the ghostscript manual for ways to
improve upon the results (http://www.ghostscript.com/doc/9.07/Use.htm).
I've had to play this "game" with Astronomy journals in the past, and what
I actually did was save the output as a JPEG of ridiculously high
resolution and then put a postscript wrapper around it using jpeg2ps (
http://www.pdflib.com/download/free-software/jpeg2ps/).
Not pretty, but it works.
Good luck,
Jon
Jon Ramsey
===============================
jon...@gm...
On 23 August 2013 03:32, Chris Beaumont <cbe...@cf...> wrote:
> Thanks for these tips. 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?
>
> Thanks,
> chris
>
>
> On Thu, Aug 22, 2013 at 8:04 PM, Jerzy Karczmarczuk <
> jer...@un...> wrote:
>
>> Chris Beaumont :
>> >
>> > I have a semitransparent plot that I rather like:
>> ...
>> > I'd like to publish something like this in a journal which requires
>> > EPS figures. Unfortunately, EPS doesn't support transparency.
>> >
>> > How hard would it be to coax matplotlib (or another tool) to convert
>> > this semi-transparent figure into a non-semitransparent figure that
>> > looks the same?
>>
>> I won't claim that this is an ultimate solution, but what I did a few
>> times was to
>> 1. Choose the svg backend, savefig the picture as svg.
>> 2. Open in Inkscape and export as .eps.
>>
>> The result was satisfactory.
>>
>> Jerzy Karczmarczuk
>>
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>>
>
>
>
> ------------------------------------------------------------------------------
> 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: Florian M. W. <wag...@st...> - 2013年08月23日 07:54:08
Hey Chris,
I had a similar problem. I saved the transparent objects, so the 
polygons in your case, as a high-resolution png and the axes, dots, 
lines, text objects and everything else to an eps. Finally, I just layed 
them on top of each other in Illustrator and saved as eps, which 
produced a decent result. But this was only a work-around as well. They 
might be better options...
Cheers
Florian
Am 23.08.2013 00:55, schrieb Chris Beaumont:
> Hi,
>
> I have a semitransparent plot that I rather like:
>
> Inline image 1
> I'd like to publish something like this in a journal which requires 
> EPS figures. Unfortunately, EPS doesn't support transparency.
>
> How hard would it be to coax matplotlib (or another tool) to convert 
> this semi-transparent figure into a non-semitransparent figure that 
> looks the same? It would consist of more polygons, each of which has a 
> constant RGB value in the transparent figure.
>
> I don't want to rasterize the lines, because I like zooming absurdly 
> far into plots, and having them stay crisp.
>
> Cheers,
> Chris
>
>
> ------------------------------------------------------------------------------
> 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: Scott L. <sl...@sp...> - 2013年08月23日 04:29:55
On Aug 22, 2013, at 10:28 PM, 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.
> 
> On the web, I found references to this problem for builds on OS X. The solutions refer to a file README.osx, which is not
> present in the 1.3 distribution. The documentation (http://matplotlib.org/1.3.0/users/installing.html) also refers to this file and appears to be out of date.
> 
> I have tried fiddling with the LD_LIBRARY paths, but have not come upon a solution.
> 
> --Jim Boyle
You might try installing the latest XQuartz to see if that helps - http://xquartz.macosforge.org/landing/
I think you can use homebrew <http://brew.sh> or macports <http://www.macports.org> to install a copy of libfreetype, but it's fairly easy to do manually. Here's what I've done on recent versions of OS X. I'm not sure it's necessary to install everything below. Note that this only builds the native architecture for the version of OS X you are using, for example 64 bit for OS X 10.8, so there may be problems if you have to build matplotlib for a different architecture. In that case, you can add the appropriate CFLAGS="-arch blah" parameter to ./configure 
download, unpack, configure and install pkgconfig
 curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
 tar -xf pkg-config-0.28.tar.gz
 cd pkg-config-0.28
 ./configure --with-internal-glib
 make -j4
 sudo make install
download, unpack, configure and install freetype
 curl -O http://hivelocity.dl.sourceforge.net/project/freetype/freetype2/2.5.0/freetype-2.5.0.1.tar.bz2
 tar -xf freetype-2.5.0.1.tar.bz2
 cd freetype-2.5.0.1
 ./configure
 make -j4
 sudo make install
download, unpack, configure and install fontconfig
 curl -O http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.10.93.tar.bz2
 tar -xf fontconfig-2.10.93.tar.bz2
 cd fontconfig-2.10.93
 ./configure
 make -j4
 sudo make install
download, unpack, configure and install libpng
 curl -O http://hivelocity.dl.sourceforge.net/project/libpng/libpng15/1.5.17/libpng-1.5.17.tar.bz2
 tar -xf libpng-1.5.17.tar.bz2
 cd libpng-1.5.17
 make -j4
 sudo make install
download, unpack, configure and install ghostscript
 curl -O http://downloads.ghostscript.com/public/ghostscript-9.09.tar.gz
 tar -xf ghostscript-9.09.tar.gz
 cd ghostscript-9.09
 ./configure --with-x \
 --x-includes=/opt/X11/include \
 --x-libraries=/opt/X11/lib \
 --disable-gtk \
 --with-system-libtiff \
 CFLAGS="-arch x86_64 -arch i386" LDFLAGS="-arch x86_64 -arch i386"
 make -j4
 sudo make install
Now python3 setup.py in the matplotlib directory should show that it found the libs you just installed.
I hope this works for you,
Scott
From: Matt T. <mat...@gm...> - 2013年08月23日 03:24:36
>
> > 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.
-matt

Showing results of 28

1 2 > >> (Page 1 of 2)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /