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




Showing 9 results of 9

From: Eric F. <ef...@ha...> - 2010年11月13日 18:06:47
On 11/13/2010 06:16 AM, Michiel de Hoon wrote:
> --- On Sat, 11/13/10, John Hunter<jd...@gm...> wrote:
>> Ie if we have a script like
>>
>> # some plotting commands
>> ...
>>
>> # some expensive non GUI computation
>> ...
>>
>> # some update to plot above
>> ...
>>
>> Would we not run the risk that the GUI is idle in the non
>> GUI computation and therefore trigger a draw in it's thread,
>> and then do redraws again after the update code?
>
> In the MacOSX backend, everything is single-threaded, so this won't occur.
>
> I am not sufficiently familiar with the non-MacOSX backends to give a detailed answer, but with multiple threads the "idle" refers to the Python thread being idle rather than the GUI thread being idle. In other words, when there are no more Python commands left to be handled, the GUI thread is notified that it should start redrawing.
>
In the gtk backend, draw_idle calls gobject.idle_add 
http://www.pygtk.org/pygtk2reference/gobject-functions.html#function-gobject--idle-add
Thus, "idle" means the gui event loop has no higher priority events. Is 
this condition reached only at the end of the script?
>> Are you proposing that we can get rid of the interactive setting
>> entirely, always call draw on pyplot commands, and let the
>> idle handler save us from doing repeated draws?
Reminder: the interactive setting controls draw_if_interactive, which is 
what we are talking about here, but also whether or not show() blocks. 
So we may not need draw_if_interactive, but unless we can dispense with 
show entirely, we will still need an interactive setting.
Returning to the issue raised by the OP, however, the question is 
whether the present MacOSX behavior (windows pop up) or the non-MacOSX 
behavior (they don't in non-interactive mode until/unless show() is 
called) is what we really want. It seems to me that we should preserve 
some way of getting this second behavior.
Eric
>
> Yes (I assume you mean to always call draw_idle on pyplot commands). If there are then still cases where we do get repeated draws, then that is a bug.
>
> Best,
> --Michiel.
>
From: Michiel de H. <mjl...@ya...> - 2010年11月13日 16:16:39
--- On Sat, 11/13/10, John Hunter <jd...@gm...> wrote:
> Ie if we have a script like
> 
>  # some plotting commands
>  ...
> 
>  # some expensive non GUI computation
>  ...
> 
>  # some update to plot above
>  ...
> 
> Would we not run the risk that the GUI is idle in the non
> GUI computation and therefore trigger a draw in it's thread,
> and then do redraws again after the update code?
In the MacOSX backend, everything is single-threaded, so this won't occur.
I am not sufficiently familiar with the non-MacOSX backends to give a detailed answer, but with multiple threads the "idle" refers to the Python thread being idle rather than the GUI thread being idle. In other words, when there are no more Python commands left to be handled, the GUI thread is notified that it should start redrawing.
> Are you proposing that we can get rid of the interactive setting
> entirely, always call draw on pyplot commands, and let the
> idle handler save us from doing repeated draws?
Yes (I assume you mean to always call draw_idle on pyplot commands). If there are then still cases where we do get repeated draws, then that is a bug.
Best,
--Michiel.
 
From: John H. <jd...@gm...> - 2010年11月13日 15:49:03
On Sat, Nov 13, 2010 at 9:23 AM, Michiel de Hoon <mjl...@ya...> wrote:
> Thanks for your reply.
> But nowadays drawing is done through draw_idle, so we don't trigger additional drawing even if interactive is True. In your example, if run as a script, there is no drawing until a call to show() is made, regardless of whether interactive is True or False.
I see. I wasn't appreciating your point and had neglected to consider
the idle drawing handling. Are we sure this will save us. Ie if we
have a scirpt like
 # some plotting commands
 ...
 # some expensive non GUI computation
 ...
 # some update to plot above
 ...
