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
2
(2)
3
(16)
4
(22)
5
(7)
6
7
(9)
8
(2)
9
10
(7)
11
(15)
12
(7)
13
(4)
14
(7)
15
(3)
16
(6)
17
(20)
18
(18)
19
(15)
20
(27)
21
(14)
22
23
(1)
24
(18)
25
(22)
26
(36)
27
(17)
28
(6)
29
(2)
30
(3)
31
(6)





Showing results of 303

<< < 1 2 3 4 .. 13 > >> (Page 2 of 13)
From: R P. <wrp...@ya...> - 2010年05月27日 17:29:42
Ah, thanks a lot. 
--- On Thu, 5/27/10, Jae-Joon Lee <lee...@gm...> wrote:
> From: Jae-Joon Lee <lee...@gm...>
> Subject: Re: [Matplotlib-users] Clip text in bars
> To: "wrpd_mnd" <wrp...@ya...>
> Cc: mat...@li...
> Date: Thursday, May 27, 2010, 9:24 AM
> The bbox needs to be in a proper
> coordinate.
> 
> from matplotlib.transforms import TransformedBbox
> bb = TransformedBbox(rect[0].get_bbox(), ax.transData)
> 
> Also, do not use clip_on when clip_box is used. clip_on
> override
> clip_box with ax.bbox.
> 
> text0 = ax.text(0,11,'JobName', clip_box=bb)
> 
> A complete code is attached.
> 
> Regards,
> 
> -JJ
> 
> 
> import matplotlib.pyplot as plt
> from matplotlib.transforms import TransformedBbox
> 
> fig = plt.figure()
> 
> ax = fig.add_subplot(111)
> rect = ax.barh(10, 50, 3, facecolor='green', visible=True)
> ax.set_ylim(0,35)
> ax.set_xlim(0,1000)
> 
> bb = TransformedBbox(rect[0].get_bbox(), ax.transData)
> 
> text0 = ax.text(0,11,'JobName', clip_box=bb)
> 
> ax.grid(True)
> 
> plt.show()
> 
> 
> 
> On Thu, May 27, 2010 at 8:41 AM, wrpd_mnd <wrp...@ya...>
> wrote:
> >
> > I'm trying to set up a chart that shows a runtime
> trace of a single frame.
> > Most of it is straight forward, however one aspect of
> it is driving me
> > crazy. I would like to label the inside of the bar
> fragments (each represent
> > a function call with the x-extent being its runtime)
> with the name of the
> > task, however I would like the text itself to be fully
> contained within the
> > bar itself. I should, in theory, be able to set the
> clipping box of the text
> > to be the bounding box of the bar and that should give
> me the result I want.
> > Except, I'm not getting that.
> >
> > Any ideas?
> >
> > See the code below:
> >
> > import numpy as np
> > import matplotlib.pyplot as plt
> >
> > fig = plt.figure()
> > ax = fig.add_subplot(111)
> > rect = ax.barh(10, 50, 3, facecolor='green',
> visible=True)
> > ax.set_ylim(0,35)
> > ax.set_xlim(0,1000)
> >
> > text0 =
> ax.text(0,11,'JobName',clip_on=True,clip_box=rect[0].get_bbox())
> >
> > ax.grid(True)
> >
> > plt.show()
> >
> > --
> > View this message in context: http://old.nabble.com/Clip-text-in-bars-tp28693489p28693489.html
> > Sent from the matplotlib - users mailing list archive
> at Nabble.com.
> >
> >
> >
> ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> 
 
What I usually do is to clear the axis (using cla() only) right after 
creating or accessing it (either with figure() or subplot() or similar 
magic):
from pylab import *
fig = figure(num=1)
for example in range(5):
 cla()
 plot(rand(100))
 savefig('test-%d.png'%example)
-------- Original Message --------
Subject: 	[Matplotlib-users] Clearing A Figure (I Know That This Has 
Been Posted Before But I Does Not Work For Me)
Date: 	2010年5月25日 02:08:42 -0700 (PDT)
From: 	Thistleryver <mh...@ec...>
To: 	mat...@li...
I am attempting to run a lot of tests automatically and generate a graph for
each one. However, at the moment, the previous graph remains on the figure
and the next plot is drawn over it.
I have read extensively the documentation and I have tried a whole lot of
different commands but to no avail. In the previous post it said to use
pylab.clf() which is exactly what I've been trying to use.
So far I have used pylab.cla(), pylab.clf() and pylab.close() although I
believe that this only closes an open figure window. I have no idea why it
is not working now especially since it would appear that my question had
already been answered in both the documentation and the forums.
I am using Python 2.6.4 on Ubuntu Linux.
Here is the relevant code I am using:
	pylab.plot(xAxis, TrainingPoints, 'b-')
	pylab.plot(xAxis, TestPoints, 'r-')
	pylab.xlabel('Epochs')
	pylab.ylabel('Sum Squared Error')
	pylab.title('Plot of Iris Training Errors')
	outfilename = str(int(LEARNING_RATE)) + ".png"
	print outfilename
	pylab.ylim(ymin=0)
	pylab.savefig(outfilename)
	pylab.cla()
	pylab.clf()
