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





Showing 24 results of 24

From: <jas...@cr...> - 2009年08月20日 23:58:34
Justin Findlay wrote:
> I'm trying to find a way to embed matplotlib graphs in LaTeX
> documents. Ideally a solution would involve converting MPL's output
> to TikZ in order to get native rendering of the graphics and text.
> This seems like the "Right Way" to go, unfortunately, my classes start
> on Monday, and I'm neither python nor TeX guru enough to begin a
> project so ambitious and important. This is what I have done so far,
> benevolent user that I am,
>
> https://sourceforge.net/tracker/?func=detail&aid=2841217&group_id=80706&atid=560723
>
> If anyone has more information on this or code to this effect I would
> be very interested in learning/contributing.
> 
Last year I spent an evening trying to modify the ps or pdf backends to 
be a PGF/TIKZ backend. I wasn't very successful, but I was also trying 
to learn the system too. It seems like it would be easy to implement 
the few primitives in PGF instead of postscript, since the models are 
pretty similar, from what I recall. I haven't spent the time to revisit 
it, though, and it probably won't make it back to the top of my list for 
a while.
For those trying to pursue this, the PGF documentation is handy: 
http://www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf 
See p. 439 and p. 461 for commands for drawing paths with the "basic" 
layer, for example.
Jason
-- 
Jason Grout
From: Justin F. <jfi...@gm...> - 2009年08月20日 22:36:31
On Thu, Aug 20, 2009 at 3:56 PM, John Hunter<jd...@gm...> wrote:
> What's wrong with including the ps/eps output in your latex docs, or
> the pdf output for your pdflatex docs? That's what most people do.
> You can enable the "usetex" option if you want tex to render the text
The difference is subtle. By having the graphics and text rendered by
the different system they will end up having a different 'look'. I
know that usetex solves most of the text-in-graphics issues, and that
TeX wasn't even designed to really layout anything but text and the
most minimal vector graphics, but TikZ is more than adequate for plots
and stands on its own merit as a fully-featured graphics language.
TeX+TikZ finally eliminates the need for external vector hackery. Of
course, I'll probably just use pdf and usetex as you suggest, but I
was hoping for something better.
Justin
(stupid gmail reply to defaults)
From: John H. <jd...@gm...> - 2009年08月20日 21:56:24
On Thu, Aug 20, 2009 at 4:08 PM, Justin Findlay<jfi...@gm...> wrote:
> I'm trying to find a way to embed matplotlib graphs in LaTeX
> documents. Ideally a solution would involve converting MPL's output
> to TikZ in order to get native rendering of the graphics and text.
> This seems like the "Right Way" to go, unfortunately, my classes start
> on Monday, and I'm neither python nor TeX guru enough to begin a
> project so ambitious and important. This is what I have done so far,
> benevolent user that I am,
What's wrong with including the ps/eps output in your latex docs, or
the pdf output for your pdflatex docs? That's what most people do.
You can enable the "usetex" option if you want tex to render the text
http://matplotlib.sourceforge.net/users/usetex.html
JDH
From: Justin F. <jfi...@gm...> - 2009年08月20日 21:08:29
I'm trying to find a way to embed matplotlib graphs in LaTeX
documents. Ideally a solution would involve converting MPL's output
to TikZ in order to get native rendering of the graphics and text.
This seems like the "Right Way" to go, unfortunately, my classes start
on Monday, and I'm neither python nor TeX guru enough to begin a
project so ambitious and important. This is what I have done so far,
benevolent user that I am,
https://sourceforge.net/tracker/?func=detail&aid=2841217&group_id=80706&atid=560723
If anyone has more information on this or code to this effect I would
be very interested in learning/contributing.
Justin
From: Daniel P. <mai...@go...> - 2009年08月20日 19:19:03
The setting of the new ticklabels works now. But the first label is 
attached to the second tick. I tried to adapt the clim range by using 
the vmin and vmax option of pcolor but it did not help.
I also still have the problem that the changes are only performed on the 
last two subplots (in one loop run). The code of the plotting loop is:
for i in range(len(fname)):
 # Load data from file
 data1_amp = np.loadtxt(fname[4*i])
 data1_phase = np.loadtxt(fname[4*i+1])
 data2_amp = np.loadtxt(fname[4*i+2])
 data2_phase = np.loadtxt(fname[4*i+3])
 # Display data using pcolor
 ax1 = fig1.add_subplot(len(fname)/4,4,4*i+1)
 pc1 = ax1.pcolorfast(data1_amp,cmap=mpl.cm.Oranges)
 ax1.set_xlim((0,250))
 ax1.set_ylim((0,256))
 ax1.set_xticklabels('')
 ax1.set_yticklabels('')
 cb1 = fig1.colorbar(pc1,ax=ax1,orientation='horizontal',pad=0.00)
 cb1.ax.set_xticklabels(range(5),fontsize=10)
 ax2 = fig1.add_subplot(len(fname)/4,4,4*i+2)
 pc2 = ax2.pcolorfast(data1_phase,cmap=nat_per)
 ax2.set_xlim((0,250))
 ax2.set_ylim((0,256))
 ax2.set_xticklabels('')
 ax2.set_yticklabels('')
 cb2 = fig1.colorbar(pc2,ax=ax2,orientation='horizontal',pad=0.00, 
 ticks=[-np.pi,-np.pi/2,0,np.pi/2,np.pi])
 cb2.ax.set_xticklabels(range(5),fontsize=10)
 ax3 = fig1.add_subplot(len(fname)/4,4,4*i+3)
 pc3 = ax3.pcolorfast(data2_amp,cmap=mpl.cm.Oranges)
 ax3.set_xlim((0,250))
 ax3.set_ylim((0,256))
 ax3.set_xticklabels('')
 ax3.set_yticklabels('')
 cb3 = fig1.colorbar(pc1,ax=ax3,orientation='horizontal',pad=0.00)
 cb3.ax.set_xticklabels(range(5),fontsize=10)
 ax4 = fig1.add_subplot(len(fname)/4,4,4*i+4)
 pc4 = 