Would we not run the risk that the GUI is idle in the non GUI
computation and therefore trigger a draw in it's thread, and then do
redraws again after the update code? I did run some tests and
confirmed what you said, that with the idle handling the repeat calls
to pyplot commands did not generate extra calls (except in qtagg in
which I suspect the idle handling has not been implemented.
Are you proposing that we can get rid of the interactive setting
entirely, always call draw on pyplot commands, and let the idle
handler save us from doing repeated draws?
From: Michiel de H. <mjl...@ya...> - 2010年11月13日 15:23:29
Thanks for your reply.
But nowadays drawing is done through draw_idle, so we don't trigger additional drawing even if interactive is True. In your example, if run as a script, there is no drawing until a call to show() is made, regardless of whether interactive is True or False.
Best,
--Michiel.
--- On Sat, 11/13/10, John Hunter <jd...@gm...> wrote:
> From: John Hunter <jd...@gm...>
> Subject: Re: [Matplotlib-users] Mac OSX backend
> To: "Michiel de Hoon" <mjl...@ya...>
> Cc: "mdekauwe" <mde...@gm...>, mat...@li...
> Date: Saturday, November 13, 2010, 9:22 AM
> On Sat, Nov 13, 2010 at 7:46 AM,
> Michiel de Hoon <mjl...@ya...>
> wrote:
> > OK, thanks. With your example, I see a difference
> between the Mac OS X backend and the TKAgg/GtkAgg backend
> but only if interactive is False in matplotlibrc. If
> interactive is True, both the Mac OS X backend and the TkAgg
> backend open windows. Is this really the desired behavior?
> It seems counterintuitive that such a global parameter can
> determine whether a figure is opened or not.
> >
> > While we're on the topic, is this interactive
> parameter still needed in matplotlib? In my understanding,
> in older versions of matplotlib, interactive=False could
> significantly speed up some plots. But are there still any
> such cases with the current organization of the drawing code
> in matplotlib?
> 
> 
> Yes, this is the desired behavior. The interactive :
> True parameter
> is useful when working interactively from the shell, when
> want to do
> 
>  plt.figure()
>  plt.plot([1,2,3])
>  plt.xlabel('a label')
> 
> and have the figure show up on the figure call and update
> on the plot
> and xlabel call. This is most definitely not what you
> want to do in a
> script, because you don't want to pay for the draw until
> the end (when
> a call to show is made). This is discussed at
> 
>  http://matplotlib.sourceforge.net/users/shell.html
> 
> JDH
> 
 
From: John H. <jd...@gm...> - 2010年11月13日 14:22:48
On Sat, Nov 13, 2010 at 7:46 AM, Michiel de Hoon <mjl...@ya...> wrote:
> OK, thanks. With your example, I see a difference between the Mac OS X backend and the TKAgg/GtkAgg backend but only if interactive is False in matplotlibrc. If interactive is True, both the Mac OS X backend and the TkAgg backend open windows. Is this really the desired behavior? It seems counterintuitive that such a global parameter can determine whether a figure is opened or not.
>
> While we're on the topic, is this interactive parameter still needed in matplotlib? In my understanding, in older versions of matplotlib, interactive=False could significantly speed up some plots. But are there still any such cases with the current organization of the drawing code in matplotlib?
Yes, this is the desired behavior. The interactive : True parameter
is useful when working interactively from the shell, when want to do
 plt.figure()
 plt.plot([1,2,3])
 plt.xlabel('a label')
and have the figure show up on the figure call and update on the plot
and xlabel call. This is most definitely not what you want to do in a
script, because you don't want to pay for the draw until the end (when
a call to show is made). This is discussed at
 http://matplotlib.sourceforge.net/users/shell.html
