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 36

1 2 > >> (Page 1 of 2)
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.
>>
>>
>
On Wed, May 26, 2010 at 10:47 AM, Pim Schellart <p.s...@gm...> wrote:
> Dear John and George,
>
> I am happy to report that everything is now working!
> The latest SVN patch fixed the fetch problem and a complete removal of
> my custom compiled libpng and libfreetype2 followed by:
>
> sudo make -f make.osx fetch deps mpl_build mpl_install
> sudo python setup.py install
>
> did the rest.
>
> Thank you for all your help!
>
> Kind regards,
>
> Pim Schellart
>
> P.S. I am looking forward to seeing 64 binaries for Python 2.6/2.7 and
> numpy/scipy/matplotlib on OSX 10.6 at some point in the future :)
Well, now you can make them yourself :-)
 > make -f make.osx binaries
But we will try to get some official ones out in the near future.
JDH
Dear John and George,
I am happy to report that everything is now working!
The latest SVN patch fixed the fetch problem and a complete removal of
my custom compiled libpng and libfreetype2 followed by:
sudo make -f make.osx fetch deps mpl_build mpl_install
sudo python setup.py install
did the rest.
Thank you for all your help!
Kind regards,
Pim Schellart
P.S. I am looking forward to seeing 64 binaries for Python 2.6/2.7 and
numpy/scipy/matplotlib on OSX 10.6 at some point in the future :)
2010年5月26日 John Hunter <jd...@gm...>:
> On Wed, May 26, 2010 at 8:20 AM, John Hunter <jd...@gm...> wrote:
>> On Wed, May 26, 2010 at 8:14 AM, Pim Schellart <p.s...@gm...> wrote:
>>> I still get the error (after svn up to revision 8336) but strangely
>>> when I try to decompress manually I get:
>>>
>>> matplotlib $ gunzip zlib-1.2.3.tar.gz
>>>
>>> gzip: zlib-1.2.3.tar.gz: not in gzip format
>>
>> I'm getting that too -- looks like the target has moved. When I cat
>> the file I see
>
> OK, I think I have this fixed. I can now fetch valid files:
>
> jdhunter@uqbar:mpl> make -f make.osx clean
> rm -rf zlib-1.2.3.tar.gz libpng-1.2.39.tar.bz2 \
>    freetype-2.3.11.tar.bz2 bdist_mpkg-.tar.gz \
>    bdist_mpkg- \
>    zlib-1.2.3 libpng-1.2.39 freetype-2.3.11 \
>    build
> jdhunter@uqbar:mpl> make -f make.osx fetch
> python2.6 -c 'import urllib;
> urllib.urlretrieve("http://superb-sea2.dl.sourceforge.net/project/libpng/zlib/1.2.3/zlib-1.2.3.tar.gz",
> "zlib-1.2.3.tar.gz")' &&\
>    python2.6 -c 'import urllib;
> urllib.urlretrieve("http://sourceforge.net/projects/libpng/files/libpng-stable/1.2.39/libpng-1.2.39.tar.gz/download",
> "libpng-1.2.39.tar.gz")' &&\
>    python2.6 -c 'import urllib;
> urllib.urlretrieve("http://download.savannah.gnu.org/releases/freetype/freetype-2.3.11.tar.bz2",
> "freetype-2.3.11.tar.bz2")'
> jdhunter@uqbar:mpl> tar xvfz zlib-1.2.3.tar.gz|head
> zlib-1.2.3/
> zlib-1.2.3/adler32.c
> zlib-1.2.3/algorithm.txt
> zlib-1.2.3/amiga/
> zlib-1.2.3/amiga/Makefile.pup
> zlib-1.2.3/amiga/Makefile.sas
> zlib-1.2.3/as400/
> zlib-1.2.3/as400/bndsrc
> zlib-1.2.3/as400/compile.clp
> zlib-1.2.3/as400/readme.txt
> jdhunter@uqbar:mpl> tar xvfz libpng-1.2.39.tar.gz |head
> libpng-1.2.39/
> libpng-1.2.39/pngpread.c
> libpng-1.2.39/pngnow.png
> libpng-1.2.39/README
> libpng-1.2.39/config.guess
> libpng-1.2.39/TODO
> libpng-1.2.39/pngrtran.c
> libpng-1.2.39/pngwutil.c
> libpng-1.2.39/configure
> libpng-1.2.39/pngtest.c
> jdhunter@uqbar:mpl> tar tvfj freetype-2.3.11.tar.bz2 |head
> tar: Record size = 8 blocks
> drwxr-xr-x wl/users     0 2009年10月10日 11:37 freetype-2.3.11/
> -rw-r--r-- wl/users   35819 2009年03月14日 06:45 freetype-2.3.11/vms_make.com
> -rw-r--r-- wl/users   91573 2009年03月14日 06:45 freetype-2.3.11/ChangeLog.20
> -rw-r--r-- wl/users    236 2009年03月14日 06:45 freetype-2.3.11/version.sed
> -rw-r--r-- wl/users    1469 2009年03月14日 06:45 freetype-2.3.11/Jamrules
> -rw-r--r-- wl/users    5687 2009年10月10日 11:21 freetype-2.3.11/Jamfile
> -rwxr-xr-x wl/users    3573 2009年07月03日 06:28 freetype-2.3.11/configure
> drwxr-xr-x wl/users     0 2009年10月10日 11:37 freetype-2.3.11/docs/
> -rw-r--r-- wl/users    1260 2009年03月14日 06:45 freetype-2.3.11/docs/LICENSE.TXT
> drwxr-xr-x wl/users     0 2009年10月10日 11:37 freetype-2.3.11/docs/reference/
>
From: Sarah G. <sf...@ca...> - 2010年05月26日 14:35:08
Brilliant, that worked perfectly!
Thanks very much,
Sarah
Jae-Joon Lee wrote:
> You need to define your own transform. And the best way is to read
> through the transforms.py. Here is a modified version of your example
> that uses a custom transform.
>
> However, often you may need to use a custom locator also for this kind
> of transform.
>
> HTH,
>
> -JJ
>
> from matplotlib.transforms import Transform, BlendedGenericTransform,
> IdentityTransform
>
> c = 3.e2
>
> class Freq2WavelengthTransform(Transform):
> input_dims = 1
> output_dims = 1
> is_separable = False
> has_inverse = True
>
> def transform(self, tr):
> return c/tr
>
> def inverted(self):
> return Wavelength2FreqTransform()
>
>
> class Wavelength2FreqTransform(Freq2WavelengthTransform):
> def inverted(self):
> return Freq2WavelengthTransform()
>
>
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
>
>
> aux_trans = BlendedGenericTransform(Freq2WavelengthTransform(),
> IdentityTransform())
>
> fig = plt.figure(2)
>
> ax_GHz = SubplotHost(fig, 1,1,1)
> fig.add_subplot(ax_GHz)
> ax_GHz.set_xlabel("Frequency (GHz)")
>
> import numpy as np
> xvals = np.arange(199.9, 999.9, 0.1)
> #make some test data
> data = np.sin(0.03*xvals)
>
> ax_mm = ax_GHz.twin(aux_trans)
> ax_mm.set_xlabel('Wavelength (mm)')
> ax_mm.set_viewlim_mode("transform")
> ax_mm.axis["right"].toggle(ticklabels=False)
>
> ax_GHz.plot(xvals, data)
> ax_GHz.set_xlim(200, 1000)
>
> plt.draw()
> plt.show()
>
>
>
>
> On Wed, May 26, 2010 at 7:24 AM, Sarah Graves <sf...@ca...> wrote:
> 
>> Hi,
>>
>> I've made a matplotlib plot with frequency on the x-axis, and I would
>> like to add an additional x-axis at the top that is measured in
>> wavelength , i.e. wavelength = 3e8 / frequency
>>
>> Is there anyway to do this transformation automatically in matplotlib?
>>
>> I tried to give a transformation argument to the ax.twin() axes_grid
>> command, as shown in the axes_grid parasite_simple2.py example, but
>> I've not managed to get this to work with a transformation more
>> complicated than a scaling by a constant factor. I tried looking at the
>> matplotlib.transforms documentation but I couldn't see a way to do this
>> transformation there. I'm not sure I understood it very well though. I
>> can't simply use the twiny( ) command and manually set the limits as the
>> wavelength ticks will not occur at the points corresponding to the
>> correct frequency.
>>
>> At the moment I am using the twin() command, and then I manually choose
>> a sensible set of tickvalues I want in wavelength units, calculate the
>> corresponding frequency values, and then set the tick locations to be
>> the frequency values and the tick labels to be the wavelength values.
>>
>> Thanks,
>> Sarah
>>
>> Example code:
>> import numpy as np
>> import matplotlib
>> from mpl_toolkits.axes_grid1.parasite_axes import SubplotHost
>> import matplotlib.pyplot as plt
>> #create xaxis range of values -- 200 -- 1000 Ghz
>> xvals = np.arange(199.9, 999.9, 0.1)
>> #make some test data
>> data = np.sin(0.03*xvals)
>> #set up the figure
>> fig = plt.figure()
>> ax = SubplotHost(fig, 111)
>> fig.add_subplot(ax)
>> ax2 = ax.twin()
>> #plot data
>> ax.plot(xvals, data)
>> ax.set_xlim(200.0, 1000.0)
>> #set up ax2 with chosen values
>> wavelength_labels = np.array([0.4, 0.6, 0.8,1.0,1.2, 1.4]) #in mm
>> frequency_points = 3e2/wavelength_labels #in GHz
>> ax2.set_xticks(frequency_points)
>> ax2.set_xticklabels(wavelength_labels)
>> ax2.set_xlabel('Wavelength (mm)')
>> ax.set_xlabel('Frequency (GHz)')
>> plt.show()
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>> 
From: alex a. <ai...@vi...> - 2010年05月26日 14:28:32
today i produced an image that failed to save to eps. 
i can save the file in pdf, but i get the same error if i try to use
pdf2ps. png works too, but its not vector. 
not sure if its important, but the image has 401 lines, with 500 points
each.
the image is produced from a bunch of data files and im not sure how to
most effectively send this over email ( in case you all wanted to
re-produced the error).
the main error is 
Error: /nocurrentpoint in --lineto--
here is the whole error
thanks 
alex
--------------------------------------------------------------
In [774]: savefig ('output.eps', format='eps')
GPL Ghostscript 8.70: Unrecoverable error, exit code 1
RuntimeError: ghostscript was not able to process your image.
Here is the full report generated by ghostscript:
GPL Ghostscript 8.70 (2009年07月31日)
Copyright (C) 2009 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading CenturySchL-Roma font
from /var/lib/defoma/gs.d/dirs/fonts/c059013l.pfb... 3081280 1718017
6003072 4188814 1 done.
Error: /nocurrentpoint in --lineto--
Operand stack:
 178.896 120.362