ax4.pcolorfast(data2_phase,cmap=nat_per,vmin=-np.pi-0.1,vmax=np.pi+0.001)
 ax4.set_xlim((0,250))
 ax4.set_ylim((0,256))
 ax4.set_xticklabels('')
 ax4.set_yticklabels('')
 cb4 = fig1.colorbar(pc2,ax=ax4,orientation='horizontal',pad=0.00, 
ticks=[-np.pi, -np.pi/2, 0.0, np.pi/2, np.pi])
 cb4.ax.set_xticklabels([r'$-\pi$', r'$-\frac{\pi}{2}$', r'0ドル$', 
r'$\frac{\pi}{2}$', r'$\pi$'],fontsize=10)
Daniel
Jouni K. Seppänen wrote:
> Daniel Platz <mai...@go...> writes:
> 
>> t = cb4.ax.get_xticklabels()
>> for j in t:
>> j.set_text(r'$\pi$')
>> j.set_fontsize(10)
>> j.set_family('serif')
> 
> Try cb4.ax.set_xticklabels([r'$-\pi$', ...]); draw()
> 
>> Another problem is that I want to adjust the fontsize of the colorbar 
>> ticklabels on four subplots. This only works for the last two subplots 
>> with the syntax shown above. The same syntax has no effect on the first 
>> two subplots.
> 
> You should be able to pass font properties to set_xticklabels. If that
> doesn't work, please post a complete example.
> 
From: Dylan W. <dt...@ny...> - 2009年08月20日 18:37:26
Hey everyone,
 
