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





Showing results of 446

<< < 1 2 3 4 .. 18 > >> (Page 2 of 18)
From: Andrea G. <and...@gm...> - 2008年06月27日 21:00:05
Hi Michael,
On Fri, Jun 27, 2008 at 7:54 PM, Michael Droettboom wrote:
> Andrea Gavana wrote:
>>
>> 2) The dashed text positioning is wrong, you can see it by running
>> dashpointlabel.py in the
>> matplotlib_examples_0.98.1\examples\pylab_examples: the position of
>> the values should be at the other end of the dash, not over the
>> plotted point.
>>
>
> I believe I have this fixed in SVN. Please kick the tires and let me know
> if you still have problems.
Thank you for the very fast answer and fix. Everything looks fine at
the moment, I'll do some more testing on monday but I don't expect any
problem.
Thank you!
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
From: Ryan M. <rm...@gm...> - 2008年06月27日 20:58:23
Attachments: colorbar_loc.py
Yves Revaz wrote:
> Ryan May wrote:
>> Yves Revaz wrote:
>> 
>>> Hi all,
>>>
>>> When I use:
>>>
>>> colorbar(orientation='horizontal')
>>>
>>> the color bar is drawn on the bottom of the corresponding graph.
>>> Which option will draw the colorbar on the top of the graph ?
>>> 
>> I think (correct me if I'm wrong devs) you'll have to use the cax
>> keyword argument to manually specifiy the position of the axes in which
>> to draw the colorbar. You'll also need to adjust the position of the
>> plot using figure.subplots_adjust. Like this maybe:
>>
>> import numpy as np
>> import matplotlib.pyplot as plt
>> data = np.random.randn(30,30)
>> plt.pcolor(data)
>> fig = plt.gcf()
>> fig.subplots_adjust(top=0.85)
>> ax = fig.add_axes([0.12, 0.9, 0.8, 0.05])
>> plt.colorbar(cax=ax, orientation='horizontal')
>>
>> Hope this helps,
>>
>> 
> 
> ok, it works fine for that case.
> Now, my problem is that my graph is a subplot:
> Taking your example it corresponds to :
> 
> import numpy as np
> import matplotlib.pyplot as plt
> 
> fig = plt.gcf()
> 
> plt.subplot(2,2,2)
> data = np.random.randn(30,30)
> plt.pcolor(data)
> 
> fig.subplots_adjust(top=0.85)
> ax = fig.add_axes([0.12, 0.9, 0.8, 0.05])
> plt.colorbar(cax=ax, orientation='horizontal')
> 
> plt.show()
> 
> 
> Obviously, the colorbar has now the length of the whole figure and not
> the one
> of the subplot ! :-( 
> I should do a "subplots_adjust" to the subplot and not to the "fig", but
> how can I do that ?
Ok, I've now made a full out solution here. It's a modification of the 
function make_axes() in colorbar.py which performs the task of splitting 
an existing axes object into a colobar, the plot, and some padding. 
I've added the location keyword parameter to specify where you want the 
colorbar. Location should be 0 or 1, depending where you want the 
colorbar located along either the x or y direction. In your case, for a 
colorbar at the top, it should be 1.0. The example
Matplotlib devs, can I get some help getting this small feature added to 
colorbar? I'm not in love with the "location" keyword or having it's 
value be 0 or 1, but I wasn't sure how to do this with a single 
parameter while simultaneously keeping the old defaults. There's also 
some spacing issues with a vertical colorbar on the left side of the 
axes that I can't seem to sort out. Thoughts?
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Adam M. <ram...@gm...> - 2008年06月27日 20:48:29
On Fri, Jun 27, 2008 at 12:03 PM, Charlie Moad <cw...@gm...> wrote:
> You'll need to edit setupext.py to not inject the "-framework Tcl -framework
> Tk" flags.
>
Thanks Charlie, that does the trick.
Cheers
Adam
From: Michael H. <mh...@us...> - 2008年06月27日 20:23:07
I upgraded using svn, and it solved the problem. Thanks for the tip!
--Mike
Michael Droettboom wrote:
> There have subsequently been a number of fixes to how state is saved 
> and restored in the Postscript backend. (Especially in revisions 
> 5082, 5083 and 5133). Comparing your eps file with mine, that seems 
> the most likely culprit of the bug. Can you update to 0.98.1 or later 
> (or the current SVN head?). Does that resolve this issue?
>
> Cheers,
> Mike
>
> Michael Hearne wrote:
>> Matplotlib versions:
>>
>> In [2]: matplotlib.__version__
>> Out[2]: '0.98pre'
>>
>> In [3]: matplotlib.__revision__
>> Out[3]: '$Revision: 5075 $'
>>
>> And I get similar results with the contour_demo example in the 
>> matplotlib distribution.
>>
>> The .eps (and .png, for comparison) file for that is attached.
>>
>> --Mike
>>
>> Michael Droettboom wrote:
>>> What version of matplotlib are you using?
>>>
>>> Can you provide a standalone example that doesn't rely on basemap? 
>>> If not, can you provide the .eps file so we can have a look?
>>>
>>> Colored lines on contour plots in EPS works fine here 
>>> (contour_demo.py) (with matplotlib 0.98.2 on a Linux box).
>>>
>>> Cheers,
>>> Mike
>>>
>>> Michael Hearne wrote:
>>>> I noticed a problem with colors in rendered encapsulated postscript 
>>>> files, and fortunately I was able to replicate with a modified 
>>>> version of one of Jeff Whitaker's example scripts, which I have 
>>>> attached. The EPS version of the plot has black contour lines 
>>>> where they are colored in the PNG file, at least on a Mac OSX machine.
>>>>
>>>> Is there a work-around for this? I haven't tested to see if it is 
>>>> limited to contour plots, or to Mac installations...
>>>>
>>>> Thanks,
>>>>
>>>> Mike
>>>>
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> ------------------------------------------------------------------------- 
>>>>
>>>> Check out the new SourceForge.net Marketplace.
>>>> It's the best place to buy or sell services for
>>>> just about anything Open Source.
>>>> http://sourceforge.net/services/buy/index.php
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>
>
-- 
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
From: John H. <jd...@gm...> - 2008年06月27日 20:19:40
On Fri, Jun 27, 2008 at 2:56 PM, Angus McMorland <am...@gm...> wrote:
> Hi all,
>
> I sometimes find myself wanting to plot a series of lines using
> axhline or axvline. Is there a mechanism to do this that I'm missing,
> or would it be difficult to support the positional parameter being an
> array of values at which to draw each line?
>
You could use a line collection with the right transform
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
import matplotlib.collections as collections
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(10))
trans = mtransforms.blended_transform_factory(
 ax.axes.transData, ax.axes.transAxes)
coll = collections.LineCollection([((x, 0), (x, 1)) for x in
10*np.random.rand(20)],
 transform=trans, color='red', lw=2, alpha=0.5)
ax.add_collection(coll)
plt.show()
From: Angus M. <am...@gm...> - 2008年06月27日 20:07:19
2008年6月27日 Angus McMorland <am...@gm...>:
> Hi all,
>
> I sometimes find myself wanting to plot a series of lines using
> axhline or axvline. Is there a mechanism to do this that I'm missing,
> or would it be difficult to support the positional parameter being an
> array of values at which to draw each line?
In fact, I see it does work... sort of. For me, with 0.91.2-2 (debian)
asking axhline throws up an error:
/usr/lib/python2.5/site-packages/matplotlib/pyplot.pyc in
axvline(*args, **kwargs)
 1358 hold(h)
 1359 try:
-> 1360 ret = gca().axvline(*args, **kwargs)
 1361 draw_if_interactive()
 1362 except:
/usr/lib/python2.5/site-packages/matplotlib/axes.pyc in axvline(self,
x, ymin, ymax, **kwargs)
 2330
 2331 trans = mtrans.blend_xy_sep_transform( self.transData,
self.transAxes )
-> 2332 l, = self.plot([x,x], [ymin,ymax] , transform=trans,
scaley=False, **kwargs)
 2333 return l
 2334
and doesn't immediately update the plot (which is what had me thinking
it wasn't working). The plot is, however, correctly updated when a
redraw is forced, such as uncovering the window after writing the
previous email.
>
> Angus.
> --
> AJC McMorland, PhD candidate
> Physiology, University of Auckland
>
> (Nearly) post-doctoral research fellow
> Neurobiology, University of Pittsburgh
>
-- 
AJC McMorland, PhD candidate
Physiology, University of Auckland
(Nearly) post-doctoral research fellow
Neurobiology, University of Pittsburgh
From: Angus M. <am...@gm...> - 2008年06月27日 19:57:01
Hi all,
I sometimes find myself wanting to plot a series of lines using
axhline or axvline. Is there a mechanism to do this that I'm missing,
or would it be difficult to support the positional parameter being an
array of values at which to draw each line?
Angus.
-- 
AJC McMorland, PhD candidate
Physiology, University of Auckland
(Nearly) post-doctoral research fellow
Neurobiology, University of Pittsburgh
From: Andrew J. <a.h...@gm...> - 2008年06月27日 19:37:56
Hi all,
I should point out that for my actual use case, Fernando explained the 
right thing to do: start ipython *without* pylab, in which case 
use('Agg') [for example] is legal.
Andrew
Andrew Jaffe wrote:
> Hi,
> 
> Fernando Perez wrote:
>> On Fri, Jun 27, 2008 at 10:52 AM, Andrew Jaffe <a.h...@gm...> wrote:
>>> Hi all,
>>>
>>> All the usual apologies if this is a FAQ, but I can't find it.
>>>
>>> Is there any way to change the backend interactively when using ipython?
>>>
>>> Best of all would a way to make changes in the middle of a session, but
>>> even being able to do it at the beginning without editing matplotlibrc
>>> would be great.
>> Mid-session you can't swtich *GUI* backends in ipython because the
>> entire GUI event loop can only be initialized once. But at startup,
>> as of fairly recent versions you can do:
>>
>> ipython -pylab -Xthread
>>
>> for X in {g,w,q,q4}. This will force a specific threading/gui backend
>> regardless of your mplrc settings.
> 
> Actually, I want to be able to choose a *non*-GUI backend 
> (speed/commmunication issues). (Or, as I said, just to turn off the GUI 
> output...)
> 
> Yours,
> 
> Andrew
> 
>> Cheers,
>>
>> f
>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
> 
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
From: Andrew J. <a.h...@gm...> - 2008年06月27日 19:32:25
Hi John,
John Hunter wrote:>
>> In fact I deleted my whole svn directory and re-updated, but no change.
>> I'm pretty sure I've done this correctly...
> 
> You also need to delete previous installs of matplotlib.
> 
>> If it matters, I'm installing as an egg.
>> [python setupegg.py build bdist_egg;
>> easy_install dist/matplotlib-0.98.2-py2.5-macosx-10.3-fat.egg]
> 
> Well, I'm looking at the signature of matplotlib.use in the source::
> 
> and warn is a valid keyword as you can see. When you
> 
>>>> import matplotlib
>>>> print matplotlib.__file__
> 
> are you getting the file you think you should?
Aha, the problem is in ipython, which shadows user() with its own 
version, not yet updated for the new signature in my version.
Andrew
> 
> If you have an old matplotlib installed somewhere on your system that
> used namespace packages, you may be getting a different matplotlib
> root than you think you ware. That is why I suggested you remove all
> existing matplotlib installs anywhere on your path.
> 
> JDH
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
From: John H. <jd...@gm...> - 2008年06月27日 19:22:12
On Fri, Jun 27, 2008 at 1:49 PM, Andrew Jaffe <a.h...@gm...> wrote:
> In fact I deleted my whole svn directory and re-updated, but no change.
> I'm pretty sure I've done this correctly...
You also need to delete previous installs of matplotlib.
> If it matters, I'm installing as an egg.
> [python setupegg.py build bdist_egg;
> easy_install dist/matplotlib-0.98.2-py2.5-macosx-10.3-fat.egg]
Well, I'm looking at the signature of matplotlib.use in the source::
 def use(arg, warn=True):
and warn is a valid keyword as you can see. When you
>>> import matplotlib
>>> print matplotlib.__file__
are you getting the file you think you should?
If you have an old matplotlib installed somewhere on your system that
used namespace packages, you may be getting a different matplotlib
root than you think you ware. That is why I suggested you remove all
existing matplotlib installs anywhere on your path.
JDH
From: Andrew J. <a.h...@gm...> - 2008年06月27日 19:11:37
Hi,
Fernando Perez wrote:
> On Fri, Jun 27, 2008 at 10:52 AM, Andrew Jaffe <a.h...@gm...> wrote:
>> Hi all,
>>
>> All the usual apologies if this is a FAQ, but I can't find it.
>>
>> Is there any way to change the backend interactively when using ipython?
>>
>> Best of all would a way to make changes in the middle of a session, but
>> even being able to do it at the beginning without editing matplotlibrc
>> would be great.
> 
> Mid-session you can't swtich *GUI* backends in ipython because the
> entire GUI event loop can only be initialized once. But at startup,
> as of fairly recent versions you can do:
> 
> ipython -pylab -Xthread
> 
> for X in {g,w,q,q4}. This will force a specific threading/gui backend
> regardless of your mplrc settings.
Actually, I want to be able to choose a *non*-GUI backend 
(speed/commmunication issues). (Or, as I said, just to turn off the GUI 
output...)
Yours,
Andrew
> 
> Cheers,
> 
> f
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
From: Fernando P. <fpe...@gm...> - 2008年06月27日 19:06:26
On Fri, Jun 27, 2008 at 10:52 AM, Andrew Jaffe <a.h...@gm...> wrote:
> Hi all,
>
> All the usual apologies if this is a FAQ, but I can't find it.
>
> Is there any way to change the backend interactively when using ipython?
>
> Best of all would a way to make changes in the middle of a session, but
> even being able to do it at the beginning without editing matplotlibrc
> would be great.
Mid-session you can't swtich *GUI* backends in ipython because the
entire GUI event loop can only be initialized once. But at startup,
as of fairly recent versions you can do:
ipython -pylab -Xthread
for X in {g,w,q,q4}. This will force a specific threading/gui backend
regardless of your mplrc settings.
Cheers,
f
From: Michael D. <md...@st...> - 2008年06月27日 18:54:34
Andrea Gavana wrote:
> 2) The dashed text positioning is wrong, you can see it by running
> dashpointlabel.py in the
> matplotlib_examples_0.98.1\examples\pylab_examples: the position of
> the values should be at the other end of the dash, not over the
> plotted point.
> 
>
I believe I have this fixed in SVN. Please kick the tires and let me 
know if you still have problems.
Cheers,
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Andrew J. <a.h...@gm...> - 2008年06月27日 18:49:24
Hi John,
John Hunter wrote:
> On Fri, Jun 27, 2008 at 1:31 PM, Andrew Jaffe <a.h...@gm...> wrote:
>> Hi-
>>
>> [OK, sorry for all the top-posting...]
>>
>> Anyway, if I move to the current svn, I get
>>
...
> Try removing all the matplotlib installs, eggs, etc. Something is
> getting confused, because warn is a valid keyword to use in svn.
> 
>> rm -rf /Users/jaffe/Library/Python/2.5/site-packages/matplotlib*
>> rm -rf build
>> clean reinstall of mpl
In fact I deleted my whole svn directory and re-updated, but no change. 
I'm pretty sure I've done this correctly...
If it matters, I'm installing as an egg.
[python setupegg.py build bdist_egg;
easy_install dist/matplotlib-0.98.2-py2.5-macosx-10.3-fat.egg]
In [1]: switch_backend('Agg')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/jaffe/home/python/<ipython console> in <module>()
/Users/jaffe/Library/Python/2.5/site-packages/matplotlib-0.98.2-py2.5-macosx-10.3-fat.egg/matplotlib/pyplot.pyc 
in switch_backend(newbackend)
 53 close('all')
 54 global new_figure_manager, draw_if_interactive, show
