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

Showing results of 219

<< < 1 .. 3 4 5 6 7 .. 9 > >> (Page 5 of 9)
From: Alan G I. <ai...@am...> - 2004年12月16日 03:21:10
On 2004年12月15日, Gary apparently wrote:
> from pylab import *
Either first import everything from matplotlib
or do instead
from matplotlib.pylab import *
hth,
Alan Isaac
From: Gary <pa...@in...> - 2004年12月16日 03:05:49
As is becoming usual, my attempt to upgrade has run into a problem.
WinXP,
deleted previous ...\matplotlib before installing.
None of the examples (from the new zip file) seem to run. They 
generally seem to start with
from pylab import *
but this fails, even from the command line. Bug, feature, or pilot 
error? :)
-gary
----------------------------------------------------------
C:\Python23\Lib\site-packages\matplotlib\examples>python
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> from pylab import *
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File "C:\Python23\Lib\site-packages\pylab.py", line 1, in ?
 from matplotlib.pylab import *
 File "C:\Python23\Lib\site-packages\matplotlib\pylab.py", line 184, in ?
 from axes import Axes, PolarAxes
 File "C:\Python23\Lib\site-packages\matplotlib\axes.py", line 6, in ?
 from numerix import MLab, absolute, arange, array, asarray, ones, 
transpose,
 \
ImportError: cannot import name min
From: Todd M. <jm...@st...> - 2004年12月16日 00:02:37
On Wed, 2004年12月15日 at 16:49 -0600, John Hunter wrote:
> >>>>> "Eli" == Eli Glaser <eg...@se...> writes:
> 
> Eli> Hello, Is there an easy way to set the initial position of a
> Eli> Figure? I'm using Windows XP and new figures seem to pop up
> Eli> in the typical Windows fashion where subsequent figures
> Eli> appear about 20 pixels down and 20 pixels to the right of
> Eli> previous figures. How can I tell each figure where to pop up
> Eli> on screen?
> 
> matplotlib doesn't provide explicit support for this, but it is
> possible. What backend are you using. The matplotlib Figure is
> embedded in a FigureCanvas which is typically a GUI widget embedded in
> a GUI Window. In the pylab interface, the canvas is managed by a
> FigureManager, which has a window attribute on most of the backends.
> 
> Eg for the GTK backend, for example, you could do
> 
> from pylab import *
> 
> import gtk
> 
> figure(1)
> plot([1,2,3])
> manager = get_current_fig_manager()
> 
> # see gtk.Window class docs at
> # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html
> manager.window.set_position(gtk.WIN_POS_CENTER)
> 
> figure(2)
> plot([1,2,3])
> manager = get_current_fig_manager()
> 
> # see gtk.Window class docs at
> # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html
> manager.window.set_position(gtk.WIN_POS_NONE)
> 
> show()
> 
> For the WX* backend, manager.window is a wxFrame -
> http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_wxframe.html#wxframe
> 
> For the TkAgg backend, manager.window is a Tkinter.Tk instance -
> http://starship.python.net/crew/fredrik/tkclass/ClassToplevel.html
>
> Off the top of my head I don't know the right incantation for each
> backend, but hopefully the classdocs I referenced above will help.
> Perhaps Todd or Matthew can chime in with more Tk and WX information.
In TkAgg it works like this:
get_current_fig_manager().window.wm_geometry("+200+300")
To set the window position to X=200, Y=300.
Todd
From: Eli G. <eg...@se...> - 2004年12月15日 23:38:41
Thanks, John! That's exactly what I was looking for
I'm using the WX backend and I was able to do:
 figure(1)
 plot([1,2,3])
 manager = get_current_fig_manager()
 manager.window.SetPosition((100,100))
#or
 manager.window.Centre()