I cannot seem to get pylab to display a plot using WXAgg. For some reason,
the datapath that I set in my matplotlibrc and confirmed by checking
rcParams['datapath'] is not being passed correctly to wx. Instead, it
attempts to find the data (button images like subplots.png, etc.) in the
directory from which I called my IDE (Stani's Python Editor), which does
have an ' ./images/' subdirectory if that is at all relevant? Any ideas? I
tried searching the mailing list archives (is there a good way to actually
_search them_ ??), but couldn't find anyone with the same problem. 
 
 
Dylan Walker
 
From: Jouni K. S. <jk...@ik...> - 2009年08月20日 18:31:21
Daniel Platz <mai...@go...> writes:
> t = cb4.ax.get_xticklabels()
> for j in t:
> j.set_text(r'$\pi$')
> j.set_fontsize(10)
> j.set_family('serif')
Try cb4.ax.set_xticklabels([r'$-\pi$', ...]); draw()
> Another problem is that I want to adjust the fontsize of the colorbar 
> ticklabels on four subplots. This only works for the last two subplots 
> with the syntax shown above. The same syntax has no effect on the first 
> two subplots.
You should be able to pass font properties to set_xticklabels. If that
doesn't work, please post a complete example.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Daniel P. <mai...@go...> - 2009年08月20日 18:11:09
Hello,
I would like to have some custom ticklabels on a colorbar. In detail, I 
want the four labels '-\pi', -\pi/2', '0', \pi/2', \pi'. I tried to set 
manually each text object obtained from cb.ax.get_xticklabels():
t = cb4.ax.get_xticklabels()
 for j in t:
 j.set_text(r'$\pi$')
 j.set_fontsize(10)
 j.set_family('serif')
However, no matter what I set for text, it has no effect on the 
displayed figure.
Another problem is that I want to adjust the fontsize of the colorbar 
ticklabels on four subplots. This only works for the last two subplots 
with the syntax shown above. The same syntax has no effect on the first 
two subplots.
If anybody has some ideas I would be really gald about an answer.
Thanks in advance
Daniel
From: Ryan M. <rm...@gm...> - 2009年08月20日 16:39:05
On Thu, Aug 20, 2009 at 11:00 AM, DEMOLISHOR! the Demolishor <
des...@gm...> wrote:
> Hello all,
> I suppose this is a newbie question, but why do I get these three
> horizontal grid lines when I add text to my plot? I've tried repeating the
> call to pyplot.grid() but that doesn't affect anything...
>
> #!/usr/bin/env python
>
> from matplotlib import pyplot
> from scipy import randn
>
> mu, sigma = 200, 25
> x = mu + sigma*randn(10000)
>
> pyplot.grid(False)
> n, bins, patches = pyplot.hist(x, 50, normed=1, histtype='stepfilled')
>
> xlim_right = pyplot.xlim()[1]
> ylim_top = pyplot.ylim()[1]
>
> pyplot.text(xlim_right*0.8, ylim_top*0.9, 'Fit Parameters:', weight='bold',
> size='large')
>
> pyplot.show()
>
> #end script
>
> My matplotlib version is:
>
> [craigb@fsul1 matplotlib]$ python
> Python 2.6.2 (r262:71600, Jul 28 2009, 10:47:31)
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import matplotlib
> >>> matplotlib.__version__
> '0.98.5.2'
> >>>
I can't reproduce this with SVN head here. I don't see anything in your
script that should cause this. Can you upgrade to the latest release, 0.99?
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Pasadena, California, United States
From: M. H. <mhe...@in...> - 2009年08月20日 15:45:01
Hi,
ok meanwhile I found out that this is a typical beginners error, sorry.
Nevertheless, using ion(), and ioff() together with draw() works fine.
What I didn't find out up to now was the funtion
 ginput(n=1, timeout=30, show_clicks=True)
which prevents me from killing the window after every plot, so
thank you John Hunter-4. Before it was even not possible to 
move the focus to another window without crashing the application.
Now all behaves as "expected".
Thank you again.
John Hunter-4 wrote:
> 
> On Tue, Aug 18, 2009 at 3:55 AM, M. Hecht<mhe...@in...>
> wrote:
>> The first figure is drawn without problems but after closing it (by
>> clicking
>> the cross in the upper
>> right corner of the window) the second figure cannot be plot anymore.
>> What I
>> wanted to do was
>> to visualize all selected files of a directory one after the other. To do
>> this I want to close the old
>> figure and then the new figure should com up as long as there is a file
>> to
>> visualize left. Unfortunaltely
>> only the first figure is shown as in the simple example.
>> So, what's wrong
> 
> We don't really have support for blocking input where a program is
> halted until you close the open figure, and then the next one loads.
> You could write something using event handling, where on a key press
> event the next figure was loaded. You may also be able to use ginput
> here, which will give you a blocking input function.
> 
> See
> 
> http://matplotlib.sourceforge.net/users/shell.html
> 
> http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.ginput
> 
> http://matplotlib.sourceforge.net/users/event_handling.html
> 
> http://matplotlib.sourceforge.net/examples/pylab_examples/ginput_demo.html
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day 
> trial. Simplify your report design, integration and deployment - and focus
> on 
> what you do best, core application coding. Discover what's new with 
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/plot-multiple-times-in-one-script-fails-tp25020909p25064644.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2009年08月20日 15:04:56
On Thu, Aug 20, 2009 at 9:56 AM, George Nurser<gn...@go...> wrote:
> Michiel,
> I'm on Mac OS X 10.5. My version of Python is 2.5.2, also from python.org.
> Presumably the new matplotlib does compile with 2.6.2 on 10.5?
It does -- I compiled the mpl OSX binaries using python 2.6.2 (from
src) from python.org on 10.5.6 with gcc 4.0.1
From: George N. <gn...@go...> - 2009年08月20日 14:57:08
Michiel,
I'm on Mac OS X 10.5. My version of Python is 2.5.2, also from python.org.
Presumably the new matplotlib does compile with 2.6.2 on 10.5?
I'm a bit reluctant to install 2.6.2 now, since we'll be moving to
10.6 ASAP here for the Exchange compatibility, and I guess I'll be
want to reinstall all the python packages in i386/x86_64 architecture
rather than i386/ppc for 10.6.
--George Nurser.
2009年8月20日 Michiel de Hoon <mjl...@ya...>:
> Are you on Mac OS X 10.5 or are you on an earlier version? The error message you're seeing indicates that MAC_OS_X_VERSION_10_5 is defined, suggesting that you are on Mac OS X 10.5. But then it should be aware of CTFontRef ... Did you change anything in your Python setup?
>
> --Michiel.
>
> --- On Wed, 8/19/09, George Nurser <gn...@go...> wrote:
>
>> From: George Nurser <gn...@go...>
>> Subject: [Matplotlib-users] mac os backend not building
>> To: Mat...@li...
>> Date: Wednesday, August 19, 2009, 12:23 PM
>> Hi,
>> I updated matplotlib to svn r 7506, but it won't build. I
>> am having
>> problems with the mac os backend:
>>
>> 10.5.8, gcc 4.0.1:
>> python setup.py build install run from the
>> matplotlib/matplotlib
>> directory gives:
>> .....
>> building 'matplotlib.backends._macosx' extension
>> gcc -arch ppc -arch i386 -isysroot
>> /Developer/SDKs/MacOSX10.4u.sdk
>> -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
>> -mno-fused-madd
>> -fno-common -dynamic -DNDEBUG -g -O3
>> -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I/usr/X11R6/include
>> -I/usr/X11/include -I.
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
>> -Isrc -Iagg24/include -I.
>> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
>> -c src/_macosx.m -o
>> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
>> src/_macosx.m:1885: error: syntax error before
>> ‘setfont’
>> src/_macosx.m:1885: error: syntax error before
>> ‘setfont’
>> src/_macosx.m: In function ‘setfont’:src/_macosx.m: In
>> function ‘setfont’:
>> src/_macosx.m:1895: error: ‘CTFontRef’ undeclared
>> (first use in this function)
>>
>> Possibly some confusion about whether MAC_OS_X_VERSION_10_5
>> is defined??
>>
>> --George Nurser.
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal
>> Reports 2008 30-Day
>> trial. Simplify your report design, integration and
>> deployment - and focus on
>> what you do best, core application coding. Discover what's
>> new with
>> Crystal Reports now. http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
>
>
From: Jouni K. S. <jk...@ik...> - 2009年08月20日 14:35:14
Michael Fitzgerald <ast...@gm...> writes:
> Can anyone confirm this bug? I have added it to the sourceforge
> tracker, ID 2832896.
> https://sourceforge.net/tracker/?func=detail&aid=2832896&group_id=80706&atid=560720
I can see it but haven't been able to make time to investigate yet.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Jouni K. S. <jk...@ik...> - 2009年08月20日 14:32:06
Michiel de Hoon <mjl...@ya...> writes:
> Are you on Mac OS X 10.5 or are you on an earlier version? The error
> message you're seeing indicates that MAC_OS_X_VERSION_10_5 is defined,
> suggesting that you are on Mac OS X 10.5. But then it should be aware
> of CTFontRef ... Did you change anything in your Python setup?
I get the same error on OS X 10.5.8, gcc 4.0.1, Python 2.5.4 downloaded
from python.org. The failing command is:
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/_macosx.m -o build/temp.macosx-10.3-i386-2.5/src/_macosx.o
Note the MacOSX10.4u.sdk in the isysroot and macosx-10.3 in the name of
the build directory. I suspect that this build of Python has been
compiled with some kind of compatibility settings to be usable on
earlier versions of the OS. Simply replacing 10.4 by 10.5 in the
isysroot option causes worse errors:
src/_macosx.m:1:25: error: Cocoa/Cocoa.h: No such file or directory
src/_macosx.m:2:53: error: ApplicationServices/ApplicationServices.h: No such file or directory
Can you suggest something further to try?
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Kim, Dae-W. <dw...@gm...> - 2009年08月20日 14:26:54
I tested with TKAgg and WXAgg. I just bought macbook and I'm newbie yet. Do
I need to set something special for the multiple show()s?
Thanks,
-Dae-Won
On Thu, Aug 20, 2009 at 10:01 AM, Michiel de Hoon <mjl...@ya...>wrote:
> Whether or not you can do multiple show()s depends on which backend you
> use. For example, the Mac OS X native backend has no problems with the
> multiple show()s in your example. Which backend were you using? While
> matplotlib does not support multiple show()s in general, there may be a
> simple solution to get that working for the backend you are using.
>
> --Michiel.
>
> --- On Wed, 8/19/09, Kim, Dae-Won <dw...@gm...> wrote:
>
> > From: Kim, Dae-Won <dw...@gm...>
> > Subject: Re: [Matplotlib-users] show() problem in Mac OS X 10.5.8
> > To: "Ryan May" <rm...@gm...>
> > Cc: mat...@li...
> > Date: Wednesday, August 19, 2009, 2:48 PM
> >
> > The one 'preliminary' solution I found is using
> > an interactive mode + raw_input.
> > Here is and example,
> >
> > ion()
> > plot([1,2,3,4,5])
> > raw_input('Type Enter')
> > clf()
> >
> >
> > plot([1,2,3,4,5])
> > raw_input('Type_Enter')
> > clf()
> > plot([1,2,3,4,5])
> > show()
> >
> > With this approach, I can press the enter when I want to
> > see next figure.
> >
> >
> >
> > Though It's not as convenient as 'multiple
> > show()'..
> >
> >
> > On Wed, Aug 19, 2009 at 1:57 PM,
> > Kim, Dae-Won <dw...@gm...>
> > wrote:
> >
> >
> >
> >
> > On Wed, Aug 19, 2009 at 1:02 PM,
> > Ryan May <rm...@gm...>
> > wrote:
> >
> >
> >
> > On Wed, Aug 19, 2009 at 11:55
> > AM, coati <dw...@gm...>
> > wrote:
> >
> >
> >
> >
> >
> >
> >
> > I have a problem with show() command in my macbook
> > machine (Leopard 10.5.8).
> >
> > For example, if I run the script shown below
> >
> > (let assume it is saved as 'test.py', and I run a
> > command 'python test.py'),
> >
> >
> >
> > ---------------------------------------
> >
> >
> >
> > plot([1,2,3,4,5])
> >
> > show() #first window
> >
> > plot([1,2,3,4,5])
> >
> > show() #second window
> >
> > plot([1,2,3,4,5])
> >
> > show() #third window
> >
> >
> >
> > ---------------------------------------
> >
> >
> >
> > Then the first window just pops up and I can see a
> > beautiful straight line
> >
> > :) No problem so far.
> >
> > But, after I close the first window by clicking the close
> > button of the
> >
> > window,
> >
> > other two window (second and third) just pops up and close
> > themselves
> >
> > instantly
> >
> > even though I didn't click the close button...
> >
> > Also, the second and third plot is shown in the same
> > window.
> >
> >
> >
> > I don't have such problem in my Ubuntu machine..
> >
> >
> >
> > Does anybody know reasons?
> > show() actually handles starting the GUI mainloop, so you
> > really shouldn't be calling it more than once from a
> > script. Quite frankly, it's more amazing that it works
> > on your Ubuntu macine. :) If you're wanting 3 separate
> > windows, try:
> >
> >
> >
> >
> >
> >
> > plot([1,2,3,4,5])
> > figure()
> > plot([1,2,3,4,5])
> > figure()
> > plot([1,2,3,4,5])
> > show()
> >
> > Ryan
> >
> > --
> > Ryan May
> >
> > Graduate Research Assistant
> > School of Meteorology
> > University of Oklahoma
> >
> >
> >
> >
> >
> > Thanks Ryan,
> >
> > Hm.. it's a bit strange.. I just installed matplotlib
> > at Ubuntu using the package manager :)
> > And, another linux machines (red hat enterprise) can do
> > this too. For the RHELs, I compiled matplotlib source code
> > by myself.
> >
> >
> >
> >
> >
> > figure() works very well, but what I want to do is to check
> > the plots one by one and thus
> > I can exit the script at any time I want (because I usually
> > have lots of figures to check and I don't want
> > to pop up every of them at the same time..)
> >
> >
> >
> >
> >
> > Anyway, thank you very much!
> >
> >
> >
> >
> >
> >
> >
> > -----Inline Attachment Follows-----
> >
> >
> ------------------------------------------------------------------------------
> > Let Crystal Reports handle the reporting - Free Crystal
> > Reports 2008 30-Day
> > trial. Simplify your report design, integration and
> > deployment - and focus on
> > what you do best, core application coding. Discover what's
> > new with
> > Crystal Reports now. http://p.sf.net/sfu/bobj-july
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
>
>
>
From: Michiel de H. <mjl...@ya...> - 2009年08月20日 14:05:25
Are you on Mac OS X 10.5 or are you on an earlier version? The error message you're seeing indicates that MAC_OS_X_VERSION_10_5 is defined, suggesting that you are on Mac OS X 10.5. But then it should be aware of CTFontRef ... Did you change anything in your Python setup?
--Michiel.
--- On Wed, 8/19/09, George Nurser <gn...@go...> wrote:
> From: George Nurser <gn...@go...>
> Subject: [Matplotlib-users] mac os backend not building
> To: Mat...@li...
> Date: Wednesday, August 19, 2009, 12:23 PM
> Hi,
> I updated matplotlib to svn r 7506, but it won't build. I
> am having
> problems with the mac os backend:
> 
> 10.5.8, gcc 4.0.1:
> python setup.py build install run from the
> matplotlib/matplotlib
> directory gives:
> .....
> building 'matplotlib.backends._macosx' extension
> gcc -arch ppc -arch i386 -isysroot
> /Developer/SDKs/MacOSX10.4u.sdk
> -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
> -mno-fused-madd
> -fno-common -dynamic -DNDEBUG -g -O3
> -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
> -I/usr/local/include -I/usr/include -I/usr/X11R6/include
> -I/usr/X11/include -I.
> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
> -Isrc -Iagg24/include -I.
> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
> -c src/_macosx.m -o
> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
> src/_macosx.m:1885: error: syntax error before
> ‘setfont’
> src/_macosx.m:1885: error: syntax error before
> ‘setfont’
> src/_macosx.m: In function ‘setfont’:src/_macosx.m: In
> function ‘setfont’:
> src/_macosx.m:1895: error: ‘CTFontRef’ undeclared
> (first use in this function)
> 
> Possibly some confusion about whether MAC_OS_X_VERSION_10_5
> is defined??
> 
> --George Nurser.
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal
> Reports 2008 30-Day 
> trial. Simplify your report design, integration and
> deployment - and focus on 
> what you do best, core application coding. Discover what's
> new with 
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
 
