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


Showing 12 results of 12

From: Brendan B. <bre...@br...> - 2014年07月30日 23:10:29
On 2014年07月30日 14:51, Eric Firing wrote:
> On 2014年07月30日, 7:26 AM, Benjamin Root wrote:
>> There is no --pylab for that.
>
> I don't know what development version you are using, but for 2.1.0, it
> is still there--and it does what needs to be done.
	He was talking about the normal Python interpreter, not IPython.
-- 
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is 
no path, and leave a trail."
 --author unknown
From: Eric F. <ef...@ha...> - 2014年07月30日 21:52:02
On 2014年07月30日, 7:26 AM, Benjamin Root wrote:
> There is no --pylab for that.
I don't know what development version you are using, but for 2.1.0, it 
is still there--and it does what needs to be done.
From: Fernando P. <fpe...@gm...> - 2014年07月30日 18:49:31
On Wed, Jul 30, 2014 at 10:26 AM, Nathan Goldbaum <nat...@gm...>
wrote:
> Pylab is going to be removed in IPython 3.0 (in fact it's already gone in
> master) since it has several bad interactions with the rest of the
> numpy/scipy universe and leads to un-reproducible code.
Quick clarifications:
- `--pylab` as a command-line flag is strongly discouraged and we will
likely remove it (having it in that location requires really awkward
special-case code everywhere). But we'll probably keep the %pylab magic
indefinitely, since it's useful for quick-and-dirty command-line work where
you don't care about namespace pollution, just about minimizing typing and
namespace access for convenience.
- The %matplotlib magic can also be used without args, case in which it
works like %pylab used to, and will pick up the user's default backend:
In [1]: %matplotlib
Using matplotlib backend: TkAgg
In [2]: import matplotlib.pyplot as plt
In [3]: plt.plot([1,2,3])
Out[3]: [<matplotlib.lines.Line2D at 0x4b90ed0>]
Cheers
f
-- 
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
From: Matthew B. <mat...@gm...> - 2014年07月30日 17:36:09
Hi,
On Wed, Jul 30, 2014 at 10:26 AM, Nathan Goldbaum <nat...@gm...> wrote:
> You would use "%matplotlib inline" if you want the plots to show up inline
> in the notebook. If you want to use one of the gui backends, it would be
> "%matplotlib <backend>". More detail here:
>
> http://ipython.org/ipython-doc/2/api/generated/IPython.core.magics.pylab.html#IPython.core.magics.pylab.PylabMagics.matplotlib
>
> Pylab is going to be removed in IPython 3.0 (in fact it's already gone in
> master) since it has several bad interactions with the rest of the
> numpy/scipy universe and leads to un-reproducible code. See this blog post
> for more detail on why using pylab is a bad idea:
>
> https://carreau.github.io/posts/10-No-PyLab-Thanks.ipynb.html
I personally use the IPython console for my just-checking interactive
work, rather than the notebook.
Checking now, '%matplotlib inline' in the console raises an error,
understandably enough, but this works:
%matplotlib osx
import matplotlib.pyplot as plt
plt.plot(range(10))
I know that's what you said, it's just to give a complete snippet for Googlers,
Cheers,
Matthew
From: Benjamin R. <ben...@ou...> - 2014年07月30日 17:29:18
right, thank you, it is "inline", not "interactive". I really need a memory
upgrade...
Cheers!
Ben Root
On Wed, Jul 30, 2014 at 1:26 PM, Nathan Goldbaum <nat...@gm...>
wrote:
> You would use "%matplotlib inline" if you want the plots to show up inline
> in the notebook. If you want to use one of the gui backends, it would be
> "%matplotlib <backend>". More detail here:
>
>
> http://ipython.org/ipython-doc/2/api/generated/IPython.core.magics.pylab.html#IPython.core.magics.pylab.PylabMagics.matplotlib
>
> Pylab is going to be removed in IPython 3.0 (in fact it's already gone in
> master) since it has several bad interactions with the rest of the
> numpy/scipy universe and leads to un-reproducible code. See this blog post
> for more detail on why using pylab is a bad idea:
>
> https://carreau.github.io/posts/10-No-PyLab-Thanks.ipynb.html
>
>
> On Wed, Jul 30, 2014 at 10:19 AM, Matthew Brett <mat...@gm...>
> wrote:
>
>> Hi,
>>
>> On Wed, Jul 30, 2014 at 9:30 AM, Benjamin Root <ben...@ou...> wrote:
>> > I think it is mostly an issue with how IPython interfaces with
>> matplotlib.
>> > If you were running from a pure python prompt, then I would suspect it
>> to
>> > work (haven't tried myself, though). Note that the --pylab option to
>> ipython
>> > is now highly discouraged. Instead, I would try the "%matplotlib
>> > interactive" cell magic instead (I think that is the right incantation).
>>
>> Sorry for being slightly off-topic, but what is the current
>> recommendation then for interactive plots from the console, if --pylab
>> is discouraged?
>>
>> Cheers,
>>
>> Matthew
>>
>>
>> ------------------------------------------------------------------------------
>> Infragistics Professional
>> Build stunning WinForms apps today!
>> Reboot your WinForms applications with our WinForms controls.
>> Build a bridge from your legacy apps to the future.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
From: Nathan G. <nat...@gm...> - 2014年07月30日 17:26:46
You would use "%matplotlib inline" if you want the plots to show up inline
in the notebook. If you want to use one of the gui backends, it would be
"%matplotlib <backend>". More detail here:
http://ipython.org/ipython-doc/2/api/generated/IPython.core.magics.pylab.html#IPython.core.magics.pylab.PylabMagics.matplotlib
Pylab is going to be removed in IPython 3.0 (in fact it's already gone in
master) since it has several bad interactions with the rest of the
numpy/scipy universe and leads to un-reproducible code. See this blog post
for more detail on why using pylab is a bad idea:
https://carreau.github.io/posts/10-No-PyLab-Thanks.ipynb.html
On Wed, Jul 30, 2014 at 10:19 AM, Matthew Brett <mat...@gm...>
wrote:
> Hi,
>
> On Wed, Jul 30, 2014 at 9:30 AM, Benjamin Root <ben...@ou...> wrote:
> > I think it is mostly an issue with how IPython interfaces with
> matplotlib.
> > If you were running from a pure python prompt, then I would suspect it to
> > work (haven't tried myself, though). Note that the --pylab option to
> ipython
> > is now highly discouraged. Instead, I would try the "%matplotlib
> > interactive" cell magic instead (I think that is the right incantation).
>
> Sorry for being slightly off-topic, but what is the current
> recommendation then for interactive plots from the console, if --pylab
> is discouraged?
>
> Cheers,
>
> Matthew
>
>
> ------------------------------------------------------------------------------
> Infragistics Professional
> Build stunning WinForms apps today!
> Reboot your WinForms applications with our WinForms controls.
> Build a bridge from your legacy apps to the future.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Benjamin R. <ben...@ou...> - 2014年07月30日 17:26:41
There is no change to the recommendations for interactive plots from the
console, if by console you mean the normal python REPL. There is no --pylab
for that. If you mean from the IPython console, then it is the cell magic I
mentioned previously.
On Wed, Jul 30, 2014 at 1:19 PM, Matthew Brett <mat...@gm...>
wrote:
> Hi,
>
> On Wed, Jul 30, 2014 at 9:30 AM, Benjamin Root <ben...@ou...> wrote:
> > I think it is mostly an issue with how IPython interfaces with
> matplotlib.
> > If you were running from a pure python prompt, then I would suspect it to
> > work (haven't tried myself, though). Note that the --pylab option to
> ipython
> > is now highly discouraged. Instead, I would try the "%matplotlib
> > interactive" cell magic instead (I think that is the right incantation).
>
> Sorry for being slightly off-topic, but what is the current
> recommendation then for interactive plots from the console, if --pylab
> is discouraged?
>
> Cheers,
>
> Matthew
>
From: Matthew B. <mat...@gm...> - 2014年07月30日 17:20:10
Hi,
On Wed, Jul 30, 2014 at 9:30 AM, Benjamin Root <ben...@ou...> wrote:
> I think it is mostly an issue with how IPython interfaces with matplotlib.
> If you were running from a pure python prompt, then I would suspect it to
> work (haven't tried myself, though). Note that the --pylab option to ipython
> is now highly discouraged. Instead, I would try the "%matplotlib
> interactive" cell magic instead (I think that is the right incantation).
Sorry for being slightly off-topic, but what is the current
recommendation then for interactive plots from the console, if --pylab
is discouraged?
Cheers,
Matthew
From: Benjamin R. <ben...@ou...> - 2014年07月30日 16:30:58
I think it is mostly an issue with how IPython interfaces with matplotlib.
If you were running from a pure python prompt, then I would suspect it to
work (haven't tried myself, though). Note that the --pylab option to
ipython is now highly discouraged. Instead, I would try the "%matplotlib
interactive" cell magic instead (I think that is the right incantation).
On Wed, Jul 30, 2014 at 2:15 AM, JBB <jea...@gm...> wrote:
> On 7/29/14, 10:49 PM, Eric Firing wrote:
> > On 2014年07月29日, 7:04 PM, JBB wrote:
> >> Hello,
> >>
> >> I am relatively new to Python, numpy, matplotlib, etc., with a
> >> reasonable amount of Matlab experience.
>
> ...[ Problem and test code trimmed ]
>
> >
> > First, at least initially for this sort of thing, run in "ipython
> > --pylab", and don't use any "ion()" or "ioff()".
> >
> > Second, replace the "show(); time.sleep(1)" with "pause(1)".
> >
> > I think that will do it.
> >
> > Eric
> >
>
> Thank you, very much. It did indeed work.
>
> Is there a pointer to why this worked when my initial approach did not?
> I thought from the documentation/videos that preparing a plot with
> relevant commands then issuing the show() command was the preferred
> approach within Python/Matplotlib.
>
> JBB
>
>
>
>
>
> ------------------------------------------------------------------------------
> Infragistics Professional
> Build stunning WinForms apps today!
> Reboot your WinForms applications with our WinForms controls.
> Build a bridge from your legacy apps to the future.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: JBB <jea...@gm...> - 2014年07月30日 06:16:17
On 7/29/14, 10:49 PM, Eric Firing wrote:
 > On 2014年07月29日, 7:04 PM, JBB wrote:
 >> Hello,
 >>
 >> I am relatively new to Python, numpy, matplotlib, etc., with a
 >> reasonable amount of Matlab experience.
...[ Problem and test code trimmed ]
 >
 > First, at least initially for this sort of thing, run in "ipython
 > --pylab", and don't use any "ion()" or "ioff()".
 >
 > Second, replace the "show(); time.sleep(1)" with "pause(1)".
 >
 > I think that will do it.
 >
 > Eric
 >
Thank you, very much. It did indeed work.
Is there a pointer to why this worked when my initial approach did not? 
 I thought from the documentation/videos that preparing a plot with 
relevant commands then issuing the show() command was the preferred 
approach within Python/Matplotlib.
JBB
From: Eric F. <ef...@ha...> - 2014年07月30日 05:49:54
On 2014年07月29日, 7:04 PM, JBB wrote:
> Hello,
>
> I am relatively new to Python, numpy, matplotlib, etc., with a
> reasonable amount of Matlab experience.
>
> I am trying to do some simple array visualizations before moving on to
> specific work.
>
> e.g. I have a 5x5x10 array and I'd like to see each 5x5 piece as a
> "frame" with a short pause in between. I realize there are animation
> methods and such but I think the code below ought to work and don't
> understand what I'm getting.
>
> Expect: A figure window with the first 5x5 piece of the array, a short
> pause, a new figure window overwriting the old one with the second 5x5
> piece, and so on. Equivalent code in Matlab does this.
>
> Result: Figure window opens, nothing gets drawn in it, there's a pause,
> the window closes, and another window opens in the same location with
> nothing in it, and so on.
>
> If I refresh the kernel, create the 3D array, and manually show one
> slice, it works. As soon as I run the loop, all I get from then on is
> blank windows whether I do it within a loop or type the matshow, show
> commands.
>
> This happens in iPython with and without the notebook interface.
>
> I'm trying to understand Matplotlib in some detail and am watching the
> SciPy2014 videos along with RTFM.
> https://www.youtube.com/watch?v=A2adyFMsut0 et.seq.
>
> So far, I've come up empty in figuring out what I'm doing wrong.
>
> I have Python 2.7.8/Anaconda 2.0.1
>
> Thanks,
>
> JBB
> ===== Test code
>
> import numpy as np
> from matplotlib.pylab import *
> import time as time
>
> # Create a 3D array of "frames"
> A = np.random.rand(5,5,10)
>
> #Turn on interactive mode
> ion()
> # Turn off interactive mode
> # ioff()
>
> # Attempt to show each frame with a short delay between frames
> for k in range(10):
> matshow(A[:,:,k])
> show()
> time.sleep(1)
> close()
>
First, at least initially for this sort of thing, run in "ipython 
--pylab", and don't use any "ion()" or "ioff()".
Second, replace the "show(); time.sleep(1)" with "pause(1)".
I think that will do it.
Eric
>
> ------------------------------------------------------------------------------
> Infragistics Professional
> Build stunning WinForms apps today!
> Reboot your WinForms applications with our WinForms controls.
> Build a bridge from your legacy apps to the future.
> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: JBB <jea...@gm...> - 2014年07月30日 05:10:12
Hello,
I am relatively new to Python, numpy, matplotlib, etc., with a 
reasonable amount of Matlab experience.
I am trying to do some simple array visualizations before moving on to 
specific work.
e.g. I have a 5x5x10 array and I'd like to see each 5x5 piece as a 
"frame" with a short pause in between. I realize there are animation 
methods and such but I think the code below ought to work and don't 
understand what I'm getting.
Expect: A figure window with the first 5x5 piece of the array, a short 
pause, a new figure window overwriting the old one with the second 5x5 
piece, and so on. Equivalent code in Matlab does this.
Result: Figure window opens, nothing gets drawn in it, there's a pause, 
the window closes, and another window opens in the same location with 
nothing in it, and so on.
If I refresh the kernel, create the 3D array, and manually show one 
slice, it works. As soon as I run the loop, all I get from then on is 
blank windows whether I do it within a loop or type the matshow, show 
commands.
This happens in iPython with and without the notebook interface.
I'm trying to understand Matplotlib in some detail and am watching the 
SciPy2014 videos along with RTFM.
https://www.youtube.com/watch?v=A2adyFMsut0 et.seq.
So far, I've come up empty in figuring out what I'm doing wrong.
I have Python 2.7.8/Anaconda 2.0.1
Thanks,
JBB
===== Test code
import numpy as np
from matplotlib.pylab import *
import time as time
# Create a 3D array of "frames"
A = np.random.rand(5,5,10)
#Turn on interactive mode
ion()
# Turn off interactive mode
# ioff()
# Attempt to show each frame with a short delay between frames
for k in range(10):
 matshow(A[:,:,k])
 show()
 time.sleep(1)
 close()

Showing 12 results of 12

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