JDH
From: Michiel de H. <mjl...@ya...> - 2010年11月13日 13:46:13
OK, thanks. With your example, I see a difference between the Mac OS X backend and the TKAgg/GtkAgg backend but only if interactive is False in matplotlibrc. If interactive is True, both the Mac OS X backend and the TkAgg backend open windows. Is this really the desired behavior? It seems counterintuitive that such a global parameter can determine whether a figure is opened or not.
While we're on the topic, is this interactive parameter still needed in matplotlib? In my understanding, in older versions of matplotlib, interactive=False could significantly speed up some plots. But are there still any such cases with the current organization of the drawing code in matplotlib?
Thanks,
--Michiel.
--- On Fri, 11/12/10, John Hunter <jd...@gm...> wrote:
> From: John Hunter <jd...@gm...>
> Subject: Re: [Matplotlib-users] Mac OSX backend
> To: "Michiel de Hoon" <mjl...@ya...>
> Cc: "mdekauwe" <mde...@gm...>, mat...@li...
> Date: Friday, November 12, 2010, 9:06 AM
> On Thu, Nov 11, 2010 at 7:32 PM,
> Michiel de Hoon <mjl...@ya...>
> wrote:
> > For this example, I am finding the exact same behavior
> with the Mac OS X backend as with the gtkcairo and gtkagg
> backends (on Mac OS X and Cygwin). If this is a bug, then
> which backend can we use as an example of the correct
> behavior for this code?
> 
> On a quick test, the following script
> 
>  import matplotlib.pyplot as plt
>  for i in range(4):
>    fig = plt.figure()
> 
> 
> (no show) run with -dTkAGG and -dGTKAgg, does not raise a
> figure
> window in svn HEAD. I thought the OP was complaining
> that the figure
> was being raised w/o a call to show in macosx (don't have
> ready access
> to test on an osx box right now)
> 
> JDH
> 
 