John,
Thanks for the information. The solution worked so, I can now do a mouse
over over lines from either axes and have a nice little tooltip, etc. I
found that if I change the zorder of the axis right after attempting to
"pick" on the mouse event, it fails, but it's fine for my needs to just
toggle the "top" axes on mouse events when looking for a mouse hover. 
 if self.ax.get_zorder() == 0.1:
 ax.set_zorder( 0 )
 ax2.set_zorder( 0.1 )
 else:
 ax2.set_zorder( 0 )
 ax.set_zorder( 0.1 )
 self.figure.pick( event )
This is perhaps a bit of hackery, but I've not seen any mouse over legends
of the sorts built in. 
Thanks again,
-Erik
John Hunter-4 wrote:
> 
> 
> I'm not sure why it worked before -- that surprises me. Only one axes
> can receive the pick event currently, so if you have overlapping axes,
> as you do with twinx, the one with the highest zorder will receive the
> pick events. 
> 
> 
-- 
View this message in context: http://www.nabble.com/onpick-on-a-2-y-plot-%28-via-twinx%28%29-%29-seems-to-only-allow-picking-of-second-axes%27s-artists-tp25049128p25062402.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michiel de H. <mjl...@ya...> - 2009年08月20日 14:02:06
Whether or not you can do multiple show()s depends on which backend you use. For example, the Mac OS X native backend has no problems with the multiple show()s in your example. Which backend were you using? While matplotlib does not support multiple show()s in general, there may be a simple solution to get that working for the backend you are using.
--Michiel.
--- On Wed, 8/19/09, Kim, Dae-Won <dw...@gm...> wrote:
> From: Kim, Dae-Won <dw...@gm...>
> Subject: Re: [Matplotlib-users] show() problem in Mac OS X 10.5.8
> To: "Ryan May" <rm...@gm...>
> Cc: mat...@li...
> Date: Wednesday, August 19, 2009, 2:48 PM
> 
> The one 'preliminary' solution I found is using
> an interactive mode + raw_input.
> Here is and example,
> 
>     ion()
>     plot([1,2,3,4,5])
>     raw_input('Type Enter')
>     clf()
> 
> 
>     plot([1,2,3,4,5])
>     raw_input('Type_Enter')
>     clf()
>     plot([1,2,3,4,5])
>     show()
> 
> With this approach, I can press the enter when I want to
> see next figure.
> 
> 
> 
> Though It's not as convenient as 'multiple
> show()'..
> 
> 
> On Wed, Aug 19, 2009 at 1:57 PM,
> Kim, Dae-Won <dw...@gm...>
> wrote:
> 
> 
> 
> 
> On Wed, Aug 19, 2009 at 1:02 PM,
> Ryan May <rm...@gm...>
> wrote:
> 
> 
> 
> On Wed, Aug 19, 2009 at 11:55
> AM, coati <dw...@gm...>
> wrote:
> 
> 
> 
> 
> 
> 
> 
> I have a problem with show() command in my macbook
> machine (Leopard 10.5.8).
> 
> For example, if I run the script shown below
> 
> (let assume it is saved as 'test.py', and I run a
> command 'python test.py'),
> 
> 
> 
> ---------------------------------------
> 
> 
> 
> plot([1,2,3,4,5])
> 
> show() #first window
> 
> plot([1,2,3,4,5])
> 
> show() #second window
> 
> plot([1,2,3,4,5])
> 
> show() #third window
> 
> 
> 
> ---------------------------------------
> 
> 
> 
> Then the first window just pops up and I can see a
> beautiful straight line
> 
> :) No problem so far.
> 
> But, after I close the first window by clicking the close
> button of the
> 
> window,
> 
> other two window (second and third) just pops up and close
> themselves
> 
> instantly
> 
> even though I didn't click the close button...
> 
> Also, the second and third plot is shown in the same
> window.
> 
> 
> 
> I don't have such problem in my Ubuntu machine..
> 
> 
> 
> Does anybody know reasons?
> show() actually handles starting the GUI mainloop, so you
> really shouldn't be calling it more than once from a
> script. Quite frankly, it's more amazing that it works
> on your Ubuntu macine. :) If you're wanting 3 separate
> windows, try:
> 
> 
> 
> 
> 
> 
> plot([1,2,3,4,5])
> figure()
> plot([1,2,3,4,5])
> figure()
> plot([1,2,3,4,5])
> show()
> 
> Ryan
> 
> -- 
> Ryan May
> 
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
> 
> 
> 
> 
> 
> Thanks Ryan,
> 
> Hm.. it's a bit strange.. I just installed matplotlib
> at Ubuntu using the package manager :)
> And, another linux machines (red hat enterprise) can do
> this too. For the RHELs, I compiled matplotlib source code
> by myself.
> 
> 
> 
> 
> 
> figure() works very well, but what I want to do is to check
> the plots one by one and thus
> I can exit the script at any time I want (because I usually
> have lots of figures to check and I don't want 
> to pop up every of them at the same time..)
> 
> 
> 
> 
> 
> Anyway, thank you very much!
> 
> 
> 
> 
> 
> 
> 
> -----Inline Attachment Follows-----
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal
> Reports 2008 30-Day 
> trial. Simplify your report design, integration and
> deployment - and focus on 
> what you do best, core application coding. Discover what's
> new with 
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> -----Inline Attachment Follows-----
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
 