I really hope one of you can spot an error otherwise I am completely stuck.
-- 
View this message in context: http://old.nabble.com/Clearing-A-Figure-%28I-Know-That-This-Has-Been-Posted-Before-But-I-Does-Not-Work-For-Me%29-tp28665976p28665976.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jae-Joon L. <lee...@gm...> - 2010年05月27日 16:25:22
The bbox needs to be in a proper coordinate.
from matplotlib.transforms import TransformedBbox
bb = TransformedBbox(rect[0].get_bbox(), ax.transData)
Also, do not use clip_on when clip_box is used. clip_on override
clip_box with ax.bbox.
text0 = ax.text(0,11,'JobName', clip_box=bb)
A complete code is attached.
Regards,
-JJ
import matplotlib.pyplot as plt
from matplotlib.transforms import TransformedBbox
fig = plt.figure()
ax = fig.add_subplot(111)
rect = ax.barh(10, 50, 3, facecolor='green', visible=True)
ax.set_ylim(0,35)
ax.set_xlim(0,1000)
bb = TransformedBbox(rect[0].get_bbox(), ax.transData)
text0 = ax.text(0,11,'JobName', clip_box=bb)
ax.grid(True)
plt.show()
On Thu, May 27, 2010 at 8:41 AM, wrpd_mnd <wrp...@ya...> wrote:
>
> I'm trying to set up a chart that shows a runtime trace of a single frame.
> Most of it is straight forward, however one aspect of it is driving me
> crazy. I would like to label the inside of the bar fragments (each represent
> a function call with the x-extent being its runtime) with the name of the
> task, however I would like the text itself to be fully contained within the
> bar itself. I should, in theory, be able to set the clipping box of the text
> to be the bounding box of the bar and that should give me the result I want.
> Except, I'm not getting that.
>
> Any ideas?
>
> See the code below:
>
> import numpy as np
> import matplotlib.pyplot as plt
>
> fig = plt.figure()
> ax = fig.add_subplot(111)
> rect = ax.barh(10, 50, 3, facecolor='green', visible=True)
> ax.set_ylim(0,35)
> ax.set_xlim(0,1000)
>
> text0 = ax.text(0,11,'JobName',clip_on=True,clip_box=rect[0].get_bbox())
>
> ax.grid(True)
>
> plt.show()
>
> --
> View this message in context: http://old.nabble.com/Clip-text-in-bars-tp28693489p28693489.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Alan G I. <ala...@gm...> - 2010年05月27日 14:07:40
On 5/27/2010 9:54 AM, Sandy Ydnas wrote:
> it is the my point
> show() can not be used during debuging....
>
> but without debug option any tools is usless
> since the main problem in coding is debuging ...
But you have never explained your need here.
You cannot start the mainloop (using ``show``)
and then complain that the mainloop is running!
If you want do debug your script, just use
``savefig`` instead of ``show``. If that is
not adequate, explain why.
Alan Isaac
From: Friedrich R. <fri...@gm...> - 2010年05月27日 13:25:44
Dear Pim,
2010年5月27日 Pim Schellart <p.s...@gm...>:
> At first I used the binaries for the latest stable releases of Python
> 2.6 + numpy + matplotlib from the respected websites.
> But in order to compile a custom library I needed Python to be compiled 64 bit.
For me this was the same with PIL ... though I didn't need 64bit for
that. And I agree, for a new Mac user it's a mess.
> This worked for Python, numpy and scipy but not for matplotlib.
> I used to be able to compile matplotlib with a simple "sudo python
> setup.py install" but when I tried to do this after the change to 64
> bit the build failed with some errors which seemed to me to be related
> to freetype not being compiled 64 bit (these errors, which I
> unfortunately did not save clearly indicated that the linker could not
> find some symbols and when I checked the architecture of the libs it
> was i386 only).
> I tried to fix this by first compiling freetype 64 bit, and later
> libpng as well.
> The problem now was that setupext.py did not look in the right
> location for my new libpng build.
> After I installed pkgtool this was also solved, however now the
> reported error occurred.
And this error was due to the API change.
> I also could not use the make.osx script from the latest svn checkout
> because of a bug in the fetching of zlib which John fixed.
> Finally removing my custom installations of freetype and libpng and
> using make.osx to fetch and build them solved the problem.
> Oh and somewhere in all this mess I also managed to build it but then
> got a malloc error when loading so I tried the removing of i386 but
> this did not solve the problem so I changed it back.
This I don't understand.
> I guess the conclusion is that the current svn works, but only with
> the make.osx approach.
I cannot agree currently. I can try to do my first contact with svn,
but for the stable release, it works as said before with some tweaking
in setupext.py and src/_png.cpp too. Also we seem to have quite
similar machines and prerequisites. The setupext.py tweak may be
omittable by using pkgtool.
So my conclusion is that with using pkgtool and the change in
src/_png.cpp matplotlib should be buildable from sources with
setup.py.
John, shouldn't we finally fix this ugly src/_png.cpp problem? More
and more people run into problems when using the recent libpng-1.4.
The lines to be added to _png.cpp are:
#define png_infopp_NULL (png_infopp)NULL
#define int_p_NULL (int*)NULL
Maybe libpng defines some constant to make use of in determining
whether the build is with libpng-1.2 or 1.4.
> If I had the time I would try it again on a fresh install to see where
> the bug is that prevents setup.py from working with a custom compiled
> freetype and libpng but for now I am happy that it finally works :)
I can understand you and I'm facing the same problem.
Friedrich
From: wrpd_mnd <wrp...@ya...> - 2010年05月27日 12:41:55
I'm trying to set up a chart that shows a runtime trace of a single frame.
Most of it is straight forward, however one aspect of it is driving me
crazy. I would like to label the inside of the bar fragments (each represent
a function call with the x-extent being its runtime) with the name of the
task, however I would like the text itself to be fully contained within the
bar itself. I should, in theory, be able to set the clipping box of the text
to be the bounding box of the bar and that should give me the result I want.
Except, I'm not getting that. 
Any ideas?
See the code below:
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
rect = ax.barh(10, 50, 3, facecolor='green', visible=True)
ax.set_ylim(0,35)
ax.set_xlim(0,1000)
text0 = ax.text(0,11,'JobName',clip_on=True,clip_box=rect[0].get_bbox())
ax.grid(True)
plt.show()
-- 
View this message in context: http://old.nabble.com/Clip-text-in-bars-tp28693489p28693489.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
Dear Friedrich,
sorry for the confusion.
It may very well be that I misinterpreted part of the problem as I am
no expert either.
The problem came to be as follows.
At first I used the binaries for the latest stable releases of Python
2.6 + numpy + matplotlib from the respected websites.
But in order to compile a custom library I needed Python to be compiled 64 bit.
This worked for Python, numpy and scipy but not for matplotlib.
I used to be able to compile matplotlib with a simple "sudo python
setup.py install" but when I tried to do this after the change to 64
bit the build failed with some errors which seemed to me to be related
to freetype not being compiled 64 bit (these errors, which I
unfortunately did not save clearly indicated that the linker could not
find some symbols and when I checked the architecture of the libs it
was i386 only).
I tried to fix this by first compiling freetype 64 bit, and later
libpng as well.
The problem now was that setupext.py did not look in the right
location for my new libpng build.
After I installed pkgtool this was also solved, however now the
reported error occurred.
I also could not use the make.osx script from the latest svn checkout
because of a bug in the fetching of zlib which John fixed.
Finally removing my custom installations of freetype and libpng and
using make.osx to fetch and build them solved the problem.
Oh and somewhere in all this mess I also managed to build it but then
got a malloc error when loading so I tried the removing of i386 but
this did not solve the problem so I changed it back.
I guess the conclusion is that the current svn works, but only with
the make.osx approach.
If I had the time I would try it again on a fresh install to see where
the bug is that prevents setup.py from working with a custom compiled
freetype and libpng but for now I am happy that it finally works :)
Kind regards,
Pim Schellart
2010年5月27日 Friedrich Romstedt <fri...@gm...>:
> 2010年5月27日 Pim Schellart <p.s...@gm...>:
>> thank you for the tip, I'll try and see if the stable release works as
>> well with this adjustment.
>> The problem however was not just in compiling on Snow Leopard, but
>> compiling specifically against a custom compiled 64 bit only version
>> of python.
>> This now works with the make.osx file and the latest svn release,
>> although I agree this is an ugly solution and would prefer the same
>> build system on every OS.
>
> Pim,
>
> I must confess that I'm lost a bit in all this details and all this
> patches ... I hope that I'm not alone with this ... Can you maybe give
> a short summary on the list?
>
> First I don't understand why you compiled a "64 bit only" version of
> your Python. I.e., what am I missing, when I compile my Python 2.6
> the usual way? (I also have a 64 bit machine.)
>
> Then, your first error seems to originate from:
>> src/ft2font.h:13:22: error: ft2build.h: No such file or directory
>
> I don't know, but I guess it's due to not finding the correct include
> directory for you self-compiled freetype2? If it is like this, I
> fixed it in setupext.py (the "darwin" section, not the "darwin_"
> section). The search path list is empty for "darwin", and I added
> "/usr/local" into it. Actually I don't remember precisely what the
> error was making me fixing this ... And it's true, I simply ignored
> the "# So I'm pointing to ..." comment in setupext.py ...
>
> Then the next error you reported was clearly related to libpng API
> change, so again nothing with 32/64 bit issues.
>
> So, I don't understand your conclusion that at all you have problems
> due to your 64bit-only built Python? Sorry, maybe I miss something
> obvious? I think people have been trusting you that it's a 64bit
> issue, and gave suggestions based on that, but maybe it isn't at all?
> Just a whacky thought! I simply cannot find an error pointing towards
> this root! I now went throught it again finally, and I found that
> magically John mentioned his "work for 64bit Python on the make.osx
> file", and then there was some "remove all -arch i386" recommendation,
> but it's all a bit unclear to me ... Sorry, I'm not an expert at all,
> my intention is just to track the problem /not to the false root/
> down.
>
> My explanation is: You downloaded by using make.osx an older version
> of libpng (1.2) and additionally a freetype version in local
> directory, so all the -Is are working respectively. This solved both
> your freetype problem and your libpng problem. I need some advice
> what else was solved by make.osx?
>
> Of course this path is good for creating binaries with libpng and
> freetype2 hardlinked, but I don't see the clue for your case.
>
> Friedrich
>
From: Friedrich R. <fri...@gm...> - 2010年05月27日 08:11:19
2010年5月25日 Pim Schellart <p.s...@gm...>:
> I tried both and although it now seems to find the libraries it still
> fails to link something.
>
> src/_png.cpp:293: error: ‘png_infopp_NULL’ was not declared in this scope
> src/_png.cpp:293: error: ‘png_infopp_NULL’ was not declared in this scope
I compiled matplotlib-0.99.1.2 just yesterday fine on Snow Leopard
from source without being aware of make.osx (with freetype2-2.3.12,
libpng-1.4.1). The problem I'm citing here, which seems to be
actually also your problem, is due to an API change in linbpng from
1.3 to 1.4. I soon ago pointed this out on the list but there were no
responses. One can add #defines for the missing things in
src/_png.cpp to fix it.
I don't know if you would run into some more problems but this one is solvable.
But I also modified setupext.py to find my libraries in /usr/local.
Friedrich
From: Michiel de H. <mjl...@ya...> - 2010年05月27日 00:10:04
We can actually check from Python whether it's a framework install or not.
>>> import MacOS
>>> MacOS.WMAvailable()
returns True if it's a framework install, False if not.
I can add this check to the MacOSX backend and print out a warning if it's not a framework install.
--Michiel
--- On Wed, 5/26/10, Daniel Welling <dan...@gm...> wrote:
From: Daniel Welling <dan...@gm...>
Subject: Re: [Matplotlib-users] Mac backend problems for nearly all backends.
To: "Michiel de Hoon" <mjl...@ya...>
Cc: mat...@li...
Date: Wednesday, May 26, 2010, 12:51 AM
2) In which case, it's not a framework install. Fink puts everything into /sw/; there's nothing to do with pyton in /Library/Frameworks.Thanks for the clarification; I'm tempted to get Python from source and try this...
-dw
On Tue, May 25, 2010 at 10:41 PM, Michiel de Hoon <mjl...@ya...> wrote:
> 1)The problem does manifest in the same manner through the normal python
 prompt.
