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




Showing 21 results of 21

From: Lars M. <moe...@gm...> - 2011年05月30日 21:58:42
Wonderful, thanks - that was far too easy to be 
thought of :)
Cheers,
Nix
On 05/30/2011 05:21 AM, Benjamin Root wrote:
> > On Monday, May 30, 2011, Mondsuechtiger<el_...@gm...> wrote:
>> >> -----BEGIN PGP SIGNED MESSAGE-----
>> >> Hash: SHA1
>> >>
>> >>
>> >> Hello,
>> >>
>> >> I would like to stack subplots in a figure with a couple of basic
>> >> x,y-line plots with the subplot frames removed.
>> >> But possible overlap of subplots is limited, because the drawn data
>> >> lines are clipped on the border, if you'd lets say manually reset the
>> >> ylims and decrease it below the highest data y-values.
>> >> I know it is possible with any kind of text or data annotation, but do
>> >> not find a way to let the data lines cross the frame border.
You can cross the Axes frame border by turning off clipping:
ll = plot([-1, 1])[0]
axis([0.1, 0.95, -1, 1])
ll.set_clip_on(False)
draw()
Eric
>> >>
>> >> I hope I made myself halfway clear - pls. don't hesitate to ask if not.
>> >> Does one of you possibly have a solution or is it maybe plain
>> >> impossible?
>> >> Thanks!
>> >>
>> >> Cheers,
>> >> Nix
> >
> > Maybe you want to use matplotlib's spine feature? You are right that
> > you can't plot outside the plotable region, but maybe you can emulate
> > what you want by moving the axes lines into the plottable region.
> >
> > I hope that helps!
> >
> > Ben Root
> >
From: Benjamin R. <ben...@ou...> - 2011年05月30日 20:30:36
On Mon, May 30, 2011 at 3:11 PM, Eric O LEBIGOT (EOL) <
Eri...@no...> wrote:
>
>
> efiring wrote:
> >
> > Is it correct that you want interactive mode, except that you want to
> > control when drawing occurs, for purposes of efficiency?
> Thank you for your interest in this question, Eric!
>
> The goal is to indeed control when drawing occurs, but also to not use
> show() (because it cumbersome to have to close umpteen windows so as to
> finish a Matplotlib program that opened lots of figures). (I checked the
> examples that you referred to)
>
> It looks like Matplotlib forces either to use the interactive mode
> (possibly
> inefficient) or to use show() (possibly cumbersome). I wish that
> Matplotlib
> offers an alternative to this situation, but this looks less and less to be
> the case. That's something I would like to suggest to the devs.
> :-)
>
Question: would displaying a figure (or a group of figures), pausing to let
you close them, and then continuing to the next figures more along the lines
of what you want? That is certainly possible with matplotlib. Since
v1.0.0, multiple calls to show() is allowed (although you may need v1.0.1
for certain backends to do this correctly).
Furthermore, I think Eric Firing's point was that mpl is fully capable of
doing what you want. The automatic draws are only done if the calls come
through pyplot or pylab and if interactive mode is on. There might be a few
minor exceptions to this rule, but those shouldn't cause significant
overhead. If you call the drawing commands directly, then a refresh does
not occur until you tell it to with a call to draw(). In pyplot, nearly all
drawing commands have as the final step a call to a function called
"draw_if_interactive()". This function does exactly what it says.
Therefore, if you want interactive mode, but do not want a refresh after
each pyplot command, then don't use the pyplot commands! Just use the
objects' drawing commands (which is what pyplot calls).
Also, note that matplotlib is hierarchical. You could call directly call
draw() on each object you want re-drawn, but you don't have to. You can
give a single call to a parent object that would call draw() for all of its
children objects. So, a figure object has (among other things) axes objects
as children. An axes object has (among other things) various collection
objects from the plotting commands as its children. Maybe a look at some of
the animation examples might be a good way to illustrate this. I would
suggest looking at the older animation examples on sourceforge where the
internals are all laid out.
I hope this is helpful,
Ben Root
From: Jason G. <jas...@cr...> - 2011年05月30日 20:16:41
In the docs for Line2D, it says that the linestyle can be "any drawstyle 
in combination with a linestyle, e.g. 'steps--'." However, this doesn't 
seem to work in practice. I believe I have matplotlib 1.0.1 here:
In [2]: from matplotlib import lines
In [3]: line=lines.Line2D([0,1,2],[0,1,4], linestyle='steps--')
In [4]: line.get_drawstyle()
Out[4]: 'default'
In [5]: line.get_linestyle()
Out[5]: '--'
Note that if I specifically set the linestyle using set_linestyle, it 
appears to parse out the drawstyle:
In [11]: line.set_linestyle('steps--')
In [12]: line.get_drawstyle()
Out[12]: 'steps'
However, if I plot the line using the plot() command, the drawstyle is 
correctly set to 'steps'.
In [6]: from matplotlib import pyplot
In [7]: line2=pyplot.plot([0,1,2],[0,1,4], linestyle='steps--')
In [8]: line2
Out[8]: [<matplotlib.lines.Line2D object at 0x114fcb110>]
In [9]: line2[0].get_drawstyle()
Out[9]: 'steps'
In [10]: line2[0].get_linestyle()
Out[10]: '--'
Should Line2D parse out the drawstyle from the linestyle, or are the 
docs wrong about the Line2D linestyle parameters, or am I just 
misunderstanding something here?
Thanks,
Jason
From: Eric O L. (EOL) <Eri...@no...> - 2011年05月30日 20:11:34
efiring wrote:
> 
> Is it correct that you want interactive mode, except that you want to 
> control when drawing occurs, for purposes of efficiency?
Thank you for your interest in this question, Eric!
The goal is to indeed control when drawing occurs, but also to not use
show() (because it cumbersome to have to close umpteen windows so as to
finish a Matplotlib program that opened lots of figures). (I checked the
examples that you referred to)
It looks like Matplotlib forces either to use the interactive mode (possibly
inefficient) or to use show() (possibly cumbersome). I wish that Matplotlib
offers an alternative to this situation, but this looks less and less to be
the case. That's something I would like to suggest to the devs.
:-)
-- 
View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31735322.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: jgrub <jon...@we...> - 2011年05月30日 19:46:14
Hello,
im currently working on data analysis with matplotlib
and have some problems with the useage of the mousebuttons when using the
ginput() function 
i actually have a long sequence of data on which i want to achiece 4 linear
regressions,
so my idea was to plot the data and choose the data points with help of
ginput(8) so i can choose 8 points between which the data gets evaluated the
problem is the big size of data so i have to zoom in and out between
choosing 2 points.
my problem is that the ginput function interprets the zoom in clicks as
choosing a point from my data,
i already tried to override the left mouse button to the ride button but it
seems to me that it is online 
possible to switch the button configuration so that i have the mouse_pop
function on the left mouse button and the mouse_pop function on the right
side, but this doesnt help me either since each data point gets erased when
i zoom in 
thanks for your help so far
-- 
View this message in context: http://old.nabble.com/ginput%28%29-mouse--button-assignment-tp31735320p31735320.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2011年05月30日 18:38:44
On Mon, May 30, 2011 at 1:12 PM, Eric Firing <ef...@ha...> wrote:
> On 05/30/2011 05:21 AM, Benjamin Root wrote:
> > On Monday, May 30, 2011, Mondsuechtiger<el_...@gm...> wrote:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >>
> >> Hello,
> >>
> >> I would like to stack subplots in a figure with a couple of basic
> >> x,y-line plots with the subplot frames removed.
> >> But possible overlap of subplots is limited, because the drawn data
> >> lines are clipped on the border, if you'd lets say manually reset the
> >> ylims and decrease it below the highest data y-values.
> >> I know it is possible with any kind of text or data annotation, but do
> >> not find a way to let the data lines cross the frame border.
>
> You can cross the Axes frame border by turning off clipping:
>
> ll = plot([-1, 1])[0]
> axis([0.1, 0.95, -1, 1])
> ll.set_clip_on(False)
> draw()
>
> Eric
>
>
>
Ah, I see. I have to turn the clipping attribute off for the object(s)
being plotted, not for the axes object. I learned something new today...
Ben Root
From: Eric F. <ef...@ha...> - 2011年05月30日 18:12:46
On 05/30/2011 05:21 AM, Benjamin Root wrote:
> On Monday, May 30, 2011, Mondsuechtiger<el_...@gm...> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>>
>> Hello,
>>
>> I would like to stack subplots in a figure with a couple of basic
>> x,y-line plots with the subplot frames removed.
>> But possible overlap of subplots is limited, because the drawn data
>> lines are clipped on the border, if you'd lets say manually reset the
>> ylims and decrease it below the highest data y-values.
>> I know it is possible with any kind of text or data annotation, but do
>> not find a way to let the data lines cross the frame border.
You can cross the Axes frame border by turning off clipping:
ll = plot([-1, 1])[0]
axis([0.1, 0.95, -1, 1])
ll.set_clip_on(False)
draw()
Eric
>>
>> I hope I made myself halfway clear - pls. don't hesitate to ask if not.
>> Does one of you possibly have a solution or is it maybe plain
>> impossible?
>> Thanks!
>>
>> Cheers,
>> Nix
>
> Maybe you want to use matplotlib's spine feature? You are right that
> you can't plot outside the plotable region, but maybe you can emulate
> what you want by moving the axes lines into the plottable region.
>
> I hope that helps!
>
> Ben Root
>
From: Eric F. <ef...@ha...> - 2011年05月30日 18:01:10
On 05/30/2011 06:42 AM, Eric O LEBIGOT (EOL) wrote:
>
>
> Benjamin Root-2 wrote:
>>
>> On Monday, May 30, 2011, Eric O LEBIGOT (EOL)
>>> I wish that Matplotlib provided a mechanism for bypassing show(), because
>>> show() is actually not my friend. :-) In fact, with show(), I hate
>>> having
>>> to close one by one each of the 12 figures that my script creates each
>>> time
>>> I run it.
>>>
>>> (...)
>>> stopping a program that was fully or partially in run in non-interactive
>>> mode, without having to use this dreaded show()...
>>> (...)
>>
>> I am not sure exactly what feature you are asking for. If you are in
>> interactive mode, you could setup a key binding to call a function to
>> close all figures. Another route to go is to take advantage of
>> subplots and reduce the number of figures you need to have.
>>
> The keybinding idea is interesting, but the goal is to work in
> *non*-interactive mode (for optimization purposes), and the feature I would
> love is simply to be able to display graphs in this mode without using
> show(). Subplots are unfortunately not an option for me, as each of the
> numerous graph must be independent (they are each saved in a specific file).
Is it correct that you want interactive mode, except that you want to 
control when drawing occurs, for purposes of efficiency? If so, use 
interactive mode, but instead of using the pyplot interface for the 
actual plotting, use the OO interface, and call plt.draw() when you want 
to update a plot. See
http://matplotlib.sourceforge.net/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related
although this does not give precisely the example to match your case.
Eric
>
>
> Benjamin Root-2 wrote:
>>
>> Also, it bares repeating. You may be experiencing some bugs with
>> interactive mode in v1.0.0. Some very important bugfixes were made
>> wrt interactive mode for the v1.0.1 release. I know the sourceforge
>> page still points to v1.0.0, that is a problem that I hope to have
>> fixed later in the next few days.
>>
> Thanks, I'll definitely check out version 1.0.1. The feature I wish existed
> is unfortunately relevant to the *non*-interactive mode.
>
From: C M <cmp...@gm...> - 2011年05月30日 16:43:33
I do not know the first thing about Python language.....But things are not
> going well
That's not a "but" but an "of course". How could they possibly go well
already?
It takes time to learn something. You will get there, bit by bit.
> and I do not want to use any other
> programs such as GNUplot or other such open source programs which run on
> my linux machine and I am not purchasing any anything developed by
> Micro$oft.
>
I'm curious. Why not?
> I have come to a road block and need guidance regarding what materials
> (e.g. books) I should purchase to help teach myself python/mathplolib or
> how I should move forward to become proficient use mpl?
>
For Python, there are tons of online tutorials such as Alan Gauld's as well
as any
number of books (Google for recommendations or search the Python Google
Group
for very many iterations of asking for recommendations).
For specific questions, the Python tutor list is great, and now Stack
Overflow is also
very good. For specific Matplotlib questions beyond the tutorial or
examples, either
SO or this list is excellent. There is now a matplotlib book by Sandro Tosi,
too.
> I know little or nothing now so any newbie advice is much appreciated.
>
I recommend that you write down a set of goals for what you want to
accomplish,
and then tackle them one by one.
From: Eric O L. (EOL) <Eri...@no...> - 2011年05月30日 16:42:21
Benjamin Root-2 wrote:
> 
> On Monday, May 30, 2011, Eric O LEBIGOT (EOL)
>> I wish that Matplotlib provided a mechanism for bypassing show(), because
>> show() is actually not my friend. :-) In fact, with show(), I hate
>> having
>> to close one by one each of the 12 figures that my script creates each
>> time
>> I run it.
>>
>> (...)
>> stopping a program that was fully or partially in run in non-interactive
>> mode, without having to use this dreaded show()...
>> (...)
> 
> I am not sure exactly what feature you are asking for. If you are in
> interactive mode, you could setup a key binding to call a function to
> close all figures. Another route to go is to take advantage of
> subplots and reduce the number of figures you need to have.
> 
The keybinding idea is interesting, but the goal is to work in
*non*-interactive mode (for optimization purposes), and the feature I would
love is simply to be able to display graphs in this mode without using
show(). Subplots are unfortunately not an option for me, as each of the
numerous graph must be independent (they are each saved in a specific file).
Benjamin Root-2 wrote:
> 
> Also, it bares repeating. You may be experiencing some bugs with
> interactive mode in v1.0.0. Some very important bugfixes were made
> wrt interactive mode for the v1.0.1 release. I know the sourceforge
> page still points to v1.0.0, that is a problem that I hope to have
> fixed later in the next few days.
> 
Thanks, I'll definitely check out version 1.0.1. The feature I wish existed
is unfortunately relevant to the *non*-interactive mode.
-- 
View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31734671.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2011年05月30日 15:58:51
On Monday, May 30, 2011, Eric O LEBIGOT (EOL)
<Eri...@no...> wrote:
>
>
> Benjamin Root-2 wrote:
>>
>> On Monday, May 30, 2011, Eric O LEBIGOT (EOL)
>> <Eri...@no...> wrote:
>>>
>>> Benjamin Root-2 wrote:
>>> So, if anything is drawn when interactive mode is off, does one *have* to
>>> use show() at the end? in other words does using a single raw_input() at
>>> the end of the program force the use of the interactive mode for *all*
>>> figures? (Closing all the figures with a simple "enter" is very
>>> convenient,
>>> but having a performance penalty for this would not be so nice...).
>>>
>>
>> Yes, if interactive mode is off, and you want to view the figures, you
>> need show(). No, the raw_input does nothing in either case.
>>
>>> Now, if I understand you correctly, I have another question. I don't
>>> understand anymore what draw() does: in fact, it is not necessary in
>>> interactive mode, and it does not appear to do anything in
>>> non-interactive
>>> mode, since show() is really the function that really displays the
>>> figures.
>>> So, why does matplotlib offer draw()? what does it really do?
>>>
>>
>> The draw() command is used for some more advanced features such as
>> animations and widgets, as well as for internal use. I rarely use
>> draw() in my scripts.
>>
> Thank you for the follow up.
>
> I wish that Matplotlib provided a mechanism for bypassing show(), because
> show() is actually not my friend. :-) In fact, with show(), I hate having
> to close one by one each of the 12 figures that my script creates each time
> I run it.
>
> The Matplotlib documentation indeed lists many ways to use Matplotlib.
> However, I was trying to get beyond "recipes" and to get a deeper
> understanding of what Matplotlib does, so as to avoid wasting too much time
> when trying to do something that is not in one of those recipes. Like
> stopping a program that was fully or partially in run in non-interactive
> mode, without having to use this dreaded show()...
>
> Thank you again for your input. It is good to know the limitations of
> Matplotlib. Maybe it is time to suggest the feature I mentioned to the dev
> list??
I am not sure exactly what feature you are asking for. If you are in
interactive mode, you could setup a key binding to call a function to
close all figures. Another route to go is to take advantage of
subplots and reduce the number of figures you need to have.
Also, it bares repeating. You may be experiencing some bugs with
interactive mode in v1.0.0. Some very important bugfixes were made
wrt interactive mode for the v1.0.1 release. I know the sourceforge
page still points to v1.0.0, that is a problem that I hope to have
fixed later in the next few days.
Ben Root
> --
> View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31734191.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Eric O L. (EOL) <Eri...@no...> - 2011年05月30日 15:26:44
Benjamin Root-2 wrote:
> 
> On Monday, May 30, 2011, Eric O LEBIGOT (EOL)
> <Eri...@no...> wrote:
>>
>> Benjamin Root-2 wrote:
>> So, if anything is drawn when interactive mode is off, does one *have* to
>> use show() at the end? in other words does using a single raw_input() at
>> the end of the program force the use of the interactive mode for *all*
>> figures? (Closing all the figures with a simple "enter" is very
>> convenient,
>> but having a performance penalty for this would not be so nice...).
>>
> 
> Yes, if interactive mode is off, and you want to view the figures, you
> need show(). No, the raw_input does nothing in either case.
> 
>> Now, if I understand you correctly, I have another question. I don't
>> understand anymore what draw() does: in fact, it is not necessary in
>> interactive mode, and it does not appear to do anything in
>> non-interactive
>> mode, since show() is really the function that really displays the
>> figures.
>> So, why does matplotlib offer draw()? what does it really do?
>>
> 
> The draw() command is used for some more advanced features such as
> animations and widgets, as well as for internal use. I rarely use
> draw() in my scripts.
> 
Thank you for the follow up.
I wish that Matplotlib provided a mechanism for bypassing show(), because
show() is actually not my friend. :-) In fact, with show(), I hate having
to close one by one each of the 12 figures that my script creates each time
I run it.
The Matplotlib documentation indeed lists many ways to use Matplotlib. 
However, I was trying to get beyond "recipes" and to get a deeper
understanding of what Matplotlib does, so as to avoid wasting too much time
when trying to do something that is not in one of those recipes. Like
stopping a program that was fully or partially in run in non-interactive
mode, without having to use this dreaded show()...
Thank you again for your input. It is good to know the limitations of
Matplotlib. Maybe it is time to suggest the feature I mentioned to the dev
list??
-- 
View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31734191.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2011年05月30日 15:21:58
On Monday, May 30, 2011, Mondsuechtiger <el_...@gm...> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Hello,
>
> I would like to stack subplots in a figure with a couple of basic
> x,y-line plots with the subplot frames removed.
> But possible overlap of subplots is limited, because the drawn data
> lines are clipped on the border, if you'd lets say manually reset the
> ylims and decrease it below the highest data y-values.
> I know it is possible with any kind of text or data annotation, but do
> not find a way to let the data lines cross the frame border.
>
> I hope I made myself halfway clear - pls. don't hesitate to ask if not.
> Does one of you possibly have a solution or is it maybe plain
> impossible?
> Thanks!
>
> Cheers,
> Nix
Maybe you want to use matplotlib's spine feature? You are right that
you can't plot outside the plotable region, but maybe you can emulate
what you want by moving the axes lines into the plottable region.
I hope that helps!
Ben Root
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJN40aCAAoJEGQ1ZathkK0XWqcIALPWS0vLh/oCISWfHaeB7NaV
> 7GOJizENlvD+kwuj1z8fEpMHOM2WrKYPX9GBh7SPGzHR+cZIcpmz0yCa2QhdB2jl
> YSNLHjL1z33JZf+CMuMsn6iI5KEi8s1WIZGJhYTq5LCklPitvqu0qsT518BjWPMc
> 7pezJMmYPPBFFYsvSlemO2PMitfa4EIHCjufySWSoPSveTSS8VBT8IsRRhcxoUca
> YmngZ7JA8vqrkJjRKUys5lyLsuKfUehhCmp+XaU6FAJL13rTe340dbfbUxp3IWfd
> QyNcn+UHlWJtR9tPgC5NfndIGIx3O9/jmllqXTn47oLD3A3ekFG03UjGY6K1ccY=
> =HuCp
> -----END PGP SIGNATURE-----
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Benjamin R. <ben...@ou...> - 2011年05月30日 15:03:33
On Monday, May 30, 2011, Eric O LEBIGOT (EOL)
<Eri...@no...> wrote:
>
> Thank you for your response.
>
>
> Benjamin Root-2 wrote:
>>
>> On Sunday, May 29, 2011, Eric O LEBIGOT (EOL)
>> <Eri...@no...> wrote:
>>>
>>> What does ion() exactly do?
>>>$$$
>>> from matplotlib import pyplot as pp
>>>
>>> pp.plot([10, 20, 50])
>>> pp.draw()
>>>
>>> raw_input('Press enter...') # No graph displayed?!!
>>>$$$
>>
>> Turning interactive mode on also means an implied "show" command, if
>> needed. The first program can replace draw() with show(). However,
>> if interactive mode is off, then the python execution pauses. With it
>> on, python execution will continue.
>>
> So, if anything is drawn when interactive mode is off, does one *have* to
> use show() at the end? in other words does using a single raw_input() at
> the end of the program force the use of the interactive mode for *all*
> figures? (Closing all the figures with a simple "enter" is very convenient,
> but having a performance penalty for this would not be so nice...).
>
Yes, if interactive mode is off, and you want to view the figures, you
need show(). No, the raw_input does nothing in either case.
> Now, if I understand you correctly, I have another question. I don't
> understand anymore what draw() does: in fact, it is not necessary in
> interactive mode, and it does not appear to do anything in non-interactive
> mode, since show() is really the function that really displays the figures.
> So, why does matplotlib offer draw()? what does it really do?
>
The draw() command is used for some more advanced features such as
animations and widgets, as well as for internal use. I rarely use
draw() in my scripts.
May I suggest reading the FAQ and some of the example scripts on the
website in order to demonstrate the different ways to use mpl?
Ben Root
> EOL
>
> PS: Here is an example: the following code does *not* display the first
> figure (Matplotlib 1.0.0 on Mac OS X with the GTKAgg backend):
Off the top of my head, this is either a bug that has been fixed, or
is intended behavior. Turning interactive mode on after having made a
figure might be confusing pyplot. Calling show at anytime will
produce the intended behavior. show() is your friend.
> $$$
> from matplotlib import pyplot as pp
>
> pp.figure()
> pp.plot([10, 20, 50])
> pp.draw() # Will not be displayed despite the draw()
>
> pp.ion() # Interactive mode on
> pp.figure()
> pp.plot([100, 20, 10])
>
> raw_input('Press enter...') # Only the second graph is displayed
> $$$
> --
> View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31731176.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Darren D. <dsd...@gm...> - 2011年05月30日 14:46:39
Hi Corbin,
On Mon, May 30, 2011 at 10:09 AM, Corbin Fletcher <cef...@gm...> wrote:
> I am a college student and I want to be able to use matplotlib to plot
> publishing quality graphs
> and embed them into my pdf documents (all composed with latex) for
> college. This would give my documents a more professional look.
>
> I do not know the first thing about Python language. And I am only able
> to create a very simple pie graph by using and editing a script file
> from mpl's website.
>
> But things are not going well and I do not want to use any other
> programs such as GNUplot or other such open source programs which run on
> my linux machine and I am not purchasing any anything developed by
> Micro$oft.
>
> I have come to a road block and need guidance regarding what materials
> (e.g. books) I should purchase to help teach myself python/mathplolib or
> how I should move forward to become proficient use mpl?
>
> I know little or nothing now so any newbie advice is much appreciated.
I used matplotlib to generate publication-quality images for academic
literature and my dissertation. To get started, I recommend reading
"Learning Python" by Mark Lutz, which is a gentle intro to the
language. Then I would move on to either skimming through the
matplotlib documentation at
http://matplotlib.sourceforge.net/users/index.html , or looking
through some of the examples at
http://matplotlib.sourceforge.net/examples/index.html . The mathtext
support is pretty good, now that matplotlib implements the mathtext
layout algorithms, but if you are an advanced latexer, you may want to
look at the tex demo and usetex demos at the above examples website.
Darren
From: Daniel M. <dan...@go...> - 2011年05月30日 14:25:01
Hi Corbin,
it is pretty much impossible that you will get a reply here that helps
you to become a professional Python programmer from scratch without
asking a specific question :)
Please try to read some introductory courses and create your first
sample plots, and then ask. I am sure you will get answers then.
Best of luck -- and be assured that Python/Scipy/Numpy/Matplotlib is
indeed a perfect toolbox for astonishing, professional and versatile
data processing and plotting. I am using it for everything, from
simple calculations to severe data reduction and scientific plotting.
Daniel
> I am a college student and I want to be able to use matplotlib to plot
> publishing quality graphs
> and embed them into my pdf documents (all composed with latex) for
> college. This would give my documents a more professional look.
>
> I do not know the first thing about Python language. And I am only able
> to create a very simple pie graph by using and editing a script file
> from mpl's website.
>
> But things are not going well and I do not want to use any other
> programs such as GNUplot or other such open source programs which run on
> my linux machine and I am not purchasing any anything developed by
> Micro$oft.
>
> I have come to a road block and need guidance regarding what materials
> (e.g. books) I should purchase to help teach myself python/mathplolib or
> how I should move forward to become proficient use mpl?
>
> I know little or nothing now so any newbie advice is much appreciated.
>
> Thanks in advance.
>
>
>
>
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Corbin F. <cef...@gm...> - 2011年05月30日 14:10:07
I am a college student and I want to be able to use matplotlib to plot 
publishing quality graphs
and embed them into my pdf documents (all composed with latex) for 
college. This would give my documents a more professional look.
I do not know the first thing about Python language. And I am only able 
to create a very simple pie graph by using and editing a script file 
from mpl's website.
But things are not going well and I do not want to use any other 
programs such as GNUplot or other such open source programs which run on 
my linux machine and I am not purchasing any anything developed by 
Micro$oft.
I have come to a road block and need guidance regarding what materials 
(e.g. books) I should purchase to help teach myself python/mathplolib or 
how I should move forward to become proficient use mpl?
I know little or nothing now so any newbie advice is much appreciated. 
Thanks in advance.
 