From: marc d. <mde...@ya...> - 2009年08月20日 07:07:36
I think I needed to create an "axes". This seems to have solved my problem.
a = f.add_subplot(111)
map = Basemap(projection='ortho',
       lat_0=34.0,
       lon_0=-117.3,
       resolution='l',
       area_thresh=1000,
       ax=a)
Marc Desmarais
Long Beach, CA, 90814
--- On Wed, 8/19/09, marc desmarais <mde...@ya...> wrote:
From: marc desmarais <mde...@ya...>
Subject: embeding basemap in Tk
To: mat...@li...
Date: Wednesday, August 19, 2009, 9:33 PM
How do I embed basemap in Tk? I tried following the matplotlib example. But the following does not work (the earth does not appear):
import matplotlib
matplotlib.use('TkAgg') 
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
from mpl_toolkits.basemap import Basemap
import Tkinter as Tk
root = Tk.Tk()
root.wm_title("Embedding in TK")
f = Figure()#figsize=(5,4), dpi=100)
map = Basemap(projection='ortho', lat_0=34.0,lon_0=-117.3, resolution='l' area_thresh=1000.)
map.drawcoastlines()
map.drawcountries()
map.fillcontinents(color='coral') 
map.drawmapboundary()
canvas = FigureCanvasTkAgg(f, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP,
 fill=Tk.BOTH, expand=1)
