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

Showing 10 results of 10

From: Jeff W. <jef...@no...> - 2012年08月28日 22:24:16
On 8/28/12 9:31 AM, Jose Gomez-Dans wrote:
> Hi,
> I'd like to plot some EASE Grid global data (the EASE grid is defined 
> for a cylindrical equal area projection). In proj4 parlance, it is 
> defined as
>
> +proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +a=6371228 +b=6371228 
> +units=m +no_defs
>
> My data are gridded, and I want to use either pcolormesh or imshow to 
> plot them on a map. Apart from reprojecting into something that 
> basemap deals with natively, is there something else that I can do 
> within python/matplolib to plot the data without reprojecting it?
>
> Thanks!hu
> Jose
Jose: I went ahead and added support for the 'cea' projection to pull 
request 73.
https://github.com/matplotlib/basemap/pull/73
You can get it by cloning my fork (https://github.com/jswhit/basemap).
-Jeff
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Sterling S. <sm...@fu...> - 2012年08月28日 21:31:15
Attachments: legend_error.tiff
List,
Consider the following script:
import pylab
pylab.plot(pylab.linspace(0,1,100),label='Test',marker='o',ls='')
pylab.plot(pylab.linspace(0,1,100),label='Test2',marker='o',ls='-')
leg=pylab.legend(loc='best')
line=leg.get_lines()
line[0].set_color('black')
line[1].set_color('black')
pylab.draw()
I am attaching the results I see with the TkAgg baackend. I am using version 1.1.0.
I would expect the markers to change colors also. However, I can't seem to find the markers recorded in the legend object to be able to change them. Is this a bug or a feature (resetting the color could lead to inconsistencies between legend and plot)?
Thanks,
Sterling
From: Jeff W. <jef...@no...> - 2012年08月28日 18:35:34
On 8/28/12 9:31 AM, Jose Gomez-Dans wrote:
> Hi,
> I'd like to plot some EASE Grid global data (the EASE grid is defined 
> for a cylindrical equal area projection). In proj4 parlance, it is 
> defined as
>
> +proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +a=6371228 +b=6371228 
> +units=m +no_defs
>
> My data are gridded, and I want to use either pcolormesh or imshow to 
> plot them on a map. Apart from reprojecting into something that 
> basemap deals with natively, is there something else that I can do 
> within python/matplolib to plot the data without reprojecting it?
>
> Thanks!
> Jose
>
Jose: Shouldn't be too hard to add support for that projection. Could 
you file a feature request at
https://github.com/matplotlib/basemap/issues ??
-Jeff
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Jeff W. <jef...@no...> - 2012年08月28日 18:15:51
On 8/28/12 12:09 PM, klo uo wrote:
> Jeff, I just thought to mention this: function name "wmsmap" maybe
> should be changed to "restmap" as for WMS servers will need to do
> another template. Here is example urllib call for sample WMS function
> GetMap:
Klo: Let's move this discussion over to the pull request
https://github.com/matplotlib/basemap/pull/73
-Jeff
>
> ========================================
> basemap_url = "\
> http://geonetwork3.fao.org/ows/14097?\
> request=GetMap&\
> service=WMS&\
> version=1.1.1&\
> layers=country_bnd&\
> format=image/svg%2Bxml&\
> bgcolor=0xFFFFFF&\
> transparent=TRUE&\
> srs=EPSG:4326&\
> bbox=-180,-137.464503042596,180,137.464503042596&\
> width=986&\
> height=753\
> "
> ========================================
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: klo uo <kl...@gm...> - 2012年08月28日 18:09:55
Jeff, I just thought to mention this: function name "wmsmap" maybe
should be changed to "restmap" as for WMS servers will need to do
another template. Here is example urllib call for sample WMS function
GetMap:
========================================
basemap_url = "\
http://geonetwork3.fao.org/ows/14097?\
request=GetMap&\
service=WMS&\
version=1.1.1&\
layers=country_bnd&\
format=image/svg%2Bxml&\
bgcolor=0xFFFFFF&\
transparent=TRUE&\
srs=EPSG:4326&\
bbox=-180,-137.464503042596,180,137.464503042596&\
width=986&\
height=753\
"
========================================
From: klo uo <kl...@gm...> - 2012年08月28日 16:57:10
>> Jeff it looks great, everything is parametrized including server name
>> and map name, so it should work for any additional service.
>> However on Windows with Python 2.7 and Basemap 1.0.5 I get an error
>> while trying to run the script:
>
>
> Klo: Just added a pull request for this
>
> https://github.com/matplotlib/basemap/pull/73
>
> Regarding your windows error - you have to rebuild basemap to get the needed
> updates (it's not just a matter of running the testwms.py script).
Thanks will do that right now.
I was just investigating possibility of returning clear map without
annotations where it is possible.
For example World_Topo_Map
(http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer)
has additional layers and according layers parameter in export
function (http://atlas.resources.ca.gov/arcgis/SDK/REST/export.html):
========================================
Description: Determines which layers appear on the exported map. There
are four ways to specify which layers are shown:
 show: Only the layers specified in this list will be exported.
 hide: All layers except those specified in this list will be exported.
 include: In addition to the layers exported by default, the layers
specified in this list will be exported.
 exclude: The layers exported by default excluding those specified
in this list will be exported.
Syntax: [show | hide | include | exclude]:layerId1,layerId2
where layerId1, layerId2are the layer ids returned by the map service resource
Example: layers=show:2,4,7
========================================
if we add additional parameter "&layers=hide:5,6,7,8,9" I expected
annotations to be gone, but unfortunately not there yet
Will look further if it's somehow possible to clear annotations.
From: Jeff W. <jef...@no...> - 2012年08月28日 16:21:43
On 8/28/12 9:56 AM, klo uo wrote:
> On Mon, Aug 27, 2012 at 9:32 PM, Jeff Whitaker wrote:
>> Klo: Yes. And vice versa, some of those 4500 projections aren't supported
>> by Basemap.
>>
>> Anyway, I went ahead and created a prototype 'wmsmap' method. You can try it
>> by cloning my fork (https://github.com/jswhit/basemap) and running
>> examples/testwms.py. I created an extra kward 'epsg' for creating Basemap
>> instances. To use the wmsmap function, you have to use that keyword. Give
>> it a try and let me know what you think.
> Jeff it looks great, everything is parametrized including server name
> and map name, so it should work for any additional service.
> However on Windows with Python 2.7 and Basemap 1.0.5 I get an error
> while trying to run the script:
Klo: Just added a pull request for this
https://github.com/matplotlib/basemap/pull/73
Regarding your windows error - you have to rebuild basemap to get the 
needed updates (it's not just a matter of running the testwms.py script).
-Jeff
> ========================================
> Traceback (most recent call last):
> File "testwms.py", line 39, in <module>
> m=Basemap2(epsg=epsg,resolution='h',width=width,height=height)
> TypeError: __init__() got an unexpected keyword argument 'epsg'
> ========================================
>
> I than added initial empty "epsg" arg to original Basemap class
> declaration, but then after some time processing I get:
> ========================================
> warning: width and height keywords ignored for Cylindrical Equidistant
> projectionEPSG:
> Traceback (most recent call last):
> File "testwms.py", line 47, in <module>
> m.drawparallels(np.arange(0,80,1),labels=[1,0,0,0])
> File "testwms.py", line 15, in wmsmap
> if not hasattr(self,'epsg'):
> AttributeError: 'Basemap2' object has no attribute 'epsg'
> ========================================
>
> So I leave it for now and assume it's some tiny issue not obvious at
> this time to me.
>
> I'll continue WMS search, but yesterday I spent couple of hours just
> to look at those beautiful maps provided on arcgis server. I explored
> on all and it's so nicely done and with high resolution zoom. They are
> annotated though, but again, see i.e. Ocean Basemap, or overlay with
> transparency over some more colored topo map like GEBCO_08 from
> maps.ngdc.noaa.gov server - just great. World Topo also...
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: klo uo <kl...@gm...> - 2012年08月28日 15:56:11
On Mon, Aug 27, 2012 at 9:32 PM, Jeff Whitaker wrote:
>
> Klo: Yes. And vice versa, some of those 4500 projections aren't supported
> by Basemap.
>
> Anyway, I went ahead and created a prototype 'wmsmap' method. You can try it
> by cloning my fork (https://github.com/jswhit/basemap) and running
> examples/testwms.py. I created an extra kward 'epsg' for creating Basemap
> instances. To use the wmsmap function, you have to use that keyword. Give
> it a try and let me know what you think.
Jeff it looks great, everything is parametrized including server name
and map name, so it should work for any additional service.
However on Windows with Python 2.7 and Basemap 1.0.5 I get an error
while trying to run the script:
========================================
Traceback (most recent call last):
 File "testwms.py", line 39, in <module>
 m=Basemap2(epsg=epsg,resolution='h',width=width,height=height)
TypeError: __init__() got an unexpected keyword argument 'epsg'
========================================
I than added initial empty "epsg" arg to original Basemap class
declaration, but then after some time processing I get:
========================================
warning: width and height keywords ignored for Cylindrical Equidistant
projectionEPSG:
Traceback (most recent call last):
 File "testwms.py", line 47, in <module>
 m.drawparallels(np.arange(0,80,1),labels=[1,0,0,0])
 File "testwms.py", line 15, in wmsmap
 if not hasattr(self,'epsg'):
AttributeError: 'Basemap2' object has no attribute 'epsg'
========================================
So I leave it for now and assume it's some tiny issue not obvious at
this time to me.
I'll continue WMS search, but yesterday I spent couple of hours just
to look at those beautiful maps provided on arcgis server. I explored
on all and it's so nicely done and with high resolution zoom. They are
annotated though, but again, see i.e. Ocean Basemap, or overlay with
transparency over some more colored topo map like GEBCO_08 from
maps.ngdc.noaa.gov server - just great. World Topo also...
From: Jose Gomez-D. <jgo...@gm...> - 2012年08月28日 15:31:27
Hi,
I'd like to plot some EASE Grid global data (the EASE grid is defined for a
cylindrical equal area projection). In proj4 parlance, it is defined as
+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +a=6371228 +b=6371228 +units=m
+no_defs
My data are gridded, and I want to use either pcolormesh or imshow to plot
them on a map. Apart from reprojecting into something that basemap deals
with natively, is there something else that I can do within
python/matplolib to plot the data without reprojecting it?
Thanks!
Jose
From: Mic <mic...@gm...> - 2012年08月28日 05:41:40
Hello,
I am not able to get nicer spaces between the xticks with the following
code:
*import random
import matplotlib.pyplot as plt
coverages = [random.randint(1,10)*2] * 100
contig_names = ['AAB0008r'] * len(coverages)
fig = plt.figure()
fig.clf()
ax = fig.add_subplot(111)
ax.yaxis.grid(True, linestyle='-', which='major', color='grey',
 alpha=0.5)
ind = range(len(coverages))
rects = ax.bar(ind, coverages, width=0.2, align='center', color='thistle')
ax.set_xticks(ind)
ax.set_xticklabels(contig_names)
#function to auto-rotate the x axis labels
fig.autofmt_xdate()
plt.show() *
How to get more space between the xticks so they do not look like
overlapped anymore?
Thank you in advance.

Showing 10 results of 10

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