Execution stack:
 %interp_exit .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval-- false 1 %stopped_push 1862 1 3 %
oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop
1739 1 3 %oparray_pop --nostringval-- %
errorexec_pop .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
 --dict:1154/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)--
--dict:5/6(ro)(L)-- --dict:178/300(L)-- --dict:44/200(L)--
--dict:7/7(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 34416
From: Sandy Y. <cd...@li...> - 2010年05月26日 14:19:11
 
Yes I wrote about problem with show() , too
 
is matplotlib seriouse project????!!!!
Sandy
 
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
 
> From: mat...@li...
> Subject: Matplotlib-users Digest, Vol 48, Issue 46
> To: mat...@li...
> Date: 2010年5月26日 04:41:13 +0000
> 
> Send Matplotlib-users mailing list submissions to
> mat...@li...
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> or, via email, send a message with subject or body 'help' to
> mat...@li...
> 
> You can reach the person managing the list at
> mat...@li...
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Matplotlib-users digest..."
> 
> 
> Today's Topics:
> 
> 1. interpolate inside a circle (Carlos Grohmann)
> 2. Re: Mac backend problems for nearly all backends.
> (Jonathan Stickel)
> 3. Re: Mac backend problems for nearly all backends. (Daniel Welling)
> 4. Show() in emacs (Ted Rosenbaum)
> 5. Re: Mac backend problems for nearly all backends.
> (Michiel de Hoon)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: 2010年5月25日 21:47:14 -0300
> From: Carlos Grohmann <car...@gm...>
> Subject: [Matplotlib-users] interpolate inside a circle
> To: matplotlib-users <mat...@li...>
> Message-ID:
> <AAN...@ma...>
> Content-Type: text/plain; charset=windows-1252
> 
> 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)?
> 
> TIA
> 
> -- 
> 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.
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: 2010年5月25日 20:48:27 -0600
> From: Jonathan Stickel <jjs...@vc...>
> Subject: Re: [Matplotlib-users] Mac backend problems for nearly all
> backends.
> To: mat...@li...
> Message-ID: <4BF...@vc...>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> On 05/25/2010 mat...@li... wrote:
> > From: Christopher Barker <Chr...@no...>
> > Subject: Re: [Matplotlib-users] Mac backend problems for nearly all
> > backends.
> > To: mat...@li...
> > Message-ID: <4BF...@no...>
> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> > 
> > Jonathan Stickel wrote:
> > > > I've experienced many of the same problems on Mac OS X 10.6.3 
> > (Snow 
> > > > Leopard). I have python/scipy/numpy/matplotlib/ipython all 
> > installed 
> > > > via Macports.
> > 
> > Just to be clear -- this sounds like a MacPorts problem, not 
> > necessarily 
> > an OS-X problem.
> > 
> > 
> > > > I finally have the WXagg backend 
> > > > working, but that required installed WXPython with the gtk/X11 
> > backend.
> > 
> > Does MacPorts not allow a native wx? Maybe becasue you're running 64 
> > bit?
> > 
> 
> Right, I am running Snow Leopard and have Python 2.6 installed 64 bit. 
> Apparently, Carbon requires 32 bit and wxWidgets/wxPython does not (yet) 
> support Cocoa. This problem will bite you in one form or another on Mac 
> OS X, regardless of whether you are using Macports or something else.
> 
> > Anyway, I guess that's why I don't use macports for python.
> 
> See above.
> 
> > 
> > 
> > >> >> 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
> > 
> > That's what I've been running, and I've had no real issues (Haven't 
> > tried the OS-X back-end) -- but I'm using the python.org python.
> > 
> > >> >> 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.)
> > 
> > OK -- then a fink issue, rather than a Macports one -- same idea, 
> > though.
> > 
> > My impression is that neither fink nor macports do well with Mac GUI 
> > stuff -- unless you're talking X11.
> 
> Not exactly true. Fink and Macports are tools and have their 
> shortcomings, but both can be immensely useful for installing all this 
> stuff. Otherwise, you do it manually, which of course can cause you 
> trouble as well. Anyway, getting off topic. I only intended to report 
> some form of success with the wx backend.
> 
> Jonathan
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: 2010年5月25日 21:23:12 -0600
> From: Daniel Welling <dan...@gm...>
> Subject: Re: [Matplotlib-users] Mac backend problems for nearly all
> backends.
> To: Jonathan Stickel <jjs...@vc...>
> Cc: mat...@li...
> Message-ID:
> <AAN...@ma...>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Thanks for the info...
> 1)The problem does manifest in the same manner through the normal python
> prompt.
> 2) I'm not sure what is meant by a "framework install." Everything (except
> MPL 99.1.1) was installed through fink.
> 3) I've never had problems with Fink software before, and I have a crapload
> (technical term) of stuff installed. This is neither here nor there,
> however, as it seems that not all Pythons are created equal.
> 4) A colleague of mine claims to have everything working on a new Intel mac
> (I'm guessing 10.5.8) right out of MacPorts; I'll talk to him more and try
> to find out what is different between our two cases.
> 5) I have yet to try installing wxPython for python 2.5; this may work in
> the end. It's not in fink, so I've put off installing it manually. I'll
> give it a shot and let you know how it works.
> 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?
> 
> Finally, I've had some measure of success by installing Qt4 (through Fink)
> and using the Qt4Agg backend. Because the current stable fink Qt4 release
> (4.6.1) has a bug, I need to apply the fix found here:
> http://old.nabble.com/Qt4-backend:-critical-bug-with-PyQt4-v4.6%2B-td26205716.html
> in order to allow more than one plot per session to be shown. I'll re-write
> the fix here for convenience and clarity (the original did not have the
> proper module references in it, so this saves some 5 minutes of
> tab-completion work in ipython...)
> 
> # Add this before "FigureManagerQT" class
> class FigureWindow(QtGui.QMainWindow):
> def __init__(self):
> super(FigureWindow, self).__init__()
> def closeEvent(self, event):
> super(FigureWindow, self).closeEvent(event)
> if QtCore.PYQT_VERSION_STR.startswith('4.6'):
> self.emit(QtCore.SIGNAL('destroyed()'))
> # Replace "QtGui.QMainWindow" by "FigureWindow" in
> "FigureManagerQT"'s constructor
> 
> This works perfectly on my Intel machine running MPL 99.1.1. It's fast and
> looks sharp. I'll report back on the PPC/99.0 combo tomorrow; Qt4 takes a
> thousand hours to compile.
> 
> Thanks for the input.
> 
> On Tue, May 25, 2010 at 8:48 PM, Jonathan Stickel <jjs...@vc...> wrote:
> 
> > On 05/25/2010 mat...@li... wrote:
> > > From: Christopher Barker <Chr...@no...>
> > > Subject: Re: [Matplotlib-users] Mac backend problems for nearly all
> > > backends.
> > > To: mat...@li...
> > > Message-ID: <4BF...@no...>
> > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> > >
> > > Jonathan Stickel wrote:
> > > > > I've experienced many of the same problems on Mac OS X 10.6.3
> > > (Snow
> > > > > Leopard). I have python/scipy/numpy/matplotlib/ipython all
> > > installed
> > > > > via Macports.
> > >
> > > Just to be clear -- this sounds like a MacPorts problem, not
> > > necessarily
> > > an OS-X problem.
> > >
> > >
> > > > > I finally have the WXagg backend
> > > > > working, but that required installed WXPython with the gtk/X11
> > > backend.
> > >
> > > Does MacPorts not allow a native wx? Maybe becasue you're running 64
> > > bit?
> > >
> >
> > Right, I am running Snow Leopard and have Python 2.6 installed 64 bit.
> > Apparently, Carbon requires 32 bit and wxWidgets/wxPython does not (yet)
> > support Cocoa. This problem will bite you in one form or another on Mac
> > OS X, regardless of whether you are using Macports or something else.
> >
> > > Anyway, I guess that's why I don't use macports for python.
> >
> > See above.
> >
> > >
> > >
> > > >> >> 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
> > >
> > > That's what I've been running, and I've had no real issues (Haven't
> > > tried the OS-X back-end) -- but I'm using the python.org python.
> > >
> > > >> >> 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.)
> > >
> > > OK -- then a fink issue, rather than a Macports one -- same idea,
> > > though.
> > >
> > > My impression is that neither fink nor macports do well with Mac GUI
> > > stuff -- unless you're talking X11.
> >
> > Not exactly true. Fink and Macports are tools and have their
> > shortcomings, but both can be immensely useful for installing all this
> > stuff. Otherwise, you do it manually, which of course can cause you
> > trouble as well. Anyway, getting off topic. I only intended to report
> > some form of success with the wx backend.
> >
> > Jonathan
> >
> >
> > ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> Message: 4
> Date: 2010年5月25日 23:40:25 -0400
> From: Ted Rosenbaum <ted...@ya...>
> Subject: [Matplotlib-users] Show() in emacs
> To: mat...@li...
> Message-ID:
> <AAN...@ma...>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> 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
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> Message: 5
> Date: 2010年5月25日 21:41:06 -0700 (PDT)
> From: Michiel de Hoon <mjl...@ya...>
> Subject: Re: [Matplotlib-users] Mac backend problems for nearly all
> backends.
> To: Jonathan Stickel <jjs...@vc...>, Daniel Welling
> <dan...@gm...>
> Cc: mat...@li...
> Message-ID: <812...@we...>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> 
> 
> > 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.
> 
> 
> 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> ------------------------------------------------------------------------------
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> End of Matplotlib-users Digest, Vol 48, Issue 46
> ************************************************
 		 	 		 
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969 
From: Jae-Joon L. <lee...@gm...> - 2010年05月26日 14:14:12
There is no clear api to manage this.
Try something like
ax = gca()
for t in ax.xaxis.get_major_ticks():
 t.tick1On = False
 t.tick2On = False
