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




Showing results of 133

<< < 1 2 3 4 5 6 > >> (Page 4 of 6)
From: Clare S. <cla...@gm...> - 2013年04月12日 01:19:13
Hi Michiel,
I'm using GtkAgg. Please correct me if I'm wrong, but issue 531's problem
is with blitting, for me blitting works, I'm able to speed up plotting
using canvas.copy_from_bbox(), canvas.restore_region() & canvas.blit().
It's just that after plotting, if I try to pan or zoom using the pan/zoom
buttons on the navigation toolbar, whatever I've plotted disappears & the
whole thing becomes blank. I'm able to pan/zoom if I use canvas.draw() but
plotting is too slow because it redraws everything.
Regards,
Clare.
On Fri, Apr 12, 2013 at 8:22 AM, Michiel de Hoon <mjl...@ya...>wrote:
> Hi Clare,
>
> Which backend are you using, and can you show an example script?
>
> The blitting functions are a bit unusual as they try to draw stuff to the
> figure outside of the event loop. This is e.g. causing problems with
> animations, which makes use of the blitting functions. We have been looking
> at that recently (see https://github.com/matplotlib/matplotlib/issues/531)
> but we haven't come up with a solution yet. Solving this issue may also fix
> your problem (which sounds like an event loop problem), so you may want to
> follow issue 531.
>
> Best,
> -Michiel.
>
> --- On *Thu, 4/11/13, Clare Soh <cla...@gm...>* wrote:
>
>
> From: Clare Soh <cla...@gm...>
> Subject: [Matplotlib-users] Pan/Zoom can't work with blitting
> To: "mat...@li..." <
> mat...@li...>
> Date: Thursday, April 11, 2013, 5:19 AM
>
>
> Hi,
>
> To improve plotting speed, I decided
> to use blitting(canvas.copy_from_bbox(), canvas.restore_region() &
> canvas.blit()) instead of canvas.draw(), however panning & zooming stops
> working after this change. Now, when I click on the 'Pan/Zoom' button or
> the 'Zoom to rectangle' button on the Navigation Toolbar, my plot becomes
> empty. I don't know what's going wrong, can someone please point me in the
> right direction?
>
> Thank you,
> Clare.
>
> -----Inline Attachment Follows-----
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...<http://mc/compose?to=Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Michiel de H. <mjl...@ya...> - 2013年04月12日 00:22:37
Hi Clare,
Which backend are you using, and can you show an example script?
The blitting functions are a bit unusual as they try to draw stuff to the figure outside of the event loop. This is e.g. causing problems with animations, which makes use of the blitting functions. We have been looking at that recently (see https://github.com/matplotlib/matplotlib/issues/531) but we haven't come up with a solution yet. Solving this issue may also fix your problem (which sounds like an event loop problem), so you may want to follow issue 531.
Best,
-Michiel.
--- On Thu, 4/11/13, Clare Soh <cla...@gm...> wrote:
From: Clare Soh <cla...@gm...>
Subject: [Matplotlib-users] Pan/Zoom can't work with blitting
To: "mat...@li..." <mat...@li...>
Date: Thursday, April 11, 2013, 5:19 AM
Hi,
 
To improve plotting speed, I decided to use blitting(canvas.copy_from_bbox(), canvas.restore_region() & canvas.blit()) instead of canvas.draw(), however panning & zooming stops working after this change. Now, when I click on the 'Pan/Zoom' button or the 'Zoom to rectangle' button on the Navigation Toolbar, my plot becomes empty. I don't know what's going wrong, can someone please point me in the right direction?
 
Thank you,
Clare.
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
-----Inline Attachment Follows-----
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Clare S. <cla...@gm...> - 2013年04月11日 09:19:55
Hi,
To improve plotting speed, I decided
to use blitting(canvas.copy_from_bbox(), canvas.restore_region() &
canvas.blit()) instead of canvas.draw(), however panning & zooming stops
working after this change. Now, when I click on the 'Pan/Zoom' button or
the 'Zoom to rectangle' button on the Navigation Toolbar, my plot becomes
empty. I don't know what's going wrong, can someone please point me in the
right direction?
Thank you,
Clare.
From: Maximilian T. <fa...@tr...> - 2013年04月11日 07:04:51
Attachments: signature.asc
Hi,
for reading the data files you could user np.loadtxt("filename").
I'm not sure what kind of plot you want to create from this data, but
probably you can find an appropriate plotting method on this page:
http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html
Max
PS: Sorry for not sending my first mail to the list, but you can see it
below
Am 11/04/2013 04:54, schrieb Sayan Chatterjee:
> Thanks Maximillian for your help.
> 
> Could you please tell me how to surface plot with those data files using
> Matplotlib?...i.e both reading the data files and then surface plotting
> in matplotlib?
> 
> Sayan
> 
> 
> On 11 April 2013 02:25, Maximilian Trescher <fa...@tr...
> <mailto:fa...@tr...>> wrote:
> 
> Hi,
> >
> > *np.savetxt(fname, np.array([pp_za,pv_za]).T, '%f')*
> 
> does maybe
> 
> np.savetxt(fname, np.array([pp_za,pv_za, np.ones(1000)*t]).T, '%f')
> does what you want? (replace 1000 with approppriate length)
> 
> and a comment about:
> > if pp_za[i] < 0:
> > pp_za[i] = 2 - abs(pp_za[i])
> > if pp_za[i] > 2:
> > pp_za[i] = pp_za[i] % 2
> 
> in general
> 
> pp_za[pp_za < 0] = 2 - abs(pp_za[pp_za < 0])
> pp_za[pp_za > 2] = pp_za[pp_za > 2] % 2
> 
> is shorter and much faster.
> 
> Max
> 
> 
> 
> 
> 
> 
> -- 
> 
> 
> --------------------------------------------------------------------------
> *Sayan Chatterjee*
> Dept. of Physics and Meteorology
> IIT Kharagpur
> Lal Bahadur Shastry Hall of Residence
> Room AB 205
> Mob: +91 9874513565
> blog: www.blissprofound.blogspot.com <http://www.blissprofound.blogspot.com>
> 
> Volunteer , Padakshep
> www.padakshep.org <http://www.padakshep.org>
From: Sayan C. <say...@gm...> - 2013年04月11日 02:55:01
Thanks Maximillian for your help.
Could you please tell me how to surface plot with those data files using
Matplotlib?...i.e both reading the data files and then surface plotting in
matplotlib?
Sayan
On 11 April 2013 02:25, Maximilian Trescher <fa...@tr...> wrote:
> Hi,
> >
> > *np.savetxt(fname, np.array([pp_za,pv_za]).T, '%f')*
>
> does maybe
>
> np.savetxt(fname, np.array([pp_za,pv_za, np.ones(1000)*t]).T, '%f')
> does what you want? (replace 1000 with approppriate length)
>
> and a comment about:
> > if pp_za[i] < 0:
> > pp_za[i] = 2 - abs(pp_za[i])
> > if pp_za[i] > 2:
> > pp_za[i] = pp_za[i] % 2
>
> in general
>
> pp_za[pp_za < 0] = 2 - abs(pp_za[pp_za < 0])
> pp_za[pp_za > 2] = pp_za[pp_za > 2] % 2
>
> is shorter and much faster.
>
> Max
>
>
>
>
-- 
--------------------------------------------------------------------------
*Sayan Chatterjee*
Dept. of Physics and Meteorology
IIT Kharagpur
Lal Bahadur Shastry Hall of Residence
Room AB 205
Mob: +91 9874513565
blog: www.blissprofound.blogspot.com
Volunteer , Padakshep
www.padakshep.org
From: K.-Michael A. <kmi...@gm...> - 2013年04月10日 23:32:53
The example script 'testgdal.py' is crashing at the point of the 
basemap object instantiation:
m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,
 projection='lcc',lat_1=33,lat_2=45,lon_0=-95)
Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 286.
Abort trap: 6
Is there a known workaround?
with basemap version 1.0.2
Best,
Michael
From: Paul H. <pmh...@gm...> - 2013年04月10日 22:03:23
On Wed, Apr 10, 2013 at 2:46 PM, Tim Michelsen
<tim...@gm...>wrote:
> Hello,
> how can I show the forecast error for a timeseries?
>
> Example:
>
> I am looking for displaying the blue area of:
>
> http://t3.gstatic.com/images?q=tbn:ANd9GcR9yuoMhiDeqxJVIOmp0EDNS_Sgxhtv4Z-ohlWly6N7zcgf28QD
>
> Or the violett areas on:
> http://www.meteopower.com/typo3temp/pics/3aa4157df7.jpg
>
> http://t1.gstatic.com/images?q=tbn:ANd9GcQt_l3HXOPigra-9LD5ldvwHytWc2NcP7cySIqp-8HFaOlZ6mrU7w
>
>
> http://matplotlib.org/api/axes_api.html?highlight=error#matplotlib.axes.Axes.errorbar
>
> Maybe as an envelope of
> http://matplotlib.org/examples/pylab_examples/errorbar_subsample.html
>
> Thanks for any pointers in advance and kind regards,
> Timmie
>
Timmie,
I would just use the fill_between method
http://matplotlib.org/examples/pylab_examples/fill_between_demo.html?highlight=codex%20fill_between
From: Tim M. <tim...@gm...> - 2013年04月10日 21:46:20
From: Sayan C. <say...@gm...> - 2013年04月10日 17:50:33
Dear All,
I have some data files with numpy arrays stored in it in 2 columns. I want
to add a third column with just floating point numbers(not numpy array) and
plot them later with Matplotlib in 3d. How is it done? Could you please
illuminate me?
This is the concerned snippet of the code:
while *t < 1*:
 pp_za = pp_init + t*K*np.sin(K*pp_init)
# Periodic Boundary Condition
 for i in range(0,999):
 if pp_za[i] < 0:
 pp_za[i] = 2 - abs(pp_za[i])
 if pp_za[i] > 2:
 pp_za[i] = pp_za[i] % 2
 pv_za = +K*np.sin(K*pp_init)
 fname = 'file_' + str(t) + '.dat'
# Generating dataset for Phase Space diagram
 *np.savetxt(fname, np.array([pp_za,pv_za]).T, '%f')*
 t = t + 0.01
And the sample data generated is :
0.105728 0.098678
0.126865 0.118406
0.147998 0.138128
0.169126 0.157845
0.190247 0.177556
0.211362 0.197259
0.232469 0.216955
0.253567 0.236643
0.274657 0.256321
0.295737 0.275989
0.316806 0.295646
Precisely what I want is, I want to add the 't' (over which the while loop
is run) in the 3 rd column. 't' is float and constant for each looping. If
you know what a phase plot is(doesn't matter if you don't), I want to see
the phase plot evolving with time. Thus the need of a time axis and hence
plot with V(velocity-Yaxis), X ( Position -X axis) and t (Time-Z axis).Once
the data files are created properly, how to plot them using Matplotlib?
Regards,
Sayan
-- 
--------------------------------------------------------------------------
*Sayan Chatterjee*
Dept. of Physics and Meteorology
IIT Kharagpur
Lal Bahadur Shastry Hall of Residence
Room AB 205
Mob: +91 9874513565
blog: www.blissprofound.blogspot.com
Volunteer , Padakshep
www.padakshep.org
From: Will W. <wil...@gm...> - 2013年04月10日 04:57:20
Answering my own question - the solution is to add a binding to the save
button, and prevent the event from propagating after calling new_save() by
adding 'return "break"' at the end:
def new_save(self, *args, **kwargs):
 print 'save_figure pressed'
 return "break"
get_current_fig_manager().toolbar.bsave.bind('<Button-1>', new_save)
I would still like to know why the mechanism that works for the Home button
fails for the Save button though...
Will
On Wed, Apr 10, 2013 at 12:00 PM, Will Woods <wil...@gm...> wrote:
> Hmm, problems with html, will try again in plain text:
>
>
> I'm trying to override the behaviour of the toolbar, with partial success.
>
> This works:
>
>
> from matplotlib.backend_bases import NavigationToolbar2
>
> home = NavigationToolbar2.home
>
> def new_home(self, *args, **kwargs):
> print 'home pressed'
> home(self, *args, **kwargs)
>
> NavigationToolbar2.home = new_home
>
>
>
>
> ...but this doesn't:
>
>
>
>
> from matplotlib.backend_bases import NavigationToolbar2
>
> save_figure = NavigationToolbar2.save_figure
>
> def new_save(self, *args, **kwargs):
> print 'save_figure pressed'
> save_figure(self, *args, **kwargs)
>
> NavigationToolbar2.save_figure = new_save
>
>
>
>
> Having actually created a figure, I can get a bound method for save_figure:
>
>
> get_current_fig_manager().toolbar.save_figure()
>
>
>
> This I can override, and call my override function successfully from my
> script - but pressing the save button on the toolbar doesn't call my
> function...
>
> I'm running matplotlib 1.1.1rc and python 2.7.3
>
> Thanks,
>
> Will
>
>
>
>
>
>
>
>
> On Wed, Apr 10, 2013 at 11:55 AM, Willw <wil...@gm...> wrote:
>
>> I'm trying to override the behaviour of the toolbar, with partial success.
>>
>> This works:
>>
>>
>>
>> ...but this doesn't:
>>
>>
>>
>> Having actually created a figure, I can get a bound method for
>> save_figure:
>>
>>
>>
>> This I can override, and call my override function successfully from my
>> script - but pressing the save button on the toolbar doesn't call my
>> function...
>>
>> I'm running matplotlib 1.1.1rc and python 2.7.3
>>
>> Thanks,
>>
>> Will
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://matplotlib.1069221.n5.nabble.com/Overriding-Save-button-on-Toolbar-tp40864.html
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Precog is a next-generation analytics platform capable of advanced
>> analytics on semi-structured data. The platform includes APIs for building
>> apps and a phenomenal toolset for data science. Developers can use
>> our toolset for easy data analysis & visualization. Get a free account!
>> http://www2.precog.com/precogplatform/slashdotnewsletter
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
From: Will W. <wil...@gm...> - 2013年04月10日 02:00:35
Hmm, problems with html, will try again in plain text:
I'm trying to override the behaviour of the toolbar, with partial success.
This works:
from matplotlib.backend_bases import NavigationToolbar2
home = NavigationToolbar2.home
def new_home(self, *args, **kwargs):
 print 'home pressed'
 home(self, *args, **kwargs)
NavigationToolbar2.home = new_home
...but this doesn't:
from matplotlib.backend_bases import NavigationToolbar2
save_figure = NavigationToolbar2.save_figure
def new_save(self, *args, **kwargs):
 print 'save_figure pressed'
 save_figure(self, *args, **kwargs)
NavigationToolbar2.save_figure = new_save
Having actually created a figure, I can get a bound method for save_figure:
get_current_fig_manager().toolbar.save_figure()
This I can override, and call my override function successfully from my
script - but pressing the save button on the toolbar doesn't call my
function...
I'm running matplotlib 1.1.1rc and python 2.7.3
Thanks,
Will
On Wed, Apr 10, 2013 at 11:55 AM, Willw <wil...@gm...> wrote:
> I'm trying to override the behaviour of the toolbar, with partial success.
>
> This works:
>
>
>
> ...but this doesn't:
>
>
>
> Having actually created a figure, I can get a bound method for save_figure:
>
>
>
> This I can override, and call my override function successfully from my
> script - but pressing the save button on the toolbar doesn't call my
> function...
>
> I'm running matplotlib 1.1.1rc and python 2.7.3
>
> Thanks,
>
> Will
>
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/Overriding-Save-button-on-Toolbar-tp40864.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Willw <wil...@gm...> - 2013年04月10日 01:55:12
I'm trying to override the behaviour of the toolbar, with partial success.
This works:
...but this doesn't:
Having actually created a figure, I can get a bound method for save_figure:
This I can override, and call my override function successfully from my
script - but pressing the save button on the toolbar doesn't call my
function...
I'm running matplotlib 1.1.1rc and python 2.7.3
Thanks,
Will
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Overriding-Save-button-on-Toolbar-tp40864.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Steven B. <bo...@ph...> - 2013年04月09日 03:33:57
Thanks Zach,
That simple little example makes more sense than the manual page did. 
Perhaps it's just late.
I appreciate it.
Steven
On Mon Apr 8 22:30:43 2013, Zachary Pincus wrote:
>> I've got some verts I stole from the internet that draws an upward arrow
>> (or a down arrow), but I need to draw an arrow to the right or to the
>> left. But I don't really understand verts and how they work.
>>
>> arrowup_verts = [[0.,0.], [-1., -1], [0.,0.], [0.,-2.],[0.,0.], [1,-1]]
>> arrowdown_verts = [[0.,0.], [-1., 1], [0.,0.], [0.,2.],[0.,0.], [1, 1]]
>>
>> plot them like...
>>
>> scatter(1,1,s=100, marker=None, verts=arrowup_verts)
>>
>>
>> Can someone make me new verts for the right and left arrow? Then, maybe
>> tomorrow, explain how I was supposed to know what to do.
>
> Draw a line from (0,0) to (-1, -1) on the X-Y plane, and then to (0,0) again, and then continue so forth for all the (x,y) pairs in arrowup_verts. You will notice they form a nice little arrow pointing up. (At some point in this process, you should note that "verts" is short for "vertices". As in vertices of a polygon or poly-line.)
>
> It would seem that the origin of the "verts" coordinate system is translated to the (x,y) data position at which each marker is plotted.
>
> This should give you, I presume, sufficient information to figure out your own left and right arrows, no? Or any other shape you should care to plot...
>
> Zach
>
>
>> Thanks y'all
>>
>> Steven
>>
>> --
>>
>> Steven Boada
>>
>> Doctoral Student
>> Dept of Physics and Astronomy
>> Texas A&M University
>> bo...@ph...
>>
>>
>> ------------------------------------------------------------------------------
>> Precog is a next-generation analytics platform capable of advanced
>> analytics on semi-structured data. The platform includes APIs for building
>> apps and a phenomenal toolset for data science. Developers can use
>> our toolset for easy data analysis & visualization. Get a free account!
>> http://www2.precog.com/precogplatform/slashdotnewsletter
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Steven Boada
Doctoral Student
Dept of Physics and Astronomy
Texas A&M University
bo...@ph...
From: Steven B. <bo...@ph...> - 2013年04月09日 00:45:51
Hey List,
I've got some verts I stole from the internet that draws an upward arrow 
(or a down arrow), but I need to draw an arrow to the right or to the 
left. But I don't really understand verts and how they work.
arrowup_verts = [[0.,0.], [-1., -1], [0.,0.], [0.,-2.],[0.,0.], [1,-1]]
arrowdown_verts = [[0.,0.], [-1., 1], [0.,0.], [0.,2.],[0.,0.], [1, 1]]
plot them like...
scatter(1,1,s=100, marker=None, verts=arrowup_verts)
Can someone make me new verts for the right and left arrow? Then, maybe 
tomorrow, explain how I was supposed to know what to do.
Thanks y'all
Steven
-- 
Steven Boada
Doctoral Student
Dept of Physics and Astronomy
Texas A&M University
bo...@ph...
From: Francesco M. <fra...@gm...> - 2013年04月08日 21:00:58
Il giorno 08/apr/2013 21:05, "Kevin Hunter Kesling" <kmh...@nc...> ha
scritto:
>
> At 4:20pm -0400 2013年4月07日, Francesco Montesano wrote:
>>
>> Il giorno 07/apr/2013 21:03, Kevin Hunter Kesling ha scritto:
>>
>>> On the other hand, I'm still such a noob at Matplotlib ... is there
>>> a way to have one of the subplots take up more than its default 50%
>>> allotment?
>>
>>
>> you can give a look at the last two plots in this example
>> http://matplotlib.org/examples/pylab_examples/demo_tight_layout.html or
use
>> plot.axes providing the rectangle that you want
>
>
> That is closer to what I want, but still not there. I was finally able
to find something that fit the bill to 95% of what I want:
>
>
http://matplotlib.1069221.n5.nabble.com/Proposal-for-Broken-Axes-td38050.html
>
> The first post by 'klukas' does exactly what I asked for. It's a zig-zag
on the Y-axis to show that what is graphed is not continuous, and unlike
the various "official" examples, the zig-zag placement is user-specifiable,
as opposed to exactly halfway between the top and bottom.
>
> The only thing I have yet to figure out how to do is to simultaneously
have a zig-zag on the X axis as well -- an artifact of how these zig-zags
must be created via multiple axes on the same figure, rather than as built
in to the axis artist.
>
> For googleability:
>
> The above linked graph code enables for matplotlib:
>
> - suppressed zeros on the Y-axis of an XY plot
> - showing suppressed data on the Y-axis
> - lightning bolt symbol on the Y-axis
> - zig-zag on the Y-axis
> - a "broken" Y-axis
>
> Thanks for your pointers, Francesco, as they helped me to fine-tune my
Google search terms. And thank you, Klukas, whoever you are.
>
I'm half that you found the solution for your problem and to have been
useful just providing links. This has been one of the easiest answer I have
ever given :)
And mostly thanks for sharing your findings.
cheers and good night,
Fra
> Cheers,
>
> Kevin
From: ChaoYue <cha...@gm...> - 2013年04月08日 20:55:43
Hi Kevin,
I don't check the link you provided very carefully. So I guess you already
find a solution.
otherwise I have done something similar before and have made a bit general
function to do
the job, which I think might be helpful for you.
You can check the following three functions at
https://github.com/ChaoYue/pylsce/blob/master/g.py
Calc_Newaxes_Fraction
Axes_Replace_Split_Axes
Axes_Set_Breakaxis
a working example is below:
>>> fig,axs = plt.subplots(nrows=2)
>>> bottom_ax, top_ax =
g.Axes_Replace_Split_Axes(fig,axs[0],split_fraction=[0.36,0.04,0.6],direction='v')
>>> g.Axes_Set_Breakaxis(bottom_ax, top_ax, 0.01,0.03,'v')
>>> left_ax, right_ax =
g.Axes_Replace_Split_Axes(fig,axs[1],split_fraction=[0.38,0.02,0.6],direction='h')
>>> g.Axes_Set_Breakaxis(left_ax, right_ax, 0.03,0.02,'h')
the figure is as attached.
cheers,
chao
On Mon, Apr 8, 2013 at 9:05 PM, Kevin Hunter [via matplotlib] <
ml-...@n5...> wrote:
> At 4:20pm -0400 2013年4月07日, Francesco Montesano wrote:
> > Il giorno 07/apr/2013 21:03, Kevin Hunter Kesling ha scritto:
> >> On the other hand, I'm still such a noob at Matplotlib ... is there
> >> a way to have one of the subplots take up more than its default 50%
> >> allotment?
> >
> > you can give a look at the last two plots in this example
> > http://matplotlib.org/examples/pylab_examples/demo_tight_layout.html or
> use
> > plot.axes providing the rectangle that you want
>
> That is closer to what I want, but still not there. I was finally able
> to find something that fit the bill to 95% of what I want:
>
>
> http://matplotlib.1069221.n5.nabble.com/Proposal-for-Broken-Axes-td38050.html
>
> The first post by 'klukas' does exactly what I asked for. It's a
> zig-zag on the Y-axis to show that what is graphed is not continuous,
> and unlike the various "official" examples, the zig-zag placement is
> user-specifiable, as opposed to exactly halfway between the top and
> bottom.
>
> The only thing I have yet to figure out how to do is to simultaneously
> have a zig-zag on the X axis as well -- an artifact of how these
> zig-zags must be created via multiple axes on the same figure, rather
> than as built in to the axis artist.
>
> For googleability:
>
> The above linked graph code enables for matplotlib:
>
> - suppressed zeros on the Y-axis of an XY plot
> - showing suppressed data on the Y-axis
> - lightning bolt symbol on the Y-axis
> - zig-zag on the Y-axis
> - a "broken" Y-axis
>
> Thanks for your pointers, Francesco, as they helped me to fine-tune my
> Google search terms. And thank you, Klukas, whoever you are.
>
> Cheers,
>
> Kevin
>
> ------------------------------------------------------------------------------
>
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=40857&i=0>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://matplotlib.1069221.n5.nabble.com/zig-zag-to-represent-suppressed-0-on-axis-tp40849p40857.html
> To start a new topic under matplotlib - users, email
> ml-...@n5...
> To unsubscribe from matplotlib, click here<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx>
> .
> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
-- 
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
break_axis.jpg (182K) <http://matplotlib.1069221.n5.nabble.com/attachment/40858/0/break_axis.jpg>
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/zig-zag-to-represent-suppressed-0-on-axis-tp40849p40858.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Kevin H. K. <kmh...@nc...> - 2013年04月08日 19:05:12
At 4:20pm -0400 2013年4月07日, Francesco Montesano wrote:
> Il giorno 07/apr/2013 21:03, Kevin Hunter Kesling ha scritto:
>> On the other hand, I'm still such a noob at Matplotlib ... is there
>> a way to have one of the subplots take up more than its default 50%
>> allotment?
>
> you can give a look at the last two plots in this example
> http://matplotlib.org/examples/pylab_examples/demo_tight_layout.html or use
> plot.axes providing the rectangle that you want
That is closer to what I want, but still not there. I was finally able 
to find something that fit the bill to 95% of what I want:
http://matplotlib.1069221.n5.nabble.com/Proposal-for-Broken-Axes-td38050.html
The first post by 'klukas' does exactly what I asked for. It's a 
zig-zag on the Y-axis to show that what is graphed is not continuous, 
and unlike the various "official" examples, the zig-zag placement is 
user-specifiable, as opposed to exactly halfway between the top and bottom.
The only thing I have yet to figure out how to do is to simultaneously 
have a zig-zag on the X axis as well -- an artifact of how these 
zig-zags must be created via multiple axes on the same figure, rather 
than as built in to the axis artist.
For googleability:
The above linked graph code enables for matplotlib:
 - suppressed zeros on the Y-axis of an XY plot
 - showing suppressed data on the Y-axis
 - lightning bolt symbol on the Y-axis
 - zig-zag on the Y-axis
 - a "broken" Y-axis