toolbar = NavigationToolbar2TkAgg( canvas, root )
toolbar.update()
canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
Tk.mainloop()
thanks...
Marc Desmarais
Long Beach, CA, 90814
 
 
 
From: marc d. <mde...@ya...> - 2009年08月20日 06:57:36
"The longitude and latitude lines can be labelled where they
the map projection boundary"
at
http://matplotlib.sourceforge.net/basemap/doc/html/users/graticule.html
Marc Desmarais
Long Beach, CA, 90814
 
--- On Wed, 8/19/09, marc desmarais <mde...@ya...> wrote:
From: marc desmarais <mde...@ya...>
Subject: embeding basemap in Tk
To: mat...@li...
Date: Wednesday, August 19, 2009, 9:33 PM
How do I embed basemap in Tk? I tried following the matplotlib example. But the following does not work (the earth does not appear):
import matplotlib
matplotlib.use('TkAgg') 
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
from mpl_toolkits.basemap import Basemap
import Tkinter as Tk
root = Tk.Tk()
root.wm_title("Embedding in TK")
f = Figure()#figsize=(5,4), dpi=100)
map = Basemap(projection='ortho', lat_0=34.0,lon_0=-117.3, resolution='l' area_thresh=1000.)
map.drawcoastlines()
map.drawcountries()
map.fillcontinents(color='coral') 
map.drawmapboundary()
canvas = FigureCanvasTkAgg(f, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP,
 fill=Tk.BOTH, expand=1)