OK that is good to know.
> 2) I'm not sure what is meant by a "framework install." Everything 
(except MPL 99.1.1)
> was installed through fink.
This is important. Check where python is installed. If 'which python' shows /Library/Frameworks/Python.framework/Versions/2.6/bin/python or something similar, you have a framework version. If on the other hand it shows /usr/bin/python, /usr/local/bin/python, or something similar, you don't have a framework version. I don't know what fink installs by default. If you don't have Python installed as a framework, some backends (including the MacOSX backend) will not interact properly with the window manager. This is a Mac peculiarity. If you build Python from source, you can specify to install a framework version by passing the --enable-framework option to the configure script.
> 6) Although I use x11 and not the native Mac terminal, I'm not sure if this requires me to > install different packages for the gui stuff. Could you guys expand on this, please?
Some backends go make use of X11 (e.g., the gtkcairo backend), others do not (e.g., the MacOSX backend). The MacOSX backend should work with both the native Mac terminal and with an X11 terminal.
--Michiel.
 
 
From: T J <tj...@gm...> - 2010年05月26日 23:55:59
On Wed, May 26, 2010 at 4:20 PM, Michael Droettboom <md...@st...> wrote:
> On 05/26/2010 04:47 PM, T J wrote:
>> When I plot, I get:
>>
>> UserWarning: findfont: Font family ['sans-serif'] not found. Falling
>> back to Bitstream Vera Sans
>>  (prop.get_family(), self.defaultFamily[fontext]))
>>
>> My matplotlibrc file has:
>>
>> font.sans-serif: Computer Modern Sans Serif
>> font.serif:   Computer Modern Roman
>> font.monospace: Computer Modern Typewriter
>>
>> Have I typed these names incorrectly? I recently (two days ago)
>> upgraded to the latest SVN of matplotlib and that is when the warning
>> started appearing. I have a working TeXLive distribution in linux, so
>> the fonts should exist on my computer.
>>
> The warning was recently introduced in SVN, but the behaviour shouldn't
> have changed -- it's just a little more "in your face" now that
> something may not be what you expect.
>
> TeXLive doesn't usually install Truetype versions of the Computer Modern
> fonts. You can use the Computer Modern Bakoma fonts that come with
> matplotlib by using "cmr10", "cmss10" etc. (see mpl-data/fonts/ttf for a
> list of the available ones), or for fonts that are a little more
> friendly and have standard unicode character points, you may want to
> install these:
>
> http://cm-unicode.sourceforge.net/
>
> Or, you can side-step all this and set the rcParam "text.usetex" to
> True, which will render all the text in the plot with TeX itself.
>
> Mike
>
Hmm...this is partly why I was confused in the first place. I
originally included the above lines in my matplotlibrc file because my
generated PDFs did not have all CM fonts, despite my text.usetex being
set to True.
 http://www.mail-archive.com/mat...@li.../msg09852.html