---> 55 matplotlib.use(newbackend, warn=False)
 56 reload(matplotlib.backends)
 57 from matplotlib.backends import pylab_setup
TypeError: use() got an unexpected keyword argument 'warn'
In [2]: matplotlib.__version__
Out[2]: '0.98.2'
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
From: sordnay <so...@gm...> - 2008年06月27日 18:43:19
John Hunter-4 wrote:
> 
> On Fri, Jun 20, 2008 at 6:14 PM, sordnay <so...@gm...> wrote:
>>
>> Hi all,
>> I'm trying to plot in 2D, 3 variables from time series, instead of volume
>> I
>> want color for the third variable.
>> I have partial success with a scatter plot, but I'm unable to manage the
>> colorbar so it represents z values,
>> I needed to sort the variables and it's getting a bit ugly, so I though I
>> might be missing some other function ?
>> this is what I used:
>> pylab.figure()
>> x=self.stData.[items[0]]
>> y=self.stData.[items[1]]
>> z=self.stData.[items[2]]
>> points=zip(x,y)
>> points3=sorted(zip(z,points))
>> for i,p in enumerate(points3):
>> z[i]=p[0]
>> x[i]=p[1][0]
>> y[i]=p[1][1]
>> #colors=pylab.linspace(z.min(),z.max(),len(z)) did not work
>> colors=pylab.linspace(0,1,len(z))
>> pylab.scatter(x,y,c=colors,faceted=False)
> 
> Just pass c=z to scatter if z are the values you want to colormap.
> 
> JDH
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
yes it was lot easier, but i had to set the vmin and vmax kwargs or it
wouldn't work:
 sigbrowse=figure()
 x=self.stData.Data[items[0]]
 y=self.stData.Data[items[1]]
 z=self.stData.Data[items[2]]
 scatter(x,y,c=z,faceted=False,vmin=z.min(),vmax=z.max())
 colorbar()
 show()
-- 
View this message in context: http://www.nabble.com/color-xy-plot-tp18047665p18161452.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2008年06月27日 18:36:50
On Fri, Jun 27, 2008 at 1:31 PM, Andrew Jaffe <a.h...@gm...> wrote:
> Hi-
>
> [OK, sorry for all the top-posting...]
>
> Anyway, if I move to the current svn, I get
>
> In [1]: switch_backend('Agg')
> ---------------------------------------------------------------------------
> TypeError Traceback (most recent call last)
>
> /Users/jaffe/home/python/<ipython console> in <module>()
>
> /Users/jaffe/Library/Python/2.5/site-packages/matplotlib-0.98.2-py2.5-macosx-10.3-fat.egg/matplotlib/pyplot.pyc
> in switch_backend(newbackend)
> 53 close('all')
> 54 global new_figure_manager, draw_if_interactive, show
> ---> 55 matplotlib.use(newbackend, warn=False)
> 56 reload(matplotlib.backends)
> 57 from matplotlib.backends import pylab_setup
>
> TypeError: use() got an unexpected keyword argument 'warn'
Try removing all the matplotlib installs, eggs, etc. Something is
getting confused, because warn is a valid keyword to use in svn.
> rm -rf /Users/jaffe/Library/Python/2.5/site-packages/matplotlib*
> rm -rf build
> clean reinstall of mpl
From: Andrew J. <a.h...@gm...> - 2008年06月27日 18:31:53
Hi-
[OK, sorry for all the top-posting...]
Anyway, if I move to the current svn, I get
In [1]: switch_backend('Agg')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/jaffe/home/python/<ipython console> in <module>()
/Users/jaffe/Library/Python/2.5/site-packages/matplotlib-0.98.2-py2.5-macosx-10.3-fat.egg/matplotlib/pyplot.pyc 
in switch_backend(newbackend)
 53 close('all')
 54 global new_figure_manager, draw_if_interactive, show
---> 55 matplotlib.use(newbackend, warn=False)
 56 reload(matplotlib.backends)
 57 from matplotlib.backends import pylab_setup
TypeError: use() got an unexpected keyword argument 'warn'
Andrew
Eric Firing wrote:
> Andrew,
> 
> The traceback shows that you are tripping over something that has been 
> changed since the version you are using, so it might work if you update 
> your mpl, preferably from svn. I think the relevant change was made by 
> John quite recently, but I haven't looked it up.
> 
> Eric
> 
> Andrew Jaffe wrote:
>> Hi John,
>>
>> Thanks for the very fast response, but it doesn't quite work for my use 
>> case. I don't know if it's because my default is interactive, or ipython 
>> on general, or something else...
>>
>> n21:~/work/Pointing> ipython -pylab -nobanner
>>
>> In [1]: switch_backend('Agg')
>> /usr/local/src/python-2.5.2/lib/python2.5/site-packages/matplotlib/__init__.py:753: 
>> UserWarning: This call to matplotlib.use() has no effect
>> because the the backend has already been chosen;
>> matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
>> or matplotlib.backends is imported for the first time.
>>
>> warnings.warn(_use_error_msg)
>> ---------------------------------------------------------------------------
>> NameError Traceback (most recent call last)
>>
>> /home/jaffe/work/Pointing/<ipython console> in <module>()
>>
>> /usr/local/src/python-2.5.2/lib/python2.5/site-packages/matplotlib/pyplot.py 
>> in switch_backend(newbackend)
>> 52 global new_figure_manager, draw_if_interactive, show
>> 53 matplotlib.use(newbackend)
>> ---> 54 reload(backends)
>> 55 from backends import new_figure_manager, 
>> draw_if_interactive, show
>> 56
>>
>> NameError: global name 'backends' is not defined
>>
>> In [2]:
>>
>>
>>
>>
>> John Hunter wrote:
>>> On Fri, Jun 27, 2008 at 12:52 PM, Andrew Jaffe <a.h...@gm...> wrote:
>>>> Hi all,
>>>>
>>>> All the usual apologies if this is a FAQ, but I can't find it.
>>>>
>>>> Is there any way to change the backend interactively when using ipython?
>>> Take a look at the pylab/pyplot switch_backends function
>>>
>>>
>>> switch_backend(newbackend)
>>> Switch the default backend to newbackend. This feature is
>>> **experimental**, and is only expected to work switching to an
>>> image backend. Eg, if you have a bunch of PostScript scripts that
>>> you want to run from an interactive ipython session, you may want
>>> to switch to the PS backend before running them to avoid having a
>>> bunch of GUI windows popup. If you try to interactively switch
>>> from one GUI backend to another, you will explode.
>>>
>>> Calling this command will close all open windows.
>>>
>>> Eg:
>>>
>>>>>> switch_backends('Agg')
>>> JDH
>>>
>>> -------------------------------------------------------------------------
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>> http://sourceforge.net/services/buy/index.php
>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
From: Gael V. <gae...@no...> - 2008年06月27日 18:25:48
The deadline for submitting abstracts to the Scipy conference was tonight.
In order to give you more time to submit excellent abstracts, the review
committee is extending the deadline to Monday (June 30th), and will work
hastily to get all of them reviewed in time for the program announcement,
on Thursday July 3rd.
----
The SciPy 2008 Conference will be held 21-22 August 2008 at the
California Institute of Technology, Pasadena, California. SciPy is a
scientific computing package, written in the Python language. It is
widely used in research, the industry and academia.
The program features tutorials, contributed papers, lightning talks, and
bird-of-a-feather sessions. We are soliciting talks and accompanying
papers (either formal academic or magazine-style articles) that discuss
topics which center around scientific computing using Python. These
include applications, teaching, future development directions and
research. A collection of peer-reviewed articles will be published as
part of the proceedings.
Proposals for talks are submitted as extended abstracts. There are two
categories of talks:
Lightning talks
These talks are 10 minutes in duration. An abstract of between 300 and
700 words should describe the topic and motivate its relevance to
scientific computing. Lightning talks do not require an accompanying
article (although, if submitted, these will still be published).
Paper presentations
These talks are 35 minutes in duration (including questions). A one page
abstract of no less than 500 words (excluding figures and references)
should give an outline of the final paper. Papers are due two weeks
before the conference, and may be in a formal academic style, or in a
more relaxed magazine-style format.
If you wish to present a talk at the conference, please create an account
on the website http://conference.scipy.org. You may then submit an
abstract by logging in, clicking on your profile and following the "
Submit an abstract " link.
Gaël, on behalf on the SciPy08 organizing committee.
From: Eric F. <ef...@ha...> - 2008年06月27日 18:22:29
Andrew,
The traceback shows that you are tripping over something that has been 
changed since the version you are using, so it might work if you update 
your mpl, preferably from svn. I think the relevant change was made by 
John quite recently, but I haven't looked it up.
Eric
Andrew Jaffe wrote:
> Hi John,
> 
> Thanks for the very fast response, but it doesn't quite work for my use 
> case. I don't know if it's because my default is interactive, or ipython 
> on general, or something else...
> 
> n21:~/work/Pointing> ipython -pylab -nobanner
> 
> In [1]: switch_backend('Agg')
> /usr/local/src/python-2.5.2/lib/python2.5/site-packages/matplotlib/__init__.py:753: 
> UserWarning: This call to matplotlib.use() has no effect
> because the the backend has already been chosen;
> matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
> or matplotlib.backends is imported for the first time.
> 
> warnings.warn(_use_error_msg)
> ---------------------------------------------------------------------------
> NameError Traceback (most recent call last)
> 
> /home/jaffe/work/Pointing/<ipython console> in <module>()
> 
> /usr/local/src/python-2.5.2/lib/python2.5/site-packages/matplotlib/pyplot.py 
> in switch_backend(newbackend)
> 52 global new_figure_manager, draw_if_interactive, show
> 53 matplotlib.use(newbackend)
> ---> 54 reload(backends)
> 55 from backends import new_figure_manager, 
> draw_if_interactive, show
> 56
> 
> NameError: global name 'backends' is not defined
> 
> In [2]:
> 
> 
> 
> 
> John Hunter wrote:
>> On Fri, Jun 27, 2008 at 12:52 PM, Andrew Jaffe <a.h...@gm...> wrote:
>>> Hi all,
>>>
>>> All the usual apologies if this is a FAQ, but I can't find it.
>>>
>>> Is there any way to change the backend interactively when using ipython?
>> Take a look at the pylab/pyplot switch_backends function
>>
>>
>> switch_backend(newbackend)
>> Switch the default backend to newbackend. This feature is
>> **experimental**, and is only expected to work switching to an
>> image backend. Eg, if you have a bunch of PostScript scripts that
>> you want to run from an interactive ipython session, you may want
>> to switch to the PS backend before running them to avoid having a
>> bunch of GUI windows popup. If you try to interactively switch
>> from one GUI backend to another, you will explode.
>>
>> Calling this command will close all open windows.
>>
>> Eg:
>>
>>>>> switch_backends('Agg')
>> JDH
>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
> 
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Andrew J. <a.h...@gm...> - 2008年06月27日 18:07:30
Hi John,
Thanks for the very fast response, but it doesn't quite work for my use 
case. I don't know if it's because my default is interactive, or ipython 
on general, or something else...
n21:~/work/Pointing> ipython -pylab -nobanner
In [1]: switch_backend('Agg')
/usr/local/src/python-2.5.2/lib/python2.5/site-packages/matplotlib/__init__.py:753: 
UserWarning: This call to matplotlib.use() has no effect
because the the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
 warnings.warn(_use_error_msg)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/home/jaffe/work/Pointing/<ipython console> in <module>()
/usr/local/src/python-2.5.2/lib/python2.5/site-packages/matplotlib/pyplot.py 
in switch_backend(newbackend)
 52 global new_figure_manager, draw_if_interactive, show
 53 matplotlib.use(newbackend)
---> 54 reload(backends)
 55 from backends import new_figure_manager, 
draw_if_interactive, show
 56
NameError: global name 'backends' is not defined
In [2]:
John Hunter wrote:
> On Fri, Jun 27, 2008 at 12:52 PM, Andrew Jaffe <a.h...@gm...> wrote:
>> Hi all,
>>
>> All the usual apologies if this is a FAQ, but I can't find it.
>>
>> Is there any way to change the backend interactively when using ipython?
> 
> Take a look at the pylab/pyplot switch_backends function
> 
> 
> switch_backend(newbackend)
> Switch the default backend to newbackend. This feature is
> **experimental**, and is only expected to work switching to an
> image backend. Eg, if you have a bunch of PostScript scripts that
> you want to run from an interactive ipython session, you may want
> to switch to the PS backend before running them to avoid having a
> bunch of GUI windows popup. If you try to interactively switch
> from one GUI backend to another, you will explode.
> 
> Calling this command will close all open windows.
> 
> Eg:
> 
>>>> switch_backends('Agg')
> 
> JDH
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
From: John H. <jd...@gm...> - 2008年06月27日 17:56:58
On Fri, Jun 27, 2008 at 12:52 PM, Andrew Jaffe <a.h...@gm...> wrote:
> Hi all,
>
> All the usual apologies if this is a FAQ, but I can't find it.
>
> Is there any way to change the backend interactively when using ipython?
Take a look at the pylab/pyplot switch_backends function
switch_backend(newbackend)
 Switch the default backend to newbackend. This feature is
 **experimental**, and is only expected to work switching to an
 image backend. Eg, if you have a bunch of PostScript scripts that
 you want to run from an interactive ipython session, you may want
 to switch to the PS backend before running them to avoid having a
 bunch of GUI windows popup. If you try to interactively switch
 from one GUI backend to another, you will explode.
 Calling this command will close all open windows.