toolbar = NavigationToolbar2TkAgg( canvas, root )
toolbar.update()
canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
Tk.mainloop()
thanks...
Marc Desmarais
Long Beach, CA, 90814
 
 
 
From: Bernard G. <ber...@gm...> - 2009年08月20日 06:34:30
Hello,
For an application, I am writing, I need the naviguation toolbar 2 and
the BoxSelector and Lasso widgets. The user should be able to select
with the Lasso or BoxSelector widget even when zoom or pan is active
by pressing a modifier key.
I have managed to do this with the following code (for now, only for
the Box selector with modifier key shift):
**********************************
class ShiftBoxSelector(matplotlib.widgets.RectangleSelector):
 def press(self, event):
 if ((event.guiEvent.state & gtk.gdk.SHIFT_MASK)!=gtk.gdk.SHIFT_MASK) :
 return
 return matplotlib.widgets.RectangleSelector.press(self,event)
class NoShiftNavigationToolbar2(matplotlib.backends.backend_gtkagg.NavigationToolbar2GTKAgg):
 def press_pan(self, event):
 if ((event.guiEvent.state & gtk.gdk.SHIFT_MASK)==gtk.gdk.SHIFT_MASK) :
 return
 return matplotlib.backends.backend_gtkagg.NavigationToolbar2GTKAgg.press_pan(self,event)
 def press_zoom(self, event):
 if ((event.guiEvent.state & gtk.gdk.SHIFT_MASK)==gtk.gdk.SHIFT_MASK) :
 return
 return matplotlib.backends.backend_gtkagg.NavigationToolbar2GTKAgg.press_zoom(self,event)
 def pan(self,*args):
 x = matplotlib.backends.backend_gtkagg.NavigationToolbar2GTKAgg.pan(self,*args)
 self.canvas.widgetlock.release(self)
 return x
 def zoom(self,*args):
 x = matplotlib.backends.backend_gtkagg.NavigationToolbar2GTKAgg.zoom(self,*args)
 self.canvas.widgetlock.release(self)
 return x