The recommendation there was that setting the various font.* rcParams
would fix this issue. And indeed, it did. After specifying the
fonts, my PDFs only included CM fonts.
Even now, my PDFs only contain CM fonts. So it seems that this is a
"useless" warning in the sense that findfont() is complaining about a
situation that won't manifest b/c text.usetex is True. Have I
understood this correctly?
From: Vincent D. <vi...@vi...> - 2010年05月26日 23:40:18
I am using the EPD and have have an issue with saving( I cant type in a name
for the file) Are you using the 64bit? I don't think wx runs in 64 bit and
so something else is used in the EPD 64 distro. Not really clear on this and
has been awhile since I looked at it.
On Tue, May 25, 2010 at 12:51 PM, Daniel Welling <dan...@gm...>wrote:
> $%$^&#!!! My sincere apologies, gmail sent before I was ready. To
> continue:
> GtkCairo: looks great, crashes ipython on resize.
>
> Wx: color issues, not stable.
> Qt: installs from fink, but won't load.
>
> In any case, it's not the Gtk/Qt/Wx problems that are important, it's the
> OSX backend issue. Others whom I work with do not have this issue, but
> installed using EPD.
> Has anyone else experienced such problems?
>
> Thanks for your help; let me know if there's more info I can provide.
>
> -dw
>
> On Tue, May 25, 2010 at 12:47 PM, Daniel Welling <dan...@gm...>wrote:
>
>> Greetings.
>>
>> I did quite a bit of digging on this and cannot find similar problems, but
>> if I did miss an earlier discussion, then I apologize.
>>
>> In any case, I have been having royal problems with GUI backends and
>> matplotlib.
>> Some background on where I've been having these problems:
>> Machine 1: OSX 10.5.8 G5 PPC
>> Machine 2: OSX 10.5.7 Macbook pro/Intel
>> Code versions: python 2.5.4, Numpy 1.3.0, Scipy 0.7.0 (all obtained
>> through fink.)
>> MPL versions: 99.0.1 and 99.1.1 (Older obtained through fink, newer
>> installed from source.)
>>
>> Here are the issues; behavior is consistent on both machines:
>>
>> MacOSX backend: Loads plots quickly, but when I try to save, I cannot type
>> in the file name area of the save file dialog. Furthermore, with ipython, I
>> can continue to use the ipython prompt up until the I shut the plot window.
>> ipython then freezes until I control-c it. This occurs in both versions.
>>
>> TkAgg backend: In 99.0.1, this works fine. However, it is slow, hence my
>> want for a different working backend. in 99.1.1, the plot window opens but
>> the picture is never drawn. After a moment, segfault back to the x11
>> prompt. Blerg.
>>
>> GtkAgg: Bad color (e.g. the background is pink rather than gray, color
>> tables are way goofed up. Writes to file fine.)
>>
>>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
 *Vincent Davis
