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

Showing 9 results of 9

From: Benjamin R. <ben...@ou...> - 2014年10月20日 15:11:46
Legends entries are blindly constructed. Each plotting call that has a
legend keyword argument will produce a legend entry if you are
automatically building the legend. You can pass a label value of
"__nolabel__" to prevent an entry if you know you are about to do something
that would duplicate the entries. Another approach is to manually collect
unique artists and manually build the legend (I think there is an example
of that in the gallary).
As for configuring the legend, there are a bunch of parameters that can be
set for sizing the font. I think the sizing of the marker is determined by
their size in the plot, though.
Cheers!
Ben Root
On Mon, Oct 20, 2014 at 10:46 AM, Hearne, Mike <mh...@us...> wrote:
> For your first question: Use the legend "numpoints" keyword. I think
> if you set it to 1, it should solve that problem.
>
> For your second question, I'm not sure, but I'll bet if you poke
> around in the Legend object returned by the function, you'll find
> something.
>
> On Mon, Oct 20, 2014 at 8:04 AM, Tommy Carstensen
> <tom...@gm...> wrote:
> > How does one avoid duplicate legends?
> >
> www.tommycarstensen.com/python2_matplotlib_basemap_merc_bluemarble_hresolution.jpg
> >
> > Can I make the legend size smaller than the marker size?
> >
> >
> ------------------------------------------------------------------------------
> > Comprehensive Server Monitoring with Site24x7.
> > Monitor 10 servers for 9ドル/Month.
> > Get alerted through email, SMS, voice calls or mobile push notifications.
> > Take corrective actions from your mobile device.
> > http://p.sf.net/sfu/Zoho
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for 9ドル/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Hearne, M. <mh...@us...> - 2014年10月20日 14:58:41
For your first question: Use the legend "numpoints" keyword. I think
if you set it to 1, it should solve that problem.
For your second question, I'm not sure, but I'll bet if you poke
around in the Legend object returned by the function, you'll find
something.
On Mon, Oct 20, 2014 at 8:04 AM, Tommy Carstensen
<tom...@gm...> wrote:
> How does one avoid duplicate legends?
> www.tommycarstensen.com/python2_matplotlib_basemap_merc_bluemarble_hresolution.jpg
>
> Can I make the legend size smaller than the marker size?
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for 9ドル/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Fabrice S. <si...@lm...> - 2014年10月20日 14:40:25
Le lundi 20 octobre 2014 à 06:59 -0700, Tommy Carstensen a écrit :
> Does anyone know, how they were able to add the legend titles "damped"
> and "oscillatory" to this plot:
> http://matplotlib.org/examples/pylab_examples/legend_demo.html
Hi,
it seems to me that you are looking to some deprecated example, not even
listed in the page :
http://matplotlib.org/examples/pylab_examples/
It has been rewritten as 
http://matplotlib.org/examples/pylab_examples/legend_demo2.html
http://matplotlib.org/examples/pylab_examples/legend_demo3.html
http://matplotlib.org/examples/pylab_examples/legend_demo4.html
> Can anyone point me to a good tutorial on matplotlib legends? This one
> is somewhat limited:
> http://matplotlib.org/users/legend_guide.html
I find it pretty concise and understandable...
Have you seen the list of examples involving legend at the bottom of
that page?
From: Marcel M. <mar...@gm...> - 2014年10月20日 14:13:01
Indeed, the legends showing in that figure should be 'Model length', 'Data
length' and 'Total message length', which were the labels given to each
plot command.
Maybe there was a mismatch between code and plot there.
2014年10月20日 11:59 GMT-02:00 Tommy Carstensen <tom...@gm...>:
> Does anyone know, how they were able to add the legend titles "damped"
> and "oscillatory" to this plot:
> http://matplotlib.org/examples/pylab_examples/legend_demo.html
>
> Can anyone point me to a good tutorial on matplotlib legends? This one
> is somewhat limited:
> http://matplotlib.org/users/legend_guide.html
>
> Thanks.
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for 9ドル/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Tommy C. <tom...@gm...> - 2014年10月20日 14:04:53
How does one avoid duplicate legends?
www.tommycarstensen.com/python2_matplotlib_basemap_merc_bluemarble_hresolution.jpg
Can I make the legend size smaller than the marker size?
From: Tommy C. <tom...@gm...> - 2014年10月20日 14:00:05
Does anyone know, how they were able to add the legend titles "damped"
and "oscillatory" to this plot:
http://matplotlib.org/examples/pylab_examples/legend_demo.html
Can anyone point me to a good tutorial on matplotlib legends? This one
is somewhat limited:
http://matplotlib.org/users/legend_guide.html
Thanks.
From: Tommy C. <tom...@gm...> - 2014年10月20日 11:41:43
Here is a more detailed crash report in addition to the one from the
command line:
Application Specific Information:
Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 285.
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff93f2e866 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff9a44035c pthread_kill + 92
2 libsystem_c.dylib 0x00007fff935bfb1a abort + 125
3 libsystem_c.dylib 0x00007fff935899bf __assert_rtn + 321
4 libgeos-3.4.2.dylib 0x0000000105df3e6b
geos::index::strtree::AbstractSTRtree::query(void const*,
geos::index::strtree::AbstractNode const*, std::__1::vector<void*,
std::__1::allocator<void*> >*) + 363
5 libgeos-3.4.2.dylib 0x0000000105e09c4d
geos::noding::MCIndexNoder::intersectChains() + 173
6 libgeos-3.4.2.dylib 0x0000000105e10514
geos::operation::buffer::BufferBuilder::computeNodedEdges(std::__1::vector<geos::noding::SegmentString*,
std::__1::allocator<geos::noding::SegmentString*> >&,
geos::geom::PrecisionModel const*) + 50
7 libgeos-3.4.2.dylib 0x0000000105e10028
geos::operation::buffer::BufferBuilder::buffer(geos::geom::Geometry
const*, double) + 170
8 libgeos-3.4.2.dylib 0x0000000105e11e84
geos::operation::buffer::BufferOp::bufferOriginalPrecision() + 178
9 libgeos-3.4.2.dylib 0x0000000105e11d94
geos::operation::buffer::BufferOp::computeGeometry() + 14
10 libgeos-3.4.2.dylib 0x0000000105e11d35
geos::operation::buffer::BufferOp::bufferOp(geos::geom::Geometry
const*, double, int, int) + 79
11 libgeos_c.1.dylib 0x0000000105ba8f9f GEOSBuffer_r + 42
12 _geoslib.so 0x00000001056ee0ac
__pyx_pw_8_geoslib_12BaseGeometry_11fix + 28 (_geoslib.c:1990)
13 org.python.python 0x00000001000e5496 PyEval_EvalFrameEx + 31398
14 org.python.python 0x00000001000e665d PyEval_EvalCodeEx + 2349
15 org.python.python 0x00000001000e51f7 PyEval_EvalFrameEx + 30727
16 org.python.python 0x00000001000e665d PyEval_EvalCodeEx + 2349
17 org.python.python 0x000000010003f76a function_call + 186
18 org.python.python 0x000000010000da08 PyObject_Call + 104
19 org.python.python 0x000000010002941c method_call + 140
20 org.python.python 0x000000010000da08 PyObject_Call + 104
21 org.python.python 0x0000000100078651 slot_tp_init + 81
22 org.python.python 0x00000001000736c4 type_call + 212
23 org.python.python 0x000000010000da08 PyObject_Call + 104
24 org.python.python 0x00000001000e1c3f PyEval_EvalFrameEx + 16975
25 org.python.python 0x00000001000e665d PyEval_EvalCodeEx + 2349
26 org.python.python 0x00000001000e671f PyEval_EvalCode + 63
27 org.python.python 0x0000000100110b2e PyRun_FileExFlags + 206
28 org.python.python 0x0000000100110edd
PyRun_SimpleFileExFlags + 717
29 org.python.python 0x000000010012856e Py_Main + 3262
30 org.python.python 0x0000000100000e32 0x100000000 + 3634
31 org.python.python 0x0000000100000c84 0x100000000 + 3204
On Fri, Oct 17, 2014 at 3:57 AM, Tommy Carstensen
<tom...@gm...> wrote:
> To matplotlib-users,
>
> I ran the installation guide here on Mac OS:
> http://matplotlib.org/basemap/users/installing.html
>
> Except I did brew install geos and subsequently did:
> export DYLD_LIBRARY_PATH=/Users/tc9/homebrew/lib
> export GEOS_LIBRARY_PATH=/Users/tc9/homebrew/Cellar/geos/3.4.2
> export GEOS_DIR=/Users/tc9/homebrew/Cellar/geos/3.4.2
>
> And instead of python setup.py install I did:
> /usr/local/bin/python3 setup.py install --user
>
> I got this warning:
> /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py:260:
> UserWarning: Unknown distribution option: 'namespace_packages'
> warnings.warn(msg)
>
> When I try to run simpletest.py in the folder examples with
> /usr/local/bin/python3 I get this error:
> Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 285.
> Abort trap: 6
>
> What am I doing wrong?
>
> Thanks,
> Tommy
From: Gaute H. <eg...@ga...> - 2014年10月20日 08:22:18
Hi Bill,
I've created a class for using the IBCAO with Basemap in the _Arctic_
that might be useful for you, it is located here:
 http://scipy-central.org/item/75/0/ibcao-international-bathymetric-chart-of-the-arctic-ocean-class-for-python-and-scipy
 ( https://github.com/gauteh/ibcao_py )
Cheers, Gaute
Excerpts from Bill Wang's message of October 20, 2014 9:48:
> Hi all! I've tried to plot some (sea ice thickness, snow freeboard
> etc.) netcdf-data on Antarctic waters but there seems to be something
> funny here since the plot is kind of cut in half or something. from
> Scientific.IO.NetCDF import NetCDFFile # Also numpy as np, Basemap
> etc, matplotlib as plt. F = NetCDFFile('data.nc','r')lat =
> F.variables['nav_lat'][:,0]lon = F.variables['nev_lon'][0,:]data =
> np.ma.masked_where(np.isnan(F.variables['iice_hid'][0,2,:,:]),
> F.variables['iice_hid'][0,2,:,:])m =
> Basemap(projection='spaeqd',boundinglat=-50,lon_0=180,resolution='l')lons,
> lats = np.meshgrid(lon,lat)fig =
> plt.figure()m.pcolormesh(lons,lats,data,latlon=True,vmin=0,vmax=2.3)m2.drawcoastlines()plt.show()
>
>
> Unfortunately I can't provide any data, but the dimensions are:x=1442;
> y=1021; icethi(=layers)=5; time_counter=1Longitudes are like (y,x), in
> degrees_east, min -180 and max 180Latitudes are (y,x), in
> degrees_north, min -77, max 89Data (the one to draw) is
> (time_counter,icethi,y,x). Without meshgrid there is a RuntimeError:
> Buffer lengths not the same. Also I've tried many other projections
> like spstere, laea,splaea... With addcyclic the result looks exactly
> the same so that can't be the problem either. The netcdf file doesn't
> contain any more information about coordinate systems or projection,
> just that lon and lat model is in "Default grid" what ever that means.
> I would be very thankful if anyone can help me or give me a glue, from
> where to look for a solution Cheers, Bill!
From: Bill W. <bil...@ho...> - 2014年10月20日 07:49:03
Attachments: snibetisnab.png
Hi all! I've tried to plot some (sea ice thickness, snow freeboard etc.) netcdf-data on Antarctic waters but there seems to be something funny here since the plot is kind of cut in half or something.
from Scientific.IO.NetCDF import NetCDFFile # Also numpy as np, Basemap etc, matplotlib as plt.
F = NetCDFFile('data.nc','r')lat = F.variables['nav_lat'][:,0]lon = F.variables['nev_lon'][0,:]data = np.ma.masked_where(np.isnan(F.variables['iice_hid'][0,2,:,:]), F.variables['iice_hid'][0,2,:,:])m = Basemap(projection='spaeqd',boundinglat=-50,lon_0=180,resolution='l')lons, lats = np.meshgrid(lon,lat)fig = plt.figure()m.pcolormesh(lons,lats,data,latlon=True,vmin=0,vmax=2.3)m2.drawcoastlines()plt.show()
 
Unfortunately I can't provide any data, but the dimensions are:x=1442; y=1021; icethi(=layers)=5; time_counter=1Longitudes are like (y,x), in degrees_east, min -180 and max 180Latitudes are (y,x), in degrees_north, min -77, max 89Data (the one to draw) is (time_counter,icethi,y,x).
Without meshgrid there is a RuntimeError: Buffer lengths not the same. Also I've tried many other projections like spstere, laea,splaea... With addcyclic the result looks exactly the same so that can't be the problem either. The netcdf file doesn't contain any more information about coordinate systems or projection, just that lon and lat model is in "Default grid" what ever that means. I would be very thankful if anyone can help me or give me a glue, from where to look for a solution
Cheers, Bill! 		 	 		 

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