From: Michiel de H. <mjl...@ya...> - 2010年11月13日 11:36:04
I wasn't able to replicate this bug 
with the MacOS backend. 
--Michiel
On Sat Nov 13th, 2010 1:15 AM EST Jae-Joon Lee wrote:
>I cannot reproduce this with agg, ps and pdf backend.
>Maybe this bug is specific to the Mac oS X backend?
>
>Regards,
>
>-JJ
>
>
>On Sat, Nov 13, 2010 at 5:19 AM, Bror Jonsson <br...@bi...> wrote:
>>
>> Dear all,
>>
>> I must be doing something wrong, but it seems like the backgroundcolor statement for text just stopped working. I am using matplotlib 1.0.0 with MacOSX as backend on two different machines. If I run
>>
>> ipython -pylab
>>
>> text(0,0,'Kalle',backgroundcolor='0.6')
>>
>> I get this result:
>>
>>
>>
>> (The problem is that the text color switches to pale grey). This worked fine before. Does anyone else get this problem, and do you have any idea about how to trouble shoot it?
>>
>> Regards,
>>
>> Bror Jonsson
>> ------------------------------------------------------------------------------
>> Centralized Desktop Delivery: Dell and VMware Reference Architecture
>> Simplifying enterprise desktop deployment and management using
>> Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
>> client virtualization framework. Read more!
>> http://p.sf.net/sfu/dell-eql-dev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
>------------------------------------------------------------------------------
>Centralized Desktop Delivery: Dell and VMware Reference Architecture
>Simplifying enterprise desktop deployment and management using
>Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
>client virtualization framework. Read more!
>http://p.sf.net/sfu/dell-eql-dev2dev
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
From: Jae-Joon L. <lee...@gm...> - 2010年11月13日 06:15:55
I cannot reproduce this with agg, ps and pdf backend.
Maybe this bug is specific to the Mac oS X backend?
Regards,
-JJ
On Sat, Nov 13, 2010 at 5:19 AM, Bror Jonsson <br...@bi...> wrote:
>
> Dear all,
>
> I must be doing something wrong, but it seems like the backgroundcolor statement for text just stopped working. I am using matplotlib 1.0.0 with MacOSX as backend on two different machines. If I run
>
> ipython -pylab
>
> text(0,0,'Kalle',backgroundcolor='0.6')
>
> I get this result:
>
>
>
> (The problem is that the text color switches to pale grey). This worked fine before. Does anyone else get this problem, and do you have any idea about how to trouble shoot it?
>
> Regards,
>
> Bror Jonsson
> ------------------------------------------------------------------------------
> Centralized Desktop Delivery: Dell and VMware Reference Architecture
> Simplifying enterprise desktop deployment and management using
> Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
> client virtualization framework. Read more!
> http://p.sf.net/sfu/dell-eql-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2010年11月13日 06:09:06
With axisartist toolkit, no.
I may add a simple wrapper around matplotlit's original formatter classes.
Regards,
-JJ
On Thu, Nov 11, 2010 at 11:17 PM, Stefan Mauerberger
<ste...@mn...> wrote:
> Hi JJ,
>
> thanks a lot for your Answer. Now I have understand how this works and
> created my one formatter:
>
> class MyFormatter(object):
>  def __init__(self, fmt='$%f$'):
>      self.fmt = fmt
>  def __call__(self, direction, factor, values):
>      return [self.fmt % v for v in values]
>
> Is there something like this already in Matplotlib? I looked into
> axisartist but can not find anything similar.
>
> Regards
>
> Stefan
>
>
> On Thu, 2010年11月11日 at 09:38 +0900, Jae-Joon Lee wrote:
>> How do you want your ticklabels formatted?
>>
>> If axisartist does not provide a formatter that fits your need, you
>> can create a custom formatter.
>> Formatter for axisartist can be any callable object with following signature.
>>
>> def Formatter(direction, factor, values):
>>   # ...
>>   return list_of_string_that corresponds_to_values
>>
>> You may ignore direction and factor parameters for now.
>> For example,
>>
>> class MyFormatter(object):
>>   def __call__(self, direction, factor, values):
>>     _fmt = "$%.1f$"
>>     return [_fmt % v for v in values]
>>
>> then you could do
>>
>> grid_helper = floating_axes.GridHelperCurveLinear( tr, extremes=( 1, 2,
>> 1000, 2000 ), tick_formatter1 = None, tick_formatter2 = MyFormatter() )
>>
>> Regards,
>>
>> -JJ
>>
>>
>> On Wed, Nov 10, 2010 at 10:17 PM, Stefan Mauerberger
>> <ste...@mn...> wrote:
>> > Hello everyone,
>> >
>> > I have a question regarding the formatting of ticks in a curved
>> > coordinate system. To create my plots I am useing the
>> > mpl_toolkits.axisartist.floating_axes.GridHelperCurveLinear() function.
>> > This works quite well but I have difficulties with formatting the axis.
>> > I am working in a polar coordinate system. To format the longitudinal
>> > axis I found the function
>> > mpl_toolkits.axisartist.angle_helper.FormatterDMS() and it works good.
>> > But I want to chance the formatting of the radius too. For this I need
>> > to pass something to the kwargs tick_formatter2 of the function
>> > GridHelperCurveLinear but I do not know what.
>> >
>> > Could you give me some advice?
>> >
>> > Regards
>> >
>> > Stefan
>> >
>> > Here is the code I use:
>> >
>> > import matplotlib.pyplot as plt
>> > import mpl_toolkits.axisartist.floating_axes as floating_axes
>> > from  matplotlib.projections import PolarAxes
>> >
>> > fig = plt.figure()
>> >
>> > tr = PolarAxes.PolarTransform()
>> >
>> > grid_helper = floating_axes.GridHelperCurveLinear( tr, extremes=( 1, 2,
>> > 1000, 2000 ), tick_formatter1 = None, tick_formatter2 = None )
>> >
>> > ax1 = floating_axes.FloatingSubplot( fig, 111, grid_helper=grid_helper )
>> >
>> > fig.add_subplot( ax1 )
>> >
>> > ax1.grid( True )
>> >
>> > plt.show()
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > The Next 800 Companies to Lead America's Growth: New Video Whitepaper
>> > David G. Thomson, author of the best-selling book "Blueprint to a
>> > Billion" shares his insights and actions to help propel your
>> > business during the next growth cycle. Listen Now!
>> > http://p.sf.net/sfu/SAP-dev2dev
>> > _______________________________________________
>> > Matplotlib-users mailing list
>> > Mat...@li...
>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> >
>>
>
>

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