Thanks for your pointers, Francesco, as they helped me to fine-tune my 
Google search terms. And thank you, Klukas, whoever you are.
Cheers,
Kevin
From: Eric F. <ef...@ha...> - 2013年04月08日 17:38:42
On 2013年04月08日 4:13 AM, epi wrote:
> Hi All,
>
> i'm new to basemap, truing to learn how to plot vector from a netcdf file
>
> the variables in my file are :
>
> - time
> - Significant_height_of_combined_wind_waves_and_swell_surface
> - u-component_of_wind_surface
> - v-component_of_wind_surface
>
> this is my code, the pcolormesh is fine
>
> ####
>
> import netCDF4
> import datetime as dt
>
> import numpy as np
> import numpy.ma as ma
> from datetime import date, datetime, timedelta
>
> from mpl_toolkits.basemap import Basemap
>
>
>
> url='http://geoport.whoi.edu/thredds/dodsC/fmrc/NCEP/ww3/cfsr/4m/best'
> #url = 'http://geoport.whoi.edu/thredds/dodsC/fmrc/NCEP/ww3/cfsr/10m/best'
> nc = netCDF4.Dataset(url)
> #nc.variables.keys()
>
>
> time_var = nc.variables[str('time')]
> wave_var = nc.variables['Significant_height_of_combined_wind_waves_and_swell_surface']
> date = datetime(1991,11,1,12)
> istart = netCDF4.date2index(date,time_var,select='nearest')
> lat = nc.variables['lat'][:]
> lon = nc.variables['lon'][:]
> uin = nc.variables['u-component_of_wind_surface'][istart,:,:]
> vin = nc.variables['v-component_of_wind_surface'][istart,:,:]
> var = wave_var[istart,:,:]
> wave = ma.masked_where(np.isnan(var),var)
>
>
> m = Basemap(llcrnrlon=-71.5,llcrnrlat=39.5,urcrnrlon=-63.0,urcrnrlat=46.0,\
> lat_0=20.,lon_0=-60.,lat_ts=20.)
>
>
> lons, lats = np.meshgrid(lon,lat)
> x, y = m(lons, lats)
>
>
> m.pcolormesh(lon[:], lat[:], wave, vmin=0, vmax=3);
> m.quiver(x, y, uin, vin);
Try something like this:
m.quiver(x[::5,::5], y[::5,::5], uin[::5,::5], vin[::5,::5], scale=200);
You can use the scale and the scale_units kwargs to control the arrow 
lengths. Quiver plots don't work visually when there are too many 
arrows, so given the scale of your plot, you need to subsample the wind 
vectors as illustrated.
Eric
>
>
> ####
>
> .. but the vector plot in overlay doesn't render what i'm looking for .. obviously my fault in the code
> thank you for your precious help!
>
>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: epi <mas...@gm...> - 2013年04月08日 14:13:30
Hi All,
i'm new to basemap, truing to learn how to plot vector from a netcdf file
the variables in my file are :
- time
- Significant_height_of_combined_wind_waves_and_swell_surface
- u-component_of_wind_surface
- v-component_of_wind_surface
this is my code, the pcolormesh is fine 
####
import netCDF4
import datetime as dt
import numpy as np
import numpy.ma as ma
from datetime import date, datetime, timedelta
 