From: Daniel M. <dan...@go...> - 2011年05月30日 12:18:25
Hi,
the content of the CSV is stored as an array after reading. You can
simply access rows and columns like in Matlab:
firstrow = a1[0]
firstcol = a1.T[0]
The .T transposes the array.
The second element of the third row would be
elem32 = a1[2][1]
which is equivalent to
elem32 = a1[2,1]
A range of e.g. rows 3 to 6 is
range36 = a1[2:6]
Please have a look here for getting started with scipy/numpy:
http://pages.physics.cornell.edu/~myers/teaching/ComputationalMethods/python/arrays.html
and
http://www.scipy.org/NumPy_for_Matlab_Users
Hope this helps,
Daniel
2011年5月27日 Karthikraja Velmurugan <vel...@gm...>:
> Hello Daniel,
>
> The code you have given is simple and works fab. Thank you very much. But I
> wasn't able to find an example which accesses the columns of a CSV files
> when I import data through "datafile="filename.csv"" option. It will be
> great if you could help with accessing individual columns. What excatly I am
> looking for is to access individual coulmns (of the same CSV file), do
> calculations using the two coumns and plot them into seperate subplots of
> the same graph.
> I modified the script a lil bit. Please find it below:
>
> import matplotlib.pyplot as plt
> import pylab
> datafile1 = 'ch1_s1_lrr.csv'
> datafile2 = 'ch1_s1_baf.csv'
> a1 = pylab.loadtxt(datafile1, comments='#', delimiter=';')
> b1 = pylab.loadtxt(datafile2, comments='#', delimiter=';')
> v1 = [0,98760,0,1]
> v2 = [0,98760,-2,2]
> plt.figure(1)
> plt.subplot(4,1,1)
> print 'loading', datafile1
> plt.axis(v2)
> plt.plot(a1, 'r.')
> plt.subplot(4,1,2)
> print 'loading', datafile2
> plt.axis(v1)
> plt.plot(b1, 'b.')
> plt.show()
>
> Thank you very much in advance for your time and suggestions.
>
> Karthik
From: Simon J. <sim...@gm...> - 2011年05月30日 08:46:10
Thank you for the info.
I added the issue to the github for now.
I will inspect the source whether there is an easy way to add subsetting 
of fonts for usetex=True case as well.
Simon
On 05/27/2011 05:02 PM, Michael Droettboom wrote:
> Ah, yes. That is all true. I'm not sure what options there may be in
> that case.
>
> Mike
>
> On 05/27/2011 10:56 AM, Simon Jesenko wrote:
>> Setting 'pdf.fonttype'=3 had no effect, embedded fonts are of fonttype=1
>> nonetheless. I guess that pdf.fonttype parameter is used only when
>> matplotlib uses it's own engine to render latex, and not when
>> text.usetex=true is used.
>>
>> Cairo backend is not support when text.usetex=true (only Agg, pdf and ps
>> according to documentation)
>>
>> On 05/27/2011 03:53 PM, Michael Droettboom wrote:
>>> Have you tried setting the rcParams "pdf.fonttype" to 3? That should
>>> subset the fonts.
>>>
>>> Also, the Cairo backend supports font subsetting.
>>>
>>> Mike
>>>
>>> On 05/27/2011 07:00 AM, Simon Jesenko wrote:
>>>> Hi,
>>>>
>>>> I have a problem with large file-sizes of plots saved to pdf, when using
>>>> rcParams['text.usetex']=True
>>>>
>>>> Files are very large (~150kb for simple line plot with some mathematical
>>>> latex expressions) as all fonts are fully embedded into pdf. When
>>>> resulting pdf is postprocessed (e.g. as is
>>>> http://zeppethefake.blogspot.com/2008/05/embedding-fonts-in-pdf-with-ghostscript.html),
>>>> so that only subset of fonts is embedded, file size is reduced
>>>> drastically(e.g. from 150kb to 15kb).
>>>>
>>>> Is there a way to enable embedding of subset of fonts in matplotlib?
>>>>
>>>> I am using matplotlib version 0.99.3.
>>>>
>>>> Did anyone else experience similar problems/found solution?
>>>>
>>>> Thank you for info/assistance!
>>>> Simon
>>>>
>>>> ------------------------------------------------------------------------------
>>>> vRanger cuts backup time in half-while increasing security.
>>>> With the market-leading solution for virtual backup and recovery,
>>>> you get blazing-fast, flexible, and affordable data protection.
>>>> Download your free trial now.
>>>> http://p.sf.net/sfu/quest-d2dcopy1
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> ------------------------------------------------------------------------------
>>> vRanger cuts backup time in half-while increasing security.
>>> With the market-leading solution for virtual backup and recovery,
>>> you get blazing-fast, flexible, and affordable data protection.
>>> Download your free trial now.
>>> http://p.sf.net/sfu/quest-d2dcopy1
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> ------------------------------------------------------------------------------
>> vRanger cuts backup time in half-while increasing security.
>> With the market-leading solution for virtual backup and recovery,
>> you get blazing-fast, flexible, and affordable data protection.
>> Download your free trial now.
>> http://p.sf.net/sfu/quest-d2dcopy1
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Eric O L. (EOL) <Eri...@no...> - 2011年05月30日 07:35:20
Thank you for your response.
Benjamin Root-2 wrote:
> 
> On Sunday, May 29, 2011, Eric O LEBIGOT (EOL)
> <Eri...@no...> wrote:
>>
>> What does ion() exactly do?
>>$$$
>> from matplotlib import pyplot as pp
>>
>> pp.plot([10, 20, 50])
>> pp.draw()
>>
>> raw_input('Press enter...') # No graph displayed?!!
>>$$$
> 
> Turning interactive mode on also means an implied "show" command, if
> needed. The first program can replace draw() with show(). However,
> if interactive mode is off, then the python execution pauses. With it
> on, python execution will continue.
> 
So, if anything is drawn when interactive mode is off, does one *have* to
use show() at the end? in other words does using a single raw_input() at
the end of the program force the use of the interactive mode for *all*
figures? (Closing all the figures with a simple "enter" is very convenient,
but having a performance penalty for this would not be so nice...).
Now, if I understand you correctly, I have another question. I don't
understand anymore what draw() does: in fact, it is not necessary in
interactive mode, and it does not appear to do anything in non-interactive
mode, since show() is really the function that really displays the figures. 
So, why does matplotlib offer draw()? what does it really do?
EOL
PS: Here is an example: the following code does *not* display the first
figure (Matplotlib 1.0.0 on Mac OS X with the GTKAgg backend):
$$$
from matplotlib import pyplot as pp
pp.figure()
pp.plot([10, 20, 50])
pp.draw() # Will not be displayed despite the draw()
pp.ion() # Interactive mode on
pp.figure()
pp.plot([100, 20, 10])
raw_input('Press enter...') # Only the second graph is displayed
$$$
-- 
View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31731176.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Mondsuechtiger <el_...@gm...> - 2011年05月30日 07:26:06
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I would like to stack subplots in a figure with a couple of basic
x,y-line plots with the subplot frames removed.
But possible overlap of subplots is limited, because the drawn data
lines are clipped on the border, if you'd lets say manually reset the
ylims and decrease it below the highest data y-values.
I know it is possible with any kind of text or data annotation, but do
not find a way to let the data lines cross the frame border.
I hope I made myself halfway clear - pls. don't hesitate to ask if not.
Does one of you possibly have a solution or is it maybe plain
impossible?
Thanks!
Cheers,
Nix
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJN40aCAAoJEGQ1ZathkK0XWqcIALPWS0vLh/oCISWfHaeB7NaV
7GOJizENlvD+kwuj1z8fEpMHOM2WrKYPX9GBh7SPGzHR+cZIcpmz0yCa2QhdB2jl
YSNLHjL1z33JZf+CMuMsn6iI5KEi8s1WIZGJhYTq5LCklPitvqu0qsT518BjWPMc
7pezJMmYPPBFFYsvSlemO2PMitfa4EIHCjufySWSoPSveTSS8VBT8IsRRhcxoUca
YmngZ7JA8vqrkJjRKUys5lyLsuKfUehhCmp+XaU6FAJL13rTe340dbfbUxp3IWfd
QyNcn+UHlWJtR9tPgC5NfndIGIx3O9/jmllqXTn47oLD3A3ekFG03UjGY6K1ccY=
=HuCp
-----END PGP SIGNATURE-----

Showing 21 results of 21

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