Eli
> Eg for the GTK backend, for example, you could do
>
> from pylab import *
>
> import gtk
>
> figure(1)
> plot([1,2,3])
> manager = get_current_fig_manager()
>
> # see gtk.Window class docs at
> # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html
> manager.window.set_position(gtk.WIN_POS_CENTER)
>
> figure(2)
> plot([1,2,3])
> manager = get_current_fig_manager()
>
> # see gtk.Window class docs at
> # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html
> manager.window.set_position(gtk.WIN_POS_NONE)
>
> show()
>
> For the WX* backend, manager.window is a wxFrame -
>
http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_wxframe.html#wxframe
>
> For the TkAgg backend, manager.window is a Tkinter.Tk instance -
> http://starship.python.net/crew/fredrik/tkclass/ClassToplevel.html
>
> Off the top of my head I don't know the right incantation for each
> backend, but hopefully the classdocs I referenced above will help.
> Perhaps Todd or Matthew can chime in with more Tk and WX information.
>
> While this arrangement may be suboptimal, we are resisting the urge to
> become a GUI library. The temptations to abstract GUI functions for
> use in matplotlib are many, and we are trying to keep this to a
> manageable core (some event handling, some basic window management,
> etc.). It's been on my list of things to do to investigate anygui,
> however - http://anygui.sourceforge.net - which would appear to solve
> our problems but might require a substantial refactoring of the
> matplotlib backends.
>
> If you want full GUI control, you can embed matplotlib in your own GUI
> application, following one of the many embedding_in_*.py examples in
> the examples subdirectory of the matplotlib src distribution.
>
> If you come up with example code for your backend, please post it to
> the list.
>
> JDH
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jdh...@ac...> - 2004年12月15日 22:52:32
>>>>> "Eli" == Eli Glaser <eg...@se...> writes:
 Eli> Hello, Is there an easy way to set the initial position of a
 Eli> Figure? I'm using Windows XP and new figures seem to pop up
 Eli> in the typical Windows fashion where subsequent figures
 Eli> appear about 20 pixels down and 20 pixels to the right of
 Eli> previous figures. How can I tell each figure where to pop up
 Eli> on screen?
matplotlib doesn't provide explicit support for this, but it is
possible. What backend are you using. The matplotlib Figure is
embedded in a FigureCanvas which is typically a GUI widget embedded in
a GUI Window. In the pylab interface, the canvas is managed by a
FigureManager, which has a window attribute on most of the backends.
Eg for the GTK backend, for example, you could do
 from pylab import *
 import gtk
 figure(1)
 plot([1,2,3])
 manager = get_current_fig_manager()
 # see gtk.Window class docs at
 # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html
 manager.window.set_position(gtk.WIN_POS_CENTER)
 figure(2)
 plot([1,2,3])
 manager = get_current_fig_manager()
 # see gtk.Window class docs at
 # http://www.pygtk.org/pygtk2reference/class-gtkwindow.html
 manager.window.set_position(gtk.WIN_POS_NONE)
 show()
