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

Showing 5 results of 5

From: <bcs...@in...> - 2005年09月22日 16:44:10
I'm somewhat of a newbie and I have hopefully a simple question (people asking
similar questions in the archive seem to be beyond this already). I have a
working color fill generated using the set_facecolor command on a collection of
polygons. When I try to use colorbar() I get the message: cmap = mappable.cmp 
 AttributeError: 'NoneType' object has no
object 'cmap'. 
This question could be a little lacking in information? Maybe someone has a bit
of sample code that already does something like this?
Thanks!
Brian
From: Jeff W. <js...@fa...> - 2005年09月22日 12:51:48
Petr Jakes wrote:
>I am trying to think how to convert image (scanned map) to the Numeric array.
>My map is in Transverse Mercator projection (this is my intended
>target projection as well) and it has WGS84 coordinates (datum) on it.
>
>I just can't figure out, how I can identify the exact pixel, where (at
>least) the 3 wgs84 coordinates intersection point are located. I think
>I need such a identification so I will be able to assign the
>information about position (coordinates) to each image pixel during
>the conversion of the image to the Numeric array? Maybe there is some
>general function how to "calibrate" the picture(pixels) to the coordinates.
>
>Any idea about it? Or is my approach completely wrong?
>
>Thks and regards
>
>Petr
>
> 
>
Petr: I think the best approach would be make your scanned map into a 
'georeferenced' image (such as a geotiff). I think you can do this with 
gdal (http://gdal.maptools.org). Once the image is georeferenced, I can 
give you an example showing how to read it in using the python gdal 
module, convert it to an array and plot it with basemap. Sorry I can't 
be of more help, but this is really outside my realm of expertise.
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/CDC1 FAX : (303)497-6449
325 Broadway Web : http://www.cdc.noaa.gov/~jsw
Boulder, CO, USA 80305-3328 Office: Skaggs Research Cntr 1D-124
From: Petr J. <pe...@tp...> - 2005年09月22日 11:04:50
Jeff,
thanks a lot for giving me your advices. Please understand it is about
20 years I am from the university so it is not always easy to get
things about maps etc. back to my head :)
I did study your some example code
http://matplotlib.sourceforge.net/screenshots/plotmap.py
and I thing I am able to follow it and understand how you are using it.
Generally it looks for me like you:
a) read the pre-prepared (sorted) scalar field (latitudes, longitudes, values)
b) store it in the three numarrays (topoin, lons , lats)
c) transform coordinates (lons , lats) to the chosen projection (to
 the native map projection grid) + interpolate data values (topoin)
 to the transformed coordinates.
d) assign color to the interpolated "data values" using colorpalet from
 the 'imshow'
e) plot "new" transformed "color" scalar field over the map
(please correct me, if I am wrong).
Now I am reading your first posting again:
---snip---
> However, you may be able to do it by importing your image using PIL,
> converting it to a Numeric array and then plotting it over the map
> projection using imshow. To see how to convert an image to and from
> a Numeric array see http://effbot.org/zone/pil-numpy.htm
---Snip---
I am trying to think how to convert image (scanned map) to the Numeric array.
My map is in Transverse Mercator projection (this is my intended
target projection as well) and it has WGS84 coordinates (datum) on it.
I just can't figure out, how I can identify the exact pixel, where (at
least) the 3 wgs84 coordinates intersection point are located. I think
I need such a identification so I will be able to assign the
information about position (coordinates) to each image pixel during
the conversion of the image to the Numeric array? Maybe there is some
general function how to "calibrate" the picture(pixels) to the coordinates.
Any idea about it? Or is my approach completely wrong?
Thks and regards
Petr
From: N. V. <mit...@we...> - 2005年09月22日 10:09:47
Hello Aure,
>Amongst other libraries, I have been using Matplotlib to build some scanning
>X-ray images I will publish soon (Journal of Applied Crystallography if
>accepted). I don't know if this is an issue for someone, but I would like to
>include a reference, can anyone tell me if there is a standard one or whether
>it is worth it for anyone to be mentioned ? 
> 
>
This question has just been answered a few threads ago ("success 
story"). To quote JDH:
> Perhaps it would be a good idea for you and others who publish with
> mpl to cite it in the methods section (eg "figures x, y,and z were
> generated using matplotlib") with a reference pointing to the web
> site. Promotion and publicity is always a good thing. Some journals
> don't allow links in the citations, in which case you could use
> 
> @InProceedings{BarrettEtal2004,
> Author = {Barrett, P. and Hunter, J.D. and Greenfield, P.},
> Title = {Matplotlib - {A} Portable {Python} Plotting Package},
> BookTitle = {Astronomical Data Analysis Software \& Systems {XIV}.},
> year = 2004
> }
Niklas.
From: Jack A. <ef...@iv...> - 2005年09月22日 06:47:31
sorry, example contained syntax error...
On 21/09/05 15:11:16, Jack Andrews wrote:
> back to my scattered circles... can you show me =20
> how to center text (labels) inside the big =20
> circles generated by this program (follows)? =20
> help much appreciated.
#!/usr/bin/env python
from pylab import *
N=3D5
def onecolor(c):
 x,y=3Drand(2,N)
 return scatter(x,y,c=3Dc,s=3Darray([600]+[30]*(N-1)))
[r,b]=3D[onecolor(c) for c in 'red blue'.split()]
# find first of each sequence of patches and
# write 'red' in the red one (and 'blue' for blue)
grid(True)
show()

Showing 5 results of 5

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