from mpl_toolkits.basemap import Basemap
url='http://geoport.whoi.edu/thredds/dodsC/fmrc/NCEP/ww3/cfsr/4m/best'
#url = 'http://geoport.whoi.edu/thredds/dodsC/fmrc/NCEP/ww3/cfsr/10m/best'
nc = netCDF4.Dataset(url)
#nc.variables.keys()
time_var = nc.variables[str('time')]
wave_var = nc.variables['Significant_height_of_combined_wind_waves_and_swell_surface']
date = datetime(1991,11,1,12)
istart = netCDF4.date2index(date,time_var,select='nearest')
lat = nc.variables['lat'][:]
lon = nc.variables['lon'][:]
uin = nc.variables['u-component_of_wind_surface'][istart,:,:]
vin = nc.variables['v-component_of_wind_surface'][istart,:,:]
var = wave_var[istart,:,:]
wave = ma.masked_where(np.isnan(var),var)
m = Basemap(llcrnrlon=-71.5,llcrnrlat=39.5,urcrnrlon=-63.0,urcrnrlat=46.0,\
 lat_0=20.,lon_0=-60.,lat_ts=20.)
lons, lats = np.meshgrid(lon,lat)
x, y = m(lons, lats)
m.pcolormesh(lon[:], lat[:], wave, vmin=0, vmax=3);
m.quiver(x, y, uin, vin);
####
.. but the vector plot in overlay doesn't render what i'm looking for .. obviously my fault in the code
thank you for your precious help!
From: Francesco M. <fra...@gm...> - 2013年04月07日 20:21:02
Il giorno 07/apr/2013 21:03, "Kevin Hunter Kesling" <kmh...@nc...> ha
scritto:
>
> At 2:34pm -0400 2013年4月07日, Francesco Montesano wrote:
>>
>> 2013年4月7日 Kevin Hunter Kesling
>>
>>> I'm looking for a way to represent on an X-Y graph the fact that an axis
>>> does not start from the origin. When drawing by hand, I'll use a little
>>> zig-zag, lightning bolt, or slight space on the axis in question to
>>> represent this fact, just off from where the X and Y axis lines meet.
>>> How would I go about telling Matplotlib to do this? After two hours of
>>> perusing the Axes documentation, and tooling around in an IPython shell,
>>> I appear to be striking out.
>>>
>>> If you are using a monospaced font to view this email, this may
>>> illustrate the functionality for which I'm looking:
>>>
>>> 150 || * *
>>> 145 || * *
>>> 140 || * *
>>> 135 || *
>>> 130 ||
>>> /
>>> / <---- "zig zag" I want
>>> ||
>>> 0 --------------------------------
>>> 0 1 2 3 4 5 6 7 8
>
>
>> Have you given a look at this example:
>> http://matplotlib.org/examples/pylab_examples/broken_axis.html
>
>
> Damn, I clearly missed that one. And once I know what I'm looking for,
my eye goes right to it. Sorry for the noise.
>
> On the other hand, I'm still such a noob at Matplotlib ... is there a way
to have one of the subplots take up more than its default 50% allotment?
>
> Thanks,
>
> Kevin
hi Kevin,
you can give a look at the last two plots in this example
http://matplotlib.org/examples/pylab_examples/demo_tight_layout.html or use
plot.axes providing the rectangle that you want
fra
From: Kevin H. K. <kmh...@nc...> - 2013年04月07日 19:03:29
At 2:34pm -0400 2013年4月07日, Francesco Montesano wrote:
> 2013年4月7日 Kevin Hunter Kesling
>> I'm looking for a way to represent on an X-Y graph the fact that an axis
>> does not start from the origin. When drawing by hand, I'll use a little
>> zig-zag, lightning bolt, or slight space on the axis in question to
>> represent this fact, just off from where the X and Y axis lines meet.
>> How would I go about telling Matplotlib to do this? After two hours of
>> perusing the Axes documentation, and tooling around in an IPython shell,
>> I appear to be striking out.
>>
>> If you are using a monospaced font to view this email, this may
>> illustrate the functionality for which I'm looking:
>>
>> 150 || * *
>> 145 || * *
>> 140 || * *
>> 135 || *
>> 130 ||
>> /
>> / <---- "zig zag" I want
>> ||
>> 0 --------------------------------
>> 0 1 2 3 4 5 6 7 8
> Have you given a look at this example:
> http://matplotlib.org/examples/pylab_examples/broken_axis.html
Damn, I clearly missed that one. And once I know what I'm looking for, 
my eye goes right to it. Sorry for the noise.
On the other hand, I'm still such a noob at Matplotlib ... is there a 
way to have one of the subplots take up more than its default 50% allotment?
Thanks,
Kevin
From: Francesco M. <fra...@gm...> - 2013年04月07日 18:34:54
2013年4月7日 Kevin Hunter Kesling <kmh...@nc...>
> Hullo Matplotlib List,
>
> I'm looking for a way to represent on an X-Y graph the fact that an axis
> does not start from the origin. When drawing by hand, I'll use a little
> zig-zag, lightning bolt, or slight space on the axis in question to
> represent this fact, just off from where the X and Y axis lines meet.
> How would I go about telling Matplotlib to do this? After two hours of
> perusing the Axes documentation, and tooling around in an IPython shell,
> I appear to be striking out.
>
> If you are using a monospaced font to view this email, this may
> illustrate the functionality for which I'm looking:
>
>
> 150 || * *
> 145 || * *
> 140 || * *
> 135 || *
> 130 ||
> /
> / <---- "zig zag" I want
> ||
> 0 --------------------------------
> 0 1 2 3 4 5 6 7 8
>
>
> Many thanks for any help,
>
> Kevin
>
>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
Hi Kevin,
Have you given a look at this example:
http://matplotlib.org/examples/pylab_examples/broken_axis.html
Francesco
From: Kevin H. K. <kmh...@nc...> - 2013年04月07日 18:26:33
Hullo Matplotlib List,
I'm looking for a way to represent on an X-Y graph the fact that an axis 
does not start from the origin. When drawing by hand, I'll use a little 
zig-zag, lightning bolt, or slight space on the axis in question to 
represent this fact, just off from where the X and Y axis lines meet. 
How would I go about telling Matplotlib to do this? After two hours of 
perusing the Axes documentation, and tooling around in an IPython shell, 
I appear to be striking out.
If you are using a monospaced font to view this email, this may 
illustrate the functionality for which I'm looking:
 150 || * *
 145 || * *
 140 || * *
 135 || *
 130 ||
 /
 / <---- "zig zag" I want
 ||
 0 --------------------------------
 0 1 2 3 4 5 6 7 8
Many thanks for any help,
Kevin
From: Zhu, S. <zhu...@gm...> - 2013年04月07日 06:14:51
Hi Sterling, thank you,
I tried plt.text and it works! It seems text() does not support list input,
and I have to write loop to print the number one by one.
From: Sterling S. <sm...@fu...> - 2013年04月07日 04:39:14
See
plt.text
and 
plt.annotate
See http://matplotlib.org/users/annotations_guide.html and references therein.
-Sterling
On Apr 6, 2013, at 3:54PM, Zhu, Shenli wrote:
> How to add number near point of scatter plot?
> e.g. I have two point 1 is (1,3) and point 2 (2,4), how can I add 1
> and 2 to scatter plot near these two points? Thanks!
> 
> import matplotlib.pyplot as plt
> x = [1,2]
> y = [3,4]
> plt.scatter(x, y)
> plt.show()
> 
> 
> 
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire 
> the most talented Cisco Certified professionals. Visit the 
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Showing results of 133

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