For the WX* backend, manager.window is a wxFrame -
http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_wxframe.html#wxframe
For the TkAgg backend, manager.window is a Tkinter.Tk instance -
http://starship.python.net/crew/fredrik/tkclass/ClassToplevel.html
Off the top of my head I don't know the right incantation for each
backend, but hopefully the classdocs I referenced above will help.
Perhaps Todd or Matthew can chime in with more Tk and WX information.
While this arrangement may be suboptimal, we are resisting the urge to
become a GUI library. The temptations to abstract GUI functions for
use in matplotlib are many, and we are trying to keep this to a
manageable core (some event handling, some basic window management,
etc.). It's been on my list of things to do to investigate anygui,
however - http://anygui.sourceforge.net - which would appear to solve
our problems but might require a substantial refactoring of the
matplotlib backends.
If you want full GUI control, you can embed matplotlib in your own GUI
application, following one of the many embedding_in_*.py examples in
the examples subdirectory of the matplotlib src distribution.
If you come up with example code for your backend, please post it to
the list.
JDH
From: Eli G. <eg...@se...> - 2004年12月15日 18:46:14
Hello,
Is there an easy way to set the initial position of a Figure? I'm using
Windows XP and new
figures seem to pop up in the typical Windows fashion where subsequent
figures appear about
20 pixels down and 20 pixels to the right of previous figures. How can I
tell each figure where to
pop up on screen?
Thanks,
Eli
From: Nadia D. <den...@st...> - 2004年12月15日 14:50:48
Attachments: setupext.py
This is a warning to Solaris users - matplotlib 0.65 fails at runtime
with fatal relocation error. The problem was fixed in setupext.py in 
CVS,
(attached also to this message).
Nadia Dencheva
From: Mike R. <Rig...@UT...> - 2004年12月14日 20:27:05
Hey Folks, 
We are having a bear of a time installing matplotlib into Python2.3 on 
Solaris9-sparc.
The issues arises from "fatal: relocation error"s coming up when attempting 
to run matplotlib demos...but instead of getting into the details of this 
error, I want to simply ask.
Has anyone successfully installed and run matplotlib on Solaris 9 (or any 
other version) sparc?
If so, how did you build and install it? What version of gcc (or CC if 
that's the case), what switches, ETC?
With thanks in advance!
Mike
From: John H. <jdh...@ac...> - 2004年12月14日 19:13:46
>>>>> "Axel" == Axel Kowald <ko...@mo...> writes:
 Axel> Hi, I'm new to matplotlib and I have a question regarding
 Axel> axes. Once I created some axes (either with the axes()
 Axel> command or with subplot() ), how can I later find out the
 Axel> limits (left bottom, width, height) of the axes ? Maybe
 7 >>> ax = subplot(111)
 8 >>> ax.get_position()
 Out[8]: [0.125, 0.10999999999999999, 0.77500000000000002, 0.79000000000000004]
You can change these values with ax.set_position. This works whether
ax is an Axes or Subplot instance.
 Axel> some trick with get() ? Btw. is there somewhere a list of
 Axel> properties that I can get/set with get() or set() ?
A timely question. This feature was just added in the last release,
0.65
 >>> set(ax) # lists all settable properties
 >>> get(ax) # lists all properties and their values
Works for any matplotlib artist or sequence of artists; see
http://matplotlib.sf.net/examples/set_and_get.py
This is still a work in progress - the introspection works in part by
examining doc strings and I have finished porting all the artist
docstrings to the new format. set(artist) should return a list of all
properties and their legal settable values. If the settable values is
listed as unknown, it means I haven't done that docstring yet.
Also, I'm working on implementing Perry's suggestion of returning
silent lists where appropriate, which will help in pretty printing the
output, eg, of get(ax).
But it's mostly functional, as is.
JDH
From: John H. <jdh...@ac...> - 2004年12月14日 18:36:01
These notes, with links, can be read at
http://matplotlib.sf.net/whats_new.html.
 - matlab namespace renamed pylab - see
 http://matplotlib.sf.net/matplotlib_to_pylab.py for details on
 conversion. ipython pylab users should grab version 0.6.6. You
 can import the matlab interface (now known as pylab interface) with
 from pylab import blah # OK
 from matplotlib.pylab import blah # OK
 from matplotlib.matlab import blah # Deprecated
 - contouring with the contour function!! Thanks to Nadia Dencheva.
 See examples/contour_demo.py
 - matlab compatible set and get introspection to determine settable
 properties and their values. See examples/set_and_get.py. Sample
 usage
 >>> lines = plot([1,2,3]) 
 >>> set(lines)
 alpha: float
 antialiased or aa: [True | False]
 ...snip lots more...
 >>> get(lines)
 alpha = 1.0
 antialiased or aa = True
 ...snip lots more...
 - Added many new matlab compatible colormaps - autumn bone cool
 copper flag gray hot hsv jet pink prism spring summer winter -
 Thanks Perry!
 - zorder to artists to control drawing order of lines, patches and
 text in axes. See examples/zorder_demo.py 
 - mathtext in cairo backend. Also, printing now works to file
 object. Thanks Steve Chaplin.
 - printing in WX - Matthew Newville contributed a print button and
 preview for the wx backends. He also, who graciously volunteered
 to be the new wx backend maintainer.
 - matlab interface functions connect and disconnect replace
 mpl_connect and mpl_disconnect for event handling
 - Pass hold=True|False to any plotting command to override the
 current hold setting. The original hold setting will be restored
 at the end of the plot function
 - all text instances now have a bbox property which is a dict of
 Rectangle properties. If set, the text instance will display in a
 rectanglular bounding box. Example usage
 
 title('hi mom', bbox={'facecolor':'r', 'alpha':0.5})
 - legend properties now exposed as kwargs. See help(legend)
 - ishold to inspect the hold state
 - new plotting functions spy, spy2 for matrix sparsity visualization
 - pylab interface functions rgrids and thetagrids for customizing
 the grid locations and labels for polar plots - see
 examples/polar_demo.py.
 - add ion, ioff and isinteractive to pylab interface for control of
 interactive mode. See updated discussion at
 http://matplotlib.sf.net/interactive.html
Bugs fixed - 
 - Fixed colorbar bug with scatter - JDH
 - SVG clipping problem - Thanks Norm Peterson
 - numerous small legend bugs fixed
 - zoom to rect works with reversed axis limits - thanks Gregory
 - fontsizing problem fixes, ps plots correctly sized, landscape
 support for ps output
 - smaller, leaner, meaner PS output - Thanks Jochen
 - make the Gtk backends build without an X-server connection -
 Thanks Jochen
 
Downloads at http://matplotlib.sf.net
JDH
From: Axel K. <ko...@mo...> - 2004年12月14日 16:19:58
Hi,
I'm new to matplotlib and I have a question regarding axes.
Once I created some axes (either with the axes() command or with 
subplot() ), how can I later find out the limits (left bottom, width, 
height) of the axes ?
Maybe some trick with get() ?
Btw. is there somewhere a list of properties that I can get/set with 
get() or set() ?
 Many thanks,
 Axel
From: John H. <jdh...@ac...> - 2004年12月14日 15:56:36
>>>>> "Ted" == Ted Drain <ted...@jp...> writes:
 Ted> At least where I work, our style guidelines make it a little
 Ted> more verbose. I need to use descriptive variable names (for
The new short names were meant for easy, interactive use, to minimize
the number of keystrokes. For scripts, especially if you have verbose
coding guidelines, I suggest you use the functions that are already
defined in the matplotlib __init__ file
 import matplotlib
 b = matplotlib.is_interactive()
 matplotlib.interactive(False)
 ....your plot commands here....
 matplotlib.interactive(b)
The short names call these functions, anyhow.
Note that this discussion may be moot, because when writing plotting
functions I rarely use the drawing commands of the pylab interface
since these are by and large wrappers of other methods, eg Axes
methods. Since only the pylab plotting commands trigger the
draw_if_interactive method, you can safely do things like
 ax.plot([1,2,3])
 ax.set_xlabel('time')
 ax.set_title('this is a test')
 ax.grid(True)
w/o worrying about the interactive setting.
JDH
From: Ted D. <ted...@jp...> - 2004年12月13日 22:47:54
John,
There probably isn't a compulsive argument for either way of doing it. The 
stack method is a very common graphics programming method for handling 
context switches, rotations, etc. Most graphics systems use the idea of 
pushing and popping from a graphics context stack so you can do rotations 
and transformations inside a subroutine w/o messing up anything else.
At least where I work, our style guidelines make it a little more 
verbose. I need to use descriptive variable names (for maintainability) 
and no one line if statements (which cause problems whenever you need to 
add debugging print or other statements). Here's the difference between 
the methods with an additional option thrown in:
-------------
Option 1) push/pop
ipush()
try:
 [ ... plot ... ]
finally:
 ipop()
-------------
Option 2) flags
restoreInteractive = isinteractive()
ioff()
try:
 [ ... plot ... ]