720-301-3003 *
vi...@vi...
 my blog <http://vincentdavis.net> |
LinkedIn<http://www.linkedin.com/in/vincentdavis>
From: Michael D. <md...@st...> - 2010年05月26日 23:21:03
On 05/26/2010 04:47 PM, T J wrote:
> When I plot, I get:
>
> UserWarning: findfont: Font family ['sans-serif'] not found. Falling
> back to Bitstream Vera Sans
> (prop.get_family(), self.defaultFamily[fontext]))
>
> My matplotlibrc file has:
>
> font.sans-serif: Computer Modern Sans Serif
> font.serif: Computer Modern Roman
> font.monospace: Computer Modern Typewriter
>
> Have I typed these names incorrectly? I recently (two days ago)
> upgraded to the latest SVN of matplotlib and that is when the warning
> started appearing. I have a working TeXLive distribution in linux, so
> the fonts should exist on my computer.
> 
The warning was recently introduced in SVN, but the behaviour shouldn't 
have changed -- it's just a little more "in your face" now that 
something may not be what you expect.
TeXLive doesn't usually install Truetype versions of the Computer Modern 
fonts. You can use the Computer Modern Bakoma fonts that come with 
matplotlib by using "cmr10", "cmss10" etc. (see mpl-data/fonts/ttf for a 
list of the available ones), or for fonts that are a little more 
friendly and have standard unicode character points, you may want to 
install these:
http://cm-unicode.sourceforge.net/
Or, you can side-step all this and set the rcParam "text.usetex" to 
True, which will render all the text in the plot with TeX itself.
Mike
From: Eric F. <ef...@ha...> - 2010年05月26日 22:44:46
On 05/26/2010 12:31 PM, Jose Guzman wrote:
> Dear Matplotlib users,
>
> I need to plot a (time x distance) array of measurements associated with
> a color bar. Although time is fixed (i.e 0, 1, 2, etc..), to the number
> of rows, the distances are not evenly distributed (e.g are fixed to
> 1.22, 1.53, 1.84, 2,11.), although are always constant.
>
> My question is simple. How can I modify the 'extent ' argument so that I
> represent the real distance values, and not simply evenly distributed
> events?
It sounds like you need to use the NonUniformImage:
http://matplotlib.sourceforge.net/examples/pylab_examples/image_nonuniform.html
Eric
>
> Any suggestion or comment would be greatly appreciated!
>
> A minimal example plot is given bellow:
>
> Thanks a lot in advance
>
> Jose.
>
> #=================================
> import matplotlib.pyplot as plt
> import numpy as np
>
> # fake data
> random = np.random.randint(0, 300, size=(55,127)
>
> fig = plt.figure()
> ax = fig.add_subplot(111)
>
> myaspect = 100.0
>
> # How can adjust this data to my REAL distances
> # (e.g 1.22, 1.53, 1.84, 2,01) ???.
> myextent=[-400,800,0,10]
>
> cax = ax.imshow(random, aspect = myaspect, extent=myextent, vmin=0,
> vmax=300)
> ax.set_ylabel('Time (ms)')
> ax.set_xlabel('Distance (mm)')
>
> colorbar = fig.colorbar(cax, ticks=[0,100,200,300,400])
> colorbar.ax.set_yticklabels(['0','100','200','300','400'])
> colorbar.ax.set_ylabel('Measurement')
>
> plt.show()
>
> #=================================
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jose G. <sjm...@go...> - 2010年05月26日 22:31:28
Dear Matplotlib users,
I need to plot a (time x distance) array of measurements associated with 
a color bar. Although time is fixed (i.e 0, 1, 2, etc..), to the number 
of rows, the distances are not evenly distributed (e.g are fixed to 
1.22, 1.53, 1.84, 2,11.), although are always constant.
My question is simple. How can I modify the 'extent ' argument so that I 
represent the real distance values, and not simply evenly distributed 
events?
Any suggestion or comment would be greatly appreciated!
A minimal example plot is given bellow:
Thanks a lot in advance
Jose.
#=================================
import matplotlib.pyplot as plt
import numpy as np
# fake data
random = np.random.randint(0, 300, size=(55,127)
fig = plt.figure()
ax = fig.add_subplot(111)
myaspect = 100.0
# How can adjust this data to my REAL distances
# (e.g 1.22, 1.53, 1.84, 2,01) ???.
myextent=[-400,800,0,10]
cax = ax.imshow(random, aspect = myaspect, extent=myextent, vmin=0, 
vmax=300)
ax.set_ylabel('Time (ms)')
ax.set_xlabel('Distance (mm)')
colorbar = fig.colorbar(cax, ticks=[0,100,200,300,400])
colorbar.ax.set_yticklabels(['0','100','200','300','400'])
colorbar.ax.set_ylabel('Measurement')
plt.show()
#=================================
From: Ted R. <ted...@ya...> - 2010年05月26日 21:36:56
Jonn-- Thanks very much. Customizing the backend to TkAgg solved the
problem.
Chloe--thanks for your advice as well!
On Wed, May 26, 2010 at 3:21 PM, John Hunter <jd...@gm...> wrote:
> On Tue, May 25, 2010 at 10:40 PM, Ted Rosenbaum <ted...@ya...>
> wrote:
> > Hi,
> > I am a real newbie at matplotlib, so I apologize if this is an obvious
> > question.
> > I am running ipython in emacs and while the first time I use the show()
> > command in the ipython buffer the graph shows up fine, subsequent times
> that
> > I call the command it, the graph does not show up. I am on ubuntu 10.04
> > (64) and I built the matplotlib library from source.
> > I am trying to get the graphs to show up the subsequent times as well
> (sorry
> > for the pun).
> > Thanks for any help.
>
> Take a look at
>
> http://matplotlib.sourceforge.net/users/shell.html
>
> It may help to configure your matplotlib backend to TkAgg. See
>
>
> http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
> http://matplotlib.sourceforge.net/users/customizing.html
>
> Also, you will probably want to figure out how to make emacs launch
> ipython in pylab mode, in which case you won't need show at all.
> ipython will take care of everything for you in pylab mode.
>
> JDH
>
From: T J <tj...@gm...> - 2010年05月26日 20:47:23
When I plot, I get:
UserWarning: findfont: Font family ['sans-serif'] not found. Falling
back to Bitstream Vera Sans
 (prop.get_family(), self.defaultFamily[fontext]))
My matplotlibrc file has:
font.sans-serif: Computer Modern Sans Serif
font.serif: Computer Modern Roman
font.monospace: Computer Modern Typewriter
Have I typed these names incorrectly? I recently (two days ago)
upgraded to the latest SVN of matplotlib and that is when the warning
started appearing. I have a working TeXLive distribution in linux, so
the fonts should exist on my computer.
From: John H. <jd...@gm...> - 2010年05月26日 19:26:44
On Tue, May 25, 2010 at 10:40 PM, Ted Rosenbaum <ted...@ya...> wrote:
> Hi,
> I am a real newbie at matplotlib, so I apologize if this is an obvious
> question.
> I am running ipython in emacs and while the first time I use the show()
> command in the ipython buffer the graph shows up fine, subsequent times that
> I call the command it, the graph does not show up. I am on ubuntu 10.04
> (64) and I built the matplotlib library from source.
> I am trying to get the graphs to show up the subsequent times as well (sorry
> for the pun).
> Thanks for any help.
Take a look at
 http://matplotlib.sourceforge.net/users/shell.html
It may help to configure your matplotlib backend to TkAgg. See
 http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
 http://matplotlib.sourceforge.net/users/customizing.html
Also, you will probably want to figure out how to make emacs launch
ipython in pylab mode, in which case you won't need show at all.
ipython will take care of everything for you in pylab mode.
JDH
From: Jose Gomez-D. <jgo...@gm...> - 2010年05月26日 18:39:25
On 26 May 2010 17:20, Carlos Grohmann <car...@gm...> wrote:
> I can interpolate my data using rbf, but only inside a rectangular
> area (mesh). I'm looking into how to interpolate data inside a
> circular area, that is, disregarding anything outside a circle (or a
> polygon, like a convex hull)
>
If you can define your polygon/circle, you can filter your points and select
only those within the boundary. You can do this with pnpoly if you have
matplotlib (see this: <
http://matplotlib.sourceforge.net/faq/howto_faq.html#test-whether-a-point-is-inside-a-polygon>).
You can then interpolate your points, into a regular grid, and discard the
gridcell values outside your region of interest.
J
From: Ryan M. <rm...@gm...> - 2010年05月26日 18:15:16
Hi,
This was pointed out to me by David W-F on twitter: PIL and imread()
return images that are not consistent, but rather one is upside down
from the other. This is shown by the following code:
import PIL.Image
import matplotlib.pyplot as plt
plt.subplot(2, 2, 1)
plt.imshow(PIL.Image.open('Z.png'))
plt.title('PIL')
plt.subplot(2, 2, 2)
plt.imshow(plt.imread('Z.png'))
plt.title('imread (MPL for PNG)')
plt.subplot(2, 2, 3)
plt.imshow(PIL.Image.open('Andy_font.JPG'))
plt.title('PIL')
plt.subplot(2, 2, 4)
plt.imshow(plt.imread('Andy_font.JPG'))
plt.title('imread (PIL for JPEG)')
plt.show()
output.png contains the result of the script, where only one of the
images is rotated relative to the rest. While I'm quite willing to
accept the possibility that this is PIL weirdness and not MPL (or
maybe not), we still have the problem that
the proper way to display the output of imread depends on the format
of the image, since imread() falls back to PIL for anything but PNG.
Thoughts?
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Chloe L. <ch...@be...> - 2010年05月26日 18:07:37
My near-newbie suspicion is that you're using more tools than you need 
and having them interfere with each other. The show() command 
generally doesn't return control to whatever called it until you've 
closed the shown window (http://bytes.com/topic/python/answers/635142-matplotlib-basic-question 
).
if running ipython -pylab from a terminal, successive plot commands 
display a window with the successively plotted lines in it;
if I start the python interpreter from an emacs file in Python-mode, 
and import pylab, and plot() twice, I also get a single figure window 
with the successively plotted lines in it -- *until* I switch focus to 
the figure window, after which calling plot() from the interpreter 
doesn't do anything to the figure until I close the first figure. 
(This does seem buggy, or at least suboptimal. I'm using Aquamacs on 
OS X, don't know if the same interpreter would be called on ubuntu.)
Practically speaking, I use the interpreter to check tiny bits of 
syntax, ipython to noodle around with more complicated syntax or 
reasoning, and M-! from emacs to execute a whole .py file that I know 
is mostly right. I hardly ever use show() at all, but rather 
savefig(), with a file-directory window showing me the results as I go.
If that doesn't work for you, the experts probably need a more precise 
bug report to figure out what would.
Chloe Lewis
Grad student, ESPM, UC Berkeley
On May 25, 2010, at 8:40 PM, Ted Rosenbaum wrote:
> Hi,
> I am a real newbie at matplotlib, so I apologize if this is an 
> obvious question.
> I am running ipython in emacs and while the first time I use the 
> show() command in the ipython buffer the graph shows up fine, 
> subsequent times that I call the command it, the graph does not show 
> up. I am on ubuntu 10.04 (64) and I built the matplotlib library 
> from source.
> I am trying to get the graphs to show up the subsequent times as 
> well (sorry for the pun).
> Thanks for any help.
>
> ----------------------------------------
> Ted Rosenbaum
> Graduate Student
> Department of Economics
> Yale University
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jae-Joon L. <lee...@gm...> - 2010年05月26日 18:03:50
On Mon, May 24, 2010 at 10:04 AM, Fredrik Pihl <pi....@gm...> wrote:
> some googling gives this thread:
> http://www.mail-archive.com/mat...@li.../msg16191.html
>
> but that doesn't solve the problem, just makes it different...
Different, but much easier to solve.
Unfortunately, Matplotlib does not provide any solution for now.
If you're familiar with Python and matplotlib, you may try to code it
by yourself. Otherwise, it may better find other library that does
this for you.
Regards,
-JJ
From: Mathew Y. <mat...@gm...> - 2010年05月26日 18:01:58
Hi
This probably belongs in Proj mailing list, but .....
I want to specify a line/sample horizontal/vertical tile in a 1 Km
resolution sinusoidal projection and get back a lat/lon.
Anyone know how to do this?
Mathew
From: Christopher B. <Chr...@no...> - 2010年05月26日 17:39:28
Daniel Welling wrote:
> A quick update on Mac backends:
> While I don't want to drag this thread on forever, I feel like some of 
> this info is useful for the Mac/MPL community. I would love to hear 
> from anyone else who has the OSX backend problem; it seems to be 
> isolated to Fink. 
I'm still a bit confused -- are you having MPL problems or GUI toolkit 
problems? i.e. do wx, gtk, qt, etc work just fine for non-MPL 
applications. If so then there is an MPL issue which it would be nice to 
resolve. If not, then you have GUI toolkit issues, which should be 
addressed by the fink and/or GUI toolkit developers.
-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: Carlos G. <car...@gm...> - 2010年05月26日 16:21:33
Thanks Fabrice.
I can interpolate my data using rbf, but only inside a rectangular
area (mesh). I'm looking into how to interpolate data inside a
circular area, that is, disregarding anything outside a circle (or a
polygon, like a convex hull)
tks
Carlos
On Wed, May 26, 2010 at 09:29, Fabrice Silva <si...@lm...> wrote:
> Le mardi 25 mai 2010 à 21:47 -0300, Carlos Grohmann a écrit :
>> Dears, I want to interpolate some irregular data using radial basis.
>> Can I interpolate only the data that falls inside a circle (or a
>> polygon)?
>
> May these pages help you?
> http://www.scipy.org/Cookbook/RadialBasisFunctions
> http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.Rbf.html
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
Linux User #89721
________________
Can’t stop the signal.
From: Daniel W. <dan...@gm...> - 2010年05月26日 16:14:46
A quick update on Mac backends:
1) Two others in my office use macports, python 2.6, mpl 99.1, and
snowleopard. They have none of the issues I have with the GUI stuff. Most
notably, their MacOSX backends work properly in both X11 and native Mac
terminal.
2) I cannot follow up on WxPython or Qt4 for my PPC machine; installs failed
for both. I'm working on it some more but have limited time to play around.
3) A recompile of python through fink using updated gcc/g++ (from 4.0 to
4.2) had no effect.
While I don't want to drag this thread on forever, I feel like some of this
info is useful for the Mac/MPL community. I would love to hear from anyone
else who has the OSX backend problem; it seems to be isolated to Fink.
It seems like the bottom line is that depending on your install, some
experimentation is required to determine which GUI backends work well or at
all.
On Tue, May 25, 2010 at 10:51 PM, Daniel Welling <dan...@gm...>wrote:
> 2) In which case, it's not a framework install. Fink puts everything into
> /sw/; there's nothing to do with pyton in /Library/Frameworks.
> Thanks for the clarification; I'm tempted to get Python from source and try
> this...
>
> -dw
>
> On Tue, May 25, 2010 at 10:41 PM, Michiel de Hoon <mjl...@ya...>wrote:
>
>>
>> > 1)The problem does manifest in the same manner through the normal python
>> prompt.
>>
>> OK that is good to know.
>>
>>
>> > 2) I'm not sure what is meant by a "framework install." Everything
>> (except MPL 99.1.1)
>> > was installed through fink.
>>
>> This is important. Check where python is installed. If 'which python'
>> shows /Library/Frameworks/Python.framework/Versions/2.6/bin/python or
>> something similar, you have a framework version. If on the other hand it
>> shows /usr/bin/python, /usr/local/bin/python, or something similar, you
>> don't have a framework version. I don't know what fink installs by default.
>> If you don't have Python installed as a framework, some backends (including
>> the MacOSX backend) will not interact properly with the window manager. This
>> is a Mac peculiarity. If you build Python from source, you can specify to
>> install a framework version by passing the --enable-framework option to the
>> configure script.
>>
>>
>> > 6) Although I use x11 and not the native Mac terminal, I'm not sure if
>> this requires me to > install different packages for the gui stuff. Could
>> you guys expand on this, please?
>>
>> Some backends go make use of X11 (e.g., the gtkcairo backend), others do
>> not (e.g., the MacOSX backend). The MacOSX backend should work with both the
>> native Mac terminal and with an X11 terminal.
>>
>> --Michiel.
>>
>>
>
9 messages has been excluded from this view by a project administrator.

Showing results of 303

<< < 1 2 3 4 .. 13 > >> (Page 2 of 13)
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 によって変換されたページ (->オリジナル) /