**********************
Is this a good solution?
My application is not threaded and the only other widgets interacting
with the plots are gtk buttons. However there will be several plots in
different tabs each with their own naviguation toolbar, boxselector
and lasso widgets. What are the risks of unlocking the canvas when
zoom/pan is active?
Thank you for your help,
 Bernard
From: Sameer R. <re...@gm...> - 2009年08月20日 06:01:53
We are working on plotting mesh (in hermes2d:
http://hpfem.math.unr.edu/projects/hermes2d-new/) We created a python
function to plot mesh but initially without curves. Later we also tried to
work on curved elements but we are having some problems.
In the hermes2d examples curves are defined as [4, 7, 45] where 4,7
are vertices indices, and 45 is center angle.
But in matplotlib we do not see any function to plot curve with these data,
we have to convert them into something more useful to those functions
available in matplotlib. For ex:
1) matplot.path porvides a way to plot curve with three points
http://matplotlib.sourceforge.net/api/path_api.html#module-matplotlib.path
 p1 -> starting Point
 p2 -> control point
 p3 -> end point
 iI we want to go this way we do have p1 & p3 but have to calclate p2
(control point)
2) matplot.patch.arc provides a way to plot an arc
http://matplotlib.sourceforge.net/api/artist_api.html#module-matplotlib.patches
 but it needs
 -> center of circle
 -> start angle
 -> end angle
 -> radius of circle
 we have to calculate all these with data available to us
We didn't find other ways of plotting curves using matplotlib...and in our
view method 1 is the best way for us because currently we have implemented
matplotlib.path to draw mesh without curves, and it will be easy to fill
color this way.
We tried the method 1 but the result was a garbled mesh. I would appreciate
if anybody could guide us how we can use the matplotlib functions to draw
curved elements if we are given information as described above.
Thanks
From: marc d. <mde...@ya...> - 2009年08月20日 04:33:18
How do I embed basemap in Tk? I tried following the matplotlib example. But the following does not work (the earth does not appear):
import matplotlib
matplotlib.use('TkAgg') 
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
from mpl_toolkits.basemap import Basemap
import Tkinter as Tk
root = Tk.Tk()
root.wm_title("Embedding in TK")
f = Figure()#figsize=(5,4), dpi=100)
map = Basemap(projection='ortho', lat_0=34.0,lon_0=-117.3, resolution='l' area_thresh=1000.)
map.drawcoastlines()
map.drawcountries()
map.fillcontinents(color='coral') 
map.drawmapboundary()
canvas = FigureCanvasTkAgg(f, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
toolbar = NavigationToolbar2TkAgg( canvas, root )
toolbar.update()
canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
Tk.mainloop()
thanks...
Marc Desmarais
Long Beach, CA, 90814
 
 
From: Christopher B. <c-...@as...> - 2009年08月20日 00:00:19
Thank you, Jae-Joon. Again. :)
On 8/18/2009 2:49 PM, Jae-Joon Lee wrote:
> I guess you're using 0.99?
> Use spines instead.
>
> for example,
>
> gca().spines["bottom"].set_linewidth(2) # it only changes the
> linewidth of the bottom spine.
>
> also, see this example,
>
> http://matplotlib.sourceforge.net/examples/pylab_examples/spine_placement_demo.html#pylab-examples-spine-placement-demo
>
> Regards,
>
> -JJ
>
>
>
> On Tue, Aug 18, 2009 at 5:18 PM, Christopher Brown<c-...@as...> wrote:
>> I have asked this question before. How do I set the linewidth of the
>> axis frame? Long ago, I used gca().get_frame().set_linewidth(2). More
>> recently, I used gca().frame.set_linewidth(2), but this doesn't seem to
>> work anymore. I've tried gca().patch, to no avail. Any suggestions?
>>
>> Thanks.
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
>> trial. Simplify your report design, integration and deployment - and focus on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now. Â http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
1 message has been excluded from this view by a project administrator.

Showing 24 results of 24

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 によって変換されたページ (->オリジナル) /