finally:
 if restoreInteractive:
 ion()
-------------
Option 3) set/get method
interactiveOn = isinteractive()
ioff()
try:
 [ ... plot ... ]
finally:
 setinteractive( interactiveOn )
Ted
At 12:50 PM 12/13/2004, John Hunter wrote:
>Hi Ted,
>
>I hadn't thought of using a stack. What is the argument for a stack
>as opposed to a single state manipulated along the lines of (with try
>except as needed)
>
> b = isinteractive()
> ioff()
> ....your plot here...
> if b: ion()
>
>Your approach requires one fewer line of code. Are their other
>advantages to a stack approach? I think a stack may be slightly less
>intuitive to a typical user, whereas turning drawing mode on and off
>is fairly straight forward.
>
>JDH
> >>>>> "Ted" == Ted Drain <ted...@jp...> writes:
>
> Ted> John, I think the push/pop functions are going to be fairly
> Ted> useful (ipush and ipop??). We're going to be writing a lot
> Ted> scripts (i.e. functions) that generate plots for our users.
> Ted> There is no way to tell inside the script if it's going to be
> Ted> used by a user in interactive mode or by another script (like
> Ted> a batch report generator). Having push/pop would let me do:
>
> Ted> def stdPlot( [inputs] ): ipush( False ) try: [ create plot ]
> Ted> finally: ipop()
>
> Ted> Of course it's pretty easy to roll your own but I think it
> Ted> would be nice to have it in the standard set of commands.
>
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://productguide.itmanagersjournal.com/
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Fernando P. <Fer...@co...> - 2004年12月13日 21:39:03
Hi all,
[I'm taking the liberty to announce this here, as many scipy/matplotlib users 
are also ipython users, and this release includes changes coordinated with the 
new matplotlib release, coming very soon. Sorry for those getting duplicates 
if you are on all these lists.]
I'm glad to announce the release of IPython 0.6.6. IPython's homepage is at:
http://ipython.scipy.org
and downloads are at:
http://ipython.scipy.org/dist
I've provided RPMs (Py2.2 and 2.3), plus source downloads (.tar.gz and .zip).
Debian, Fink and BSD packages for this version should be coming soon, as the
respective maintainers (many thanks to Jack Moffit, Andrea Riciputi and Dryice
Liu) have the time to follow their packaging procedures.
Many thanks to Enthought for their continued hosting support for IPython, and
to all the users who contributed ideas, fixes and reports.
Release notes
-------------
This release was made to fix a few crashes recently found by users, and also
to keep compatibility with matplotlib, whose internal namespace structure was
recently changed.
* Adapt to matplotlib's new name convention, where the matlab-compatible
module is called pylab instead of matlab. The change should be transparent to
all users, so ipython 0.6.6 will work both with existing matplotlib versions
(which use the matlab name) and the new versions (which will use pylab instead).
* Don't crash if pylab users have a non-threaded pygtk and they attempt to use
the GTK backends. Instead, print a decent error message and suggest a few
alternatives.
* Improved printing of docstrings for classes and instances. Now, class,
constructor and instance-specific docstrings are properly distinguished and
all printed. This should provide better functionality for matplotlib.pylab
users, since matplotlib relies heavily on class/instance docstrings for
end-user information.
* New timing functionality added to %run. '%run -t prog' will time the
execution of prog.py. Not as fancy as python's timeit.py, but quick and easy
to use. You can optionally ask for multiple runs.
* Improved (and faster) verbose exeptions, with proper reporting of dotted
variable names (this had been broken since ipython's beginnings).
* The IPython.genutils.timing() interface changed, now the repetition number
is not a parameter anymore, fixed to 1 (the most common case). timings()
remains unchanged for multiple repetitions.
* Added ipalias() similar to ipmagic(), and simplified their interface. They
now take a single string argument, identical to what you'd type at the ipython
command line. These provide access to aliases and magics through a python
function call, for use in nested python code (the special alias/magic syntax
only works on single lines of input).
* Fix an obscure crash with recursively embedded ipythons at the command line.
* Other minor fixes and cleanups, both to code and documentation.
The NEWS file can be found at http://ipython.scipy.org/NEWS, and the full
ChangeLog at http://ipython.scipy.org/ChangeLog.
Enjoy, and as usual please report any problems.
Regards,
Fernando.
_______________________________________________
IPython-dev mailing list
IPy...@sc...
http://scipy.net/mailman/listinfo/ipython-dev
From: John H. <jdh...@ac...> - 2004年12月13日 20:52:43
>>>>> "Ted" == Ted Drain <ted...@jp...> writes:
 Ted> John, I think the push/pop functions are going to be fairly
 Ted> useful (ipush and ipop??). We're going to be writing a lot
 Ted> scripts (i.e. functions) that generate plots for our users.
 Ted> There is no way to tell inside the script if it's going to be
 Ted> used by a user in interactive mode or by another script (like
 Ted> a batch report generator). Having push/pop would let me do:
 Ted> def stdPlot( [inputs] ): ipush( False ) try: [ create plot ]
 Ted> finally: ipop()
 Ted> Of course it's pretty easy to roll your own but I think it
 Ted> would be nice to have it in the standard set of commands.
Hi Ted, 
I hadn't thought of using a stack. What is the argument for a stack
as opposed to a single state manipulated along the lines of (with try
except as needed)
 b = isinteractive()
 ioff()
 ....your plot here...
 if b: ion()
Your approach requires one fewer line of code. Are their other
advantages to a stack approach? I think a stack may be slightly less
intuitive to a typical user, whereas turning drawing mode on and off
is fairly straight forward.
JDH
From: Perry G. <pe...@st...> - 2004年12月13日 20:10:08
On Dec 13, 2004, at 2:57 PM, Ted Drain wrote:
> John,
> I think the push/pop functions are going to be fairly useful (ipush 
> and ipop??). We're going to be writing a lot scripts (i.e. functions) 
> that generate plots for our users. There is no way to tell inside the 
> script if it's going to be used by a user in interactive mode or by 
> another script (like a batch report generator). Having push/pop would 
> let me do:
>
> def stdPlot( [inputs] ):
> ipush( False )
> try:
> [ create plot ]
> finally:
> ipop()
>
> Of course it's pretty easy to roll your own but I think it would be 
> nice to have it in the standard set of commands.
>
Yes, this was exactly the kind of usage I was envisioning. In other 
words,
I don't care what mode the user is using, I want this to run in 
"noninteractive"
mode (according to its current meaning), but I don't want to screw up 
their
state.
Perry
From: Ted D. <ted...@jp...> - 2004年12月13日 19:58:17
John,
I think the push/pop functions are going to be fairly useful (ipush and 
ipop??). We're going to be writing a lot scripts (i.e. functions) that 
generate plots for our users. There is no way to tell inside the script if 
it's going to be used by a user in interactive mode or by another script 
(like a batch report generator). Having push/pop would let me do:
def stdPlot( [inputs] ):
 ipush( False )
 try:
 [ create plot ]
 finally:
 ipop()
Of course it's pretty easy to roll your own but I think it would be nice to 
have it in the standard set of commands.
At 05:54 AM 12/12/2004, John Hunter wrote:
> >>>>> "Perry" == Perry Greenfield <pe...@st...> writes:
>
> Perry> In thinking about the ioff(), ion() approach it occurs to
> Perry> me that it may not be quite so simple for scripts. I think
> Perry> a common desire is for a script or function to turn off
> Perry> interactive mode if it is on, but at the end, restore the
> Perry> previous interactive state. In this case a push/pop
> Perry> approach to interactive mode may be more appropriate rather
> Perry> than stop/start. In particular, if interactive mode
> Perry> happended to be off, you wouldn't want to turn it on at the
> Perry> end of the script.
>
>BTW, Eric emailed me off list. It appears that running his script in
>interactive mode was the root cause of his performance problems.
>
>In regards to running scripts from the python shell, I think the least
>invasive approach is to write a run function that stores the
>interactive state, calls ioff, runs the script with execfile, then
>calls ion (precisely what ipython does). In fact, perhaps we should
>add a run function to the pylab interface which does just this.
>Fernando could simply override this function if he wants to do some
>additional ipython magic. But this would wrap the logic for those who
>want to run scripts from the other python shell. Of course it would
>only work for non-image backends and Tk, or GUI backends associated
>with a GUI shell like pycrust.
>
>I'm less worried about people inadvertently running scripts from the
>command shell with interactive set to True, because interactive
>defaults to False in rc and thus the person would have had to
>intentionally change it, at least at some point in dark history.
>Hence they are probably aware of it. Singing the praises of ipython
>yet again, I leave the default in my rc to False, and run ipython when
>I want to work interactively, letting ipython turn interaction on for
>me. Thus I can run python somescript.py from the command shell assured
>that it is off, and still use matplotlib interactively w/o having to
>tweak the setting.
>
>But if there is some concern for users who would like to leave
>interactive on in rc (eg they like to use the standard python shell or
>some other shell) and still be able to get the efficiency when running
>scripts from the command shell, it might be possible to inspect
>whether we are in a running in a python shell, and plug this
>additional information into draw_if_interactive. Something like
>
>def draw_if_interactive():
> if running_in_python_shell() and matplotlib.is_interactive():
> canvas.draw()
>
>Anyone know how to determine whether you are running code in a python
>shell versus running a script, eg from a command shell?
>
>It occurs to me that "interactive" is not really the best name for
>this matplotlib state. Really we want something that conveys
>"draw_after_every_plot_command". When I named it, I was assuming that
>when working interactively you would want to update with every plot
>command, but have learned that this is not always the case. Do you
>think it's worth coming up with new names (isdraw(),
>draw_always(True/False), etc, while preserving the old names for a
>while with deprecation)? Because that's what we're really doing,
>controlling the drawing.
>
>JDH
>
>
>
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://productguide.itmanagersjournal.com/
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Ted Drain Jet Propulsion Laboratory ted...@jp... 
From: Delbert D. F. <iq...@so...> - 2004年12月13日 17:48:55
On Thursday 09 December 2004 03:22 pm, John Hunter wrote:
> >>>>> "Delbert" == Delbert D Franz <iq...@so...> writes:
> 
> Delbert> After downloading and installing these two packages all
> Delbert> but date_demo_rrule.py completed properly. The error in
> Delbert> this case was an unknown name "rand". A check of the
> Delbert> Python Library reference stated it was obsolete. I
> Delbert> replaced it with random.randrange but got another error,
> Delbert> an assertion error apparently on the y value. Being
> Delbert> somewhat new to Python and even newer to matplotlib I
> Delbert> gave up on that demo.
> 
> Delbert> Perhaps someone else can test date_demo_rrule.py and see
> Delbert> what happens. It is always a good thing when demos in
> Delbert> fact run!
> 
> True! But all of these demos do run for me. I suggest you flush your
> existing matplotlib by removing site-packages/matplotlib and your
> "build" directory and reinstall from the official source at
> http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=281218.
> Please follow the instructions at
> http://matplotlib.sourceforge.net/installing.html, eg make sure you
> have numeric or numarray installed when you compile matplotlib.
> 
After a bit of pondering and one false start (one compile failed because
it could not find some item related to GTK) I got matplotlib compiled for
the Tkinter backend only. It is the only one I'm interested in right now
anyway. 
An update to the .matplotlibrc file solved the problem of seeking the GTKAgg 
backend which was not there and we were off to the races. All of the date
examples completed without a hitch. A quite gratifying result! Apparently 
the Debian package I downloaded had some problems.
One of the biggest challenges was translating short forms of software names
into the package names used on the Debian package site-just one of those
realities of the great world of open-source software. Not everyone uses
the same descriptive name for the same entity. 
> Let us know if you have more troubles, and please include a full
> traceback from one of the date demos and run it with
> 
> > python date_demo1.py --verbose-helpful
> 
> and report the output.
> 
> 
> Delbert> I am also testing under MS Windows and the dateutils and
> Delbert> pytz files came with that install but none of the example
> Delbert> files came. Not sure why they are not included in the
> Delbert> *.exe installer.
> 
> It's a distutils thing. Suggestions here welcome.
> 
> JDH
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now. 
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
From: John H. <jdh...@ac...> - 2004年12月13日 17:44:48
>>>>> "seberino" == seberino <seb...@sp...> writes:
 seberino> I'm using pcolor. All z values looked the same color.
 seberino> It may be a my fault (my bug) if you say colors should
 seberino> be different. I'll try your customizations too.
 seberino> Does clim work with pcolor?