-JJ
On Wed, May 26, 2010 at 6:30 AM, John Reid <j....@ma...> wrote:
> Hi,
>
> This is probably easy to do but I didn't work it out from the
> documentation so far. How do I remove the tick lines on a plot but keep
> the labels?
>
> Thanks,
> John.
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2010年05月26日 14:08:19
You need to define your own transform. And the best way is to read
through the transforms.py. Here is a modified version of your example
that uses a custom transform.
However, often you may need to use a custom locator also for this kind
of transform.
HTH,
-JJ
from matplotlib.transforms import Transform, BlendedGenericTransform,
IdentityTransform
c = 3.e2
class Freq2WavelengthTransform(Transform):
 input_dims = 1
 output_dims = 1
 is_separable = False
 has_inverse = True
 def transform(self, tr):
 return c/tr
 def inverted(self):
 return Wavelength2FreqTransform()
class Wavelength2FreqTransform(Freq2WavelengthTransform):
 def inverted(self):
 return Freq2WavelengthTransform()
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
aux_trans = BlendedGenericTransform(Freq2WavelengthTransform(),
IdentityTransform())
fig = plt.figure(2)
ax_GHz = SubplotHost(fig, 1,1,1)
fig.add_subplot(ax_GHz)
ax_GHz.set_xlabel("Frequency (GHz)")
import numpy as np
xvals = np.arange(199.9, 999.9, 0.1)
#make some test data
data = np.sin(0.03*xvals)
ax_mm = ax_GHz.twin(aux_trans)
ax_mm.set_xlabel('Wavelength (mm)')
ax_mm.set_viewlim_mode("transform")
ax_mm.axis["right"].toggle(ticklabels=False)
ax_GHz.plot(xvals, data)
ax_GHz.set_xlim(200, 1000)
plt.draw()
plt.show()
On Wed, May 26, 2010 at 7:24 AM, Sarah Graves <sf...@ca...> wrote:
> Hi,
>
> I've made a matplotlib plot with frequency on the x-axis, and I would
> like to add an additional x-axis at the top that is measured in
> wavelength , i.e. wavelength = 3e8 / frequency
>
> Is there anyway to do this transformation automatically in matplotlib?
>
> I tried to give a transformation argument to the ax.twin() axes_grid
> command, as shown in the axes_grid parasite_simple2.py example, but
> I've not managed to get this to work with a transformation more
> complicated than a scaling by a constant factor. I tried looking at the
> matplotlib.transforms documentation but I couldn't see a way to do this
> transformation there. I'm not sure I understood it very well though. I
> can't simply use the twiny( ) command and manually set the limits as the
> wavelength ticks will not occur at the points corresponding to the
> correct frequency.
>
> At the moment I am using the twin() command, and then I manually choose
> a sensible set of tickvalues I want in wavelength units, calculate the
> corresponding frequency values, and then set the tick locations to be
> the frequency values and the tick labels to be the wavelength values.
>
> Thanks,
> Sarah
>
> Example code:
> import numpy as np
> import matplotlib
> from mpl_toolkits.axes_grid1.parasite_axes import SubplotHost
> import matplotlib.pyplot as plt
> #create xaxis range of values -- 200 -- 1000 Ghz
> xvals = np.arange(199.9, 999.9, 0.1)
> #make some test data
> data = np.sin(0.03*xvals)
> #set up the figure
> fig = plt.figure()
> ax = SubplotHost(fig, 111)
> fig.add_subplot(ax)
> ax2 = ax.twin()
> #plot data
> ax.plot(xvals, data)
> ax.set_xlim(200.0, 1000.0)
> #set up ax2 with chosen values
> wavelength_labels = np.array([0.4, 0.6, 0.8,1.0,1.2, 1.4]) #in mm
> frequency_points = 3e2/wavelength_labels #in GHz
> ax2.set_xticks(frequency_points)
> ax2.set_xticklabels(wavelength_labels)
> ax2.set_xlabel('Wavelength (mm)')
> ax.set_xlabel('Frequency (GHz)')
> plt.show()
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
On Wed, May 26, 2010 at 5:18 AM, Pim Schellart <p.s...@gm...> wrote:
> Hi John and George,
>
> I did of course rtfm :)
> However when I do this for the latest svn checkout I get:
>
> matplotlib $ PREFIX=/usr/local sudo make -f make.osx fetch deps mpl_install
> Password:
> python2.6 -c 'import urllib;
> urllib.urlretrieve("http://www.zlib.net/zlib-1.2.3.tar.gz",
> "zlib-1.2.3.tar.gz")' &&\
>    python2.6 -c 'import urllib;
> urllib.urlretrieve("http://downloads.sourceforge.net/project/libpng/libpng-stable/1.2.39/libpng-1.2.39.tar.gz",
> "libpng-1.2.39.tar.gz")' &&\
>    python2.6 -c 'import urllib;
> urllib.urlretrieve("http://download.savannah.gnu.org/releases/freetype/freetype-2.3.11.tar.bz2",
> "freetype-2.3.11.tar.bz2")'
> export PKG_CONFIG_PATH="/lib/pkgconfig" &&\
>    rm -rf zlib-1.2.3 &&\
>    tar xvfj zlib-1.2.3.tar.gz &&\
>    cd zlib-1.2.3 &&\
>    export MACOSX_DEPLOYMENT_TARGET=10.6 &&\
>    export CFLAGS="-arch i386 -arch x86_64 -I/include
> -I/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk" &&\
>    export LDFLAGS="-arch i386 -arch x86_64 -L/lib
> -syslibroot,/Developer/SDKs/MacOSX10.6.sdk" &&\
>    ./configure --prefix=&&\
>    MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch i386 -arch x86_64
> -I/include -I/include/freetype2 -isysroot
> /Developer/SDKs/MacOSX10.6.sdk" LDFLAGS="-arch i386 -arch x86_64
> -L/lib -syslibroot,/Developer/SDKs/MacOSX10.6.sdk" make -j3 install&&
> \
Looks like a bug in the makefile -- when un-tarring zlib, it should be
'tar xvfz' not 'tar xvfj'. I was recently tinkering with bz bs gz
files and looks like the flags got out of whack. I've patched this in
svn so you can 'svn up' and try again.
>    unset MACOSX_DEPLOYMENT_TARGET
> tar: Unrecognized archive format: Inappropriate file type or format
> tar: Error exit delayed from previous errors.
> make: *** [zlib] Error 1
>
> However I would prefer to use my independently installed freetype2 and
> libpng libraries, rather than installing them again.
> Does anyone have an idea where the architecture error comes from, or
> how to check this?
> Also, why is a separate make.osx file needed?
> Could the same functionality not have been integrated into the setup.py script?
> This is not a rant, just a question :)
You could hack through make.osx to find your own libs. We do it this
way to build distributable binaries where we can't count on targets
having the right png/freetype on their os x systems. distutils is
limited as a configure system so it is difficult to hack this kind of
stuff into setup.py. Not that what we are doing is ideal, but we have
been striving for "works" over "perfect". The former is hard enough
on OS X. Any improvements you can make to make this more general are
of course welcome.
JDH
From: Fabrice S. <si...@lm...> - 2010年05月26日 12:38:58
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

Showing results of 36

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