Eg:
>>> switch_backends('Agg')
JDH
From: Andrew J. <a.h...@gm...> - 2008年06月27日 17:52:29
Hi all,
All the usual apologies if this is a FAQ, but I can't find it.
Is there any way to change the backend interactively when using ipython?
Best of all would a way to make changes in the middle of a session, but 
even being able to do it at the beginning without editing matplotlibrc 
would be great.
For what I actually need to do, I don't really need to change the 
backend, but what I'd like to be able to do is just interactively stop 
all interactive (X11) output for my chosen backend -- I'm working 
over the network and it's very slow, but I want my savefig commandds to 
produce something.
Without ipython, I know you can do -dAgg (for example) but I don't see 
how /if that works with ipython.
Andrew
From: Michael D. <md...@st...> - 2008年06月27日 17:22:32
There have subsequently been a number of fixes to how state is saved and 
restored in the Postscript backend. (Especially in revisions 5082, 5083 
and 5133). Comparing your eps file with mine, that seems the most 
likely culprit of the bug. Can you update to 0.98.1 or later (or the 
current SVN head?). Does that resolve this issue?
Cheers,
Mike
Michael Hearne wrote:
> Matplotlib versions:
>
> In [2]: matplotlib.__version__
> Out[2]: '0.98pre'
>
> In [3]: matplotlib.__revision__
> Out[3]: '$Revision: 5075 $'
>
> And I get similar results with the contour_demo example in the 
> matplotlib distribution.
>
> The .eps (and .png, for comparison) file for that is attached.
>
> --Mike
>
> Michael Droettboom wrote:
>> What version of matplotlib are you using?
>>
>> Can you provide a standalone example that doesn't rely on basemap? 
>> If not, can you provide the .eps file so we can have a look?
>>
>> Colored lines on contour plots in EPS works fine here 
>> (contour_demo.py) (with matplotlib 0.98.2 on a Linux box).
>>
>> Cheers,
>> Mike
>>
>> Michael Hearne wrote:
>>> I noticed a problem with colors in rendered encapsulated postscript 
>>> files, and fortunately I was able to replicate with a modified 
>>> version of one of Jeff Whitaker's example scripts, which I have 
>>> attached. The EPS version of the plot has black contour lines where 
>>> they are colored in the PNG file, at least on a Mac OSX machine.
>>>
>>> Is there a work-around for this? I haven't tested to see if it is 
>>> limited to contour plots, or to Mac installations...
>>>
>>> Thanks,
>>>
>>> Mike
>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> ------------------------------------------------------------------------- 
>>>
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>> http://sourceforge.net/services/buy/index.php
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Charlie M. <cw...@gm...> - 2008年06月27日 17:03:30
You'll need to edit setupext.py to not inject the "-framework Tcl -framework
Tk" flags.
- Charlie
On Fri, Jun 27, 2008 at 12:36 AM, Adam Mercer <ram...@gm...> wrote:
> Hi
>
> I'm trying to track down a problem present in MacPorts Matplotlib
> build and the TkAgg backend. It appears that Matplotlib is linking
> against the system Tcl/Tk in /System/Library/Frameworks and not the
> non-framework Tcl/Tk installed by MacPorts, as to be expected this is
> causing segfaults when trying to use the TkAgg backend as the system
> version of Tcl/Tk differs from the MacPorts version.
>
> I've tried removing the list of directories to search for the
> framework in setupext.py in the add_tk_flags() method, ie I've set
> framework_dirs = [], and then set the paths to the Tcl/Tk header and
> libraries in the hardcoded_tcl_config() method to point to the
> MacPorts versions but this just leads to the build not being able to
> find Tcl/Tk and therefore not building the TkAgg backend, the
> following is displayed on build:
>
> Tkinter: no
> * Tkinter present, but header files are not found.
> * You may need to install development packages.
>
> The header files are installed. Can Matplotlib be linked against a
> non-framework build of Tcl/Tk on Mac OS X, and if so how?
>
> Cheers
>
> Adam
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Michael D. <md...@st...> - 2008年06月27日 16:47:45
What version of matplotlib are you using?
Can you provide a standalone example that doesn't rely on basemap? If 
not, can you provide the .eps file so we can have a look?
Colored lines on contour plots in EPS works fine here (contour_demo.py) 
(with matplotlib 0.98.2 on a Linux box).
Cheers,
Mike
Michael Hearne wrote:
> I noticed a problem with colors in rendered encapsulated postscript 
> files, and fortunately I was able to replicate with a modified version 
> of one of Jeff Whitaker's example scripts, which I have attached. The 
> EPS version of the plot has black contour lines where they are colored 
> in the PNG file, at least on a Mac OSX machine.
>
> Is there a work-around for this? I haven't tested to see if it is 
> limited to contour plots, or to Mac installations...
>
> Thanks,
>
> Mike
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
4 messages has been excluded from this view by a project administrator.

Showing results of 446

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