There may be a problem with colormapping/clim in 0.64, but these are
all fixed in the next release of matplotlib, due out today. I just
tested
 1 >>> Z = rand(10,10)*20000 + 40000
 2 >>> pcolor(Z)
 Out[2]: <matplotlib.collections.PolyCollection instance at 0x41d3cf4c>
 3 >>> colorbar
 ----> colorbar()
 Out[3]: <matplotlib.axes.Axes instance at 0x41d3624c>
 4 >>> clim(30000,80000)
and everything worked as expected.
JDH
From: <seb...@sp...> - 2004年12月13日 17:04:01
I'm using pcolor. All z values looked the same color. It may
be a my fault (my bug) if you say colors should be different.
I'll try your customizations too.
Does clim work with pcolor?
CS
On Mon, Dec 13, 2004 at 09:23:51AM -0600, John Hunter wrote:
> >>>>> "seberino" == seberino <seb...@sp...> writes:
>
> seberino> The z-axis values that I want to denote with color on
> seberino> this plot range from something like 57000 to 66000.
>
> seberino> I think I somehow need to tell Matplotlib what these
> seberino> minimum and maximum values are so that my color spectrum
> seberino> can range over desired colors for my specific plotting
> seberino> range.
>
> seberino> How do this? (How make 57000 be one color extreme and
> seberino> make 66000 be my other color extreme?)
>
> What plotting function are you using, imshow, pcolor, scatter, etc?
> The matplotlib color mapping and scaling will handle this
> automatically. It assigns 57000 to the first color on your colormap
> and 66000 to the last color, with interpolation between. There are a
> variety of ways to customize this
>
> # vmin is 57000 but vmax is changed
> >>> imshow(X, vmax=70000)
>
> # vmin is 66000 but vmin is changed
> >>> imshow(X, vmin=50000)
>
>
> # vmin and vmax both customized
> >>> imshow(X, vmax=50000, vmax=70000)
>
> Once you've plotted your data, you can use the clim function to set
> the color limits
>
> >>> clim(55000, 60000)
>
> Should help,
> JDH
>
--
_______________________________________
Christian Seberino, Ph.D.
SPAWAR Systems Center San Diego
Code 2872
49258 Mills Street, Room 158
San Diego, CA 92152-5385
U.S.A.
Phone: (619) 553-9973
Fax : (619) 553-6521
Email: seb...@sp...
_______________________________________
From: John H. <jdh...@ac...> - 2004年12月13日 15:26:20
>>>>> "seberino" == seberino <seb...@sp...> writes:
 seberino> The z-axis values that I want to denote with color on
 seberino> this plot range from something like 57000 to 66000.
 seberino> I think I somehow need to tell Matplotlib what these
 seberino> minimum and maximum values are so that my color spectrum
 seberino> can range over desired colors for my specific plotting
 seberino> range.
 seberino> How do this? (How make 57000 be one color extreme and
 seberino> make 66000 be my other color extreme?)
What plotting function are you using, imshow, pcolor, scatter, etc?
The matplotlib color mapping and scaling will handle this
automatically. It assigns 57000 to the first color on your colormap
and 66000 to the last color, with interpolation between. There are a
variety of ways to customize this
 # vmin is 57000 but vmax is changed
 >>> imshow(X, vmax=70000)
 # vmin is 66000 but vmin is changed
 >>> imshow(X, vmin=50000)
 # vmin and vmax both customized
 >>> imshow(X, vmax=50000, vmax=70000)
Once you've plotted your data, you can use the clim function to set
the color limits
 >>> clim(55000, 60000)
Should help,
JDH
From: Steve C. <ste...@ya...> - 2004年12月13日 09:38:11
On Sun, 2004年12月12日 at 22:14 -0800, seb...@sp... wrote:
> The z-axis values that I want to denote with color on this
> plot range from something like 57000 to 66000.
> 
> I think I somehow need to tell Matplotlib what these minimum
> and maximum values are so that my color spectrum can range over
> desired colors for my specific plotting range.
> 
> How do this? (How make 57000 be one color extreme and make
> 66000 be my other color extreme?)
> 
> Chris
By normalising 57000 to 0 and 66000 to 1 and using a custom colormap
function to generate rgb values to feed into matplotlib.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52273
I was looking at this cookbook recipe yesterday, it looks like it does
what you require.
Steve
From: Alan G I. <ai...@am...> - 2004年12月13日 06:21:39
On 2004年12月12日, John Hunter apparently wrote:
> We've taken pains to protect against multiple calls to show. If you
> can provide a script which replicates the problem. Please test
> against the latest matplotlib, preferably the next release, due out
> tomorrow barring the unexpected (which is never expected).
Will do.
Thank you,
Alan Isaac
From: Alan G I. <ai...@am...> - 2004年12月13日 06:21:38
>> Somewhat related: can I control the order in which figures
>> are displayed when the show() command is given, or will the
>> highest numbered figure always display on top?
On 2004年12月12日, John Hunter apparently wrote:
> This may be backend dependent, I haven't tested it. But if it is the
> highest figure on top you should be in good shape, right?, because you
> can provide the figure numbers in the order you want the figures
> to appear, bottom to top.
i. This is not a huge deal, as it seems to be manageable
just as you say.
ii. However, as I add to a script to illustrate more
issues, which should come later in a presentation,
this implies renumbering all the figures. Not ideal.
iii. So it seems the opposite of the current convention 
would be an improvement: show figure 1 last, so that it
is "on top" in a presentation. This would be my first
preference.
iv. Or, could show take an argument---a tuple of
numbers determining the order for the figures to appear.
This would be my 2nd preference.
fwiw,
Alan Isaac
From: <seb...@sp...> - 2004年12月13日 06:14:15
The z-axis values that I want to denote with color on this
plot range from something like 57000 to 66000.
I think I somehow need to tell Matplotlib what these minimum
and maximum values are so that my color spectrum can range over
desired colors for my specific plotting range.
How do this? (How make 57000 be one color extreme and make
66000 be my other color extreme?)
Chris
--
_______________________________________
Christian Seberino, Ph.D.
SPAWAR Systems Center San Diego
Code 2872
49258 Mills Street, Room 158
San Diego, CA 92152-5385
U.S.A.
Phone: (619) 553-9973
Fax : (619) 553-6521
Email: seb...@sp...
_______________________________________
4 messages has been excluded from this view by a project administrator.

Showing results of 219

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