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


Showing results of 89

1 2 3 4 > >> (Page 1 of 4)
From: Thomas S. <spr...@hd...> - 2013年02月28日 21:58:34
Am 28.02.2013 um 14:31 schrieb Pierre Haessig:
> Hi Thomas,
> 
> Le 27/02/2013 20:59, Thomas Sprinzing a écrit :
>> To sum it up: use the old 7-bit equivalent for the degree sign, not any fancydancy UTF-8 character that is commonly not included in ye olde style postscript standard font embedded into your laser printer waaaay back then in the last millenium... 
> Just out of curiosity, I looked at the list of ASCII printable
> characters
> (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters) and
> didn't find the degree sign. However, I found it in the so-called "8
> bits extensions", which I believe is just the same as the Unicode U+00B0
confirmed by looking at
http://www.adobe.com/type/browser/info/charsets.html
Adobe western 2 has the same info.
Alt-0179 or U+00B0
So, best is to use the degree sign.
If you're not sure, what's present at rendering time, maybe try to force the generator to convert fonts to ps paths. 
But i donÄt know if matplotlib has tat optin at all...
From: Gökhan S. <gok...@gm...> - 2013年02月28日 20:17:36
Okay, fair enough.
But do you have any ideas, how to force the PS creator to use a different
font?
Say -> font Times-Bold
On Wed, Feb 27, 2013 at 12:59 PM, Thomas Sprinzing <
spr...@hd...> wrote:
> I'd say it's got nearly nothing to do with matplotlib.
>
> The question is: will the font be included in the .ps and in the .pdf?
>
> If not, which is most likely, it's upon the renderer to decide what to do
> if the requested glyph in the requested font is present or not in the
> system.
>
> pdf is more likely to have the fonts / glyphs used also embeded in the
> pdf. One reason for them to be bigger than .ps. Ps, on the other hand, most
> of the times relys on the renderer to have the exact same font, referenced
> by name, pre-loaded in the system. Go figure.
>
> To sum it up: use the old 7-bit equivalent for the degree sign, not any
> fancydancy UTF-8 character that is commonly not included in ye olde style
> postscript standard font embedded into your laser printer waaaay back then
> in the last millenium...
>
> Am 26.02.2013 um 21:26 schrieb Gökhan Sever:
>
> >
> >
> > On Tue, Feb 26, 2013 at 8:29 AM, Pierre Haessig <
> pie...@cr...> wrote:
> > Le 26/02/2013 14:38, Gökhan Sever a écrit :
> >>
> >> Could you test my outputs if they look fine on your side?
> >>
> >> http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf
> >> http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps
> >>
> > Good idea !
> >
> > * your PDF file looks fine with Okular
> > * your PS indeed has the problem you describe (again Okular) :
> > - "°" (degree sign) is fine
> > - but "0" (zero superscript) is replaced by "?"
> >
> > In case it may explain the difference : I'm using mpl 1.1.1rc2 from
> Debian testing
> > and I have the following line in my matplotlibrc (is it relevant ???)
> >
> > font.sans-serif : DejaVu Sans, sans-serif
> >
> > Best,
> > Pierre
> >
> > My matplotlib is a git clone of a couple weeks old.
> >
> > There is this line in the PS file (opening via vim)
> >
> > %%BeginResource: font KDYSTE+NewCenturySchlbk-Roman
> >
> > don't know where it gets this.
> >
> > #font.serif : DejaVu Serif, Bitstream Vera Serif, New Century
> Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus
> Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
> > font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida Grande,
> Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
> >
> > PS uses that even I choose to use fot.sans-serif.
> >
> > Dont see any font specification in the PDF file.
> >
> >
> >
> > --
> > Gökhan
> ------------------------------------------------------------------------------
> > Everyone hates slow websites. So do we.
> > Make your web apps faster with AppDynamics
> > Download AppDynamics Lite for free today:
> >
> http://p.sf.net/sfu/appdyn_d2d_feb_______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Gökhan
From: Pierre H. <pie...@cr...> - 2013年02月28日 18:34:35
Attachments: signature.asc
Hi,
Le 27/02/2013 10:01, Sudheer Joseph a écrit :
> I was checking the plt.xcorr and it calls the np.correlate in side it.
> It calls np.correlate(ts1,ts2, mode=2).
Just as a side note, mode=2 is the old fashioned way to specify
mode='full' [1]. This may help in reading the numpy.correlate doc.
This being said, I'm really unfamiliar with cross-correlations. I just
kind of know the usual 95% confidence interval for autocorrelation at
1.96/sqrt(n). Just as a quick check, this is what R uses by default, but
there are options like ci.type get more appropriate intervals for an MA
series
(http://stat.ethz.ch/R-manual/R-patched/library/stats/html/plot.acf.html)
best,
Pierre
[1] https://github.com/numpy/numpy/blob/master/numpy/core/numeric.py#L678
Hi,
I need to set the frame off for my plots, so that I can have axes only on the sides I want, rather than on all four sides.
I do it this way:
from pylab import *
fig = figure(figsize=(3,2),dpi=300,facecolor='w')
ax = fig.add_subplot(111,frameon=False)
ax.add_artist(Line2D((0, 0), (0, 1),color='k',linewidth=0.5))
ax.add_artist(Line2D((1, 1), (0, 1),color='k',linewidth=0.5))
ax.set_yticks([0,1])
ax.set_xticks([0,1])
show()
Unfortunately, now the ticks and axes-lines are misaligned, as seen in the screenshots attached. In the second screenshot, I've panned the plot, so the misalignment is even more visible.
matplotlib.__version__ gives '1.1.1rc'
matplotlib.get_backend() gives 'TkAgg'
-------
If I use 'WX' backend by adding these two line before the above code (before pylab import):
import matplotlib
matplotlib.use('WX')
then the misalignment still appears to be there, but that is because the Line2Ds are clipped in their width, but the ticks are not. This is seen by panning the plot.
I can set the clipping of the Line2Ds off by doing:
l1 = ax.add_artist(Line2D((0, 0), (0, 1),color='k',linewidth=0.5))
l1.set_clip_on(False)
l2 = ax.add_artist(Line2D((1, 1), (0, 1),color='k',linewidth=0.5))
l2.set_clip_on(False)
So, WX backend is fine.
Backend 'GTK' doesn't even have the above clipping problem.
-------
But any workarounds for the TkAgg backend? Because my production machine doesn't have either wx or pygtk installed, so I can only use TkAgg.
Thanks,
Aditya.
From: CAB <ca...@ya...> - 2013年02月28日 14:52:00
That did it, Ben!
Many thanks,
Chad
________________________________
 From: Benjamin Root <ben...@ou...>
To: CAB <ca...@ya...> 
Cc: Matplotlib Users <mat...@li...> 
Sent: Thursday, February 28, 2013 8:19 AM
Subject: Re: [Matplotlib-users] getting matplotlib to recognize a new font
 
On Thu, Feb 28, 2013 at 8:40 AM, CAB <ca...@ya...> wrote:
Hi, All,
>
>
>I am using matplotlib 1.2.0 under Windows 7 64-bit.
>
>
>I am trying to get matplotlib to recognize a new font that I downloaded (Arimo, for the curious). I put the .ttf files in the matplotlib ttf font directory (...\\fonts\\ttf\\ArimoRegularLatin.ttf, etc.), where Bitstream Vera Sans, STIX, etc. live. But matplotlib does not recognize the new font, and defaults to Vera Sans. If I load the font_manager and do a findfont, it does not find the new font and defualts to Vera Sans.
>
>
>I also tried putting the ttf files in the system font location, with the same results. When I do this, other programs like Word can see and use the font.
>
>
>Is there some trick that I'm missing, here?
>
>
>Thanks,
>Chad
>
Most likely, you need to clear out matplotlib's font cache. How to do that for windows, I don't know, but for Linux, it is as simple as "rm ~/.matplotlib/fontList.cache". Maybe there is a similar file somewhere on your system. After getting rid of that file, at the next import of matplotlib, it will recognize that that file is gone and rebuild it.
Cheers!
Ben
From: Pierre H. <pie...@cr...> - 2013年02月28日 14:49:39
Attachments: signature.asc
Hi Thomas,
Le 27/02/2013 20:59, Thomas Sprinzing a écrit :
> To sum it up: use the old 7-bit equivalent for the degree sign, not any fancydancy UTF-8 character that is commonly not included in ye olde style postscript standard font embedded into your laser printer waaaay back then in the last millenium... 
Just out of curiosity, I looked at the list of ASCII printable
characters
(http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters) and
didn't find the degree sign. However, I found it in the so-called "8
bits extensions", which I believe is just the same as the Unicode U+00B0
character.
best,
Pierre
From: Benjamin R. <ben...@ou...> - 2013年02月28日 14:49:13
On Thu, Feb 28, 2013 at 8:40 AM, CAB <ca...@ya...> wrote:
> Hi, All,
>
> I am using matplotlib 1.2.0 under Windows 7 64-bit.
>
> I am trying to get matplotlib to recognize a new font that I downloaded
> (Arimo, for the curious). I put the .ttf files in the matplotlib ttf font
> directory (...\\fonts\\ttf\\ArimoRegularLatin.ttf, etc.), where Bitstream
> Vera Sans, STIX, etc. live. But matplotlib does not recognize the new
> font, and defaults to Vera Sans. If I load the font_manager and do a
> findfont, it does not find the new font and defualts to Vera Sans.
>
> I also tried putting the ttf files in the system font location, with the
> same results. When I do this, other programs like Word can see and use the
> font.
>
> Is there some trick that I'm missing, here?
>
> Thanks,
> Chad
>
>
Most likely, you need to clear out matplotlib's font cache. How to do that
for windows, I don't know, but for Linux, it is as simple as "rm
~/.matplotlib/fontList.cache". Maybe there is a similar file somewhere on
your system. After getting rid of that file, at the next import of
matplotlib, it will recognize that that file is gone and rebuild it.
Cheers!
Ben
From: CAB <ca...@ya...> - 2013年02月28日 13:42:29
Hi, All,
I am using matplotlib 1.2.0 under Windows 7 64-bit.
I am trying to get matplotlib to recognize a new font that I downloaded (Arimo, for the curious). I put the .ttf files in the matplotlib ttf font directory (...\\fonts\\ttf\\ArimoRegularLatin.ttf, etc.), where Bitstream Vera Sans, STIX, etc. live. But matplotlib does not recognize the new font, and defaults to Vera Sans. If I load the font_manager and do a findfont, it does not find the new font and defualts to Vera Sans.
I also tried putting the ttf files in the system font location, with the same results. When I do this, other programs like Word can see and use the font.
Is there some trick that I'm missing, here?
Thanks,
Chad
From: marcelo <mc...@gm...> - 2013年02月27日 23:31:47
Hello,
Does matplotlib recognize the file generated by a file sink in GNU Radio? I
guess its format is '.dat'.
I want to read the information in this file and create some graphics.
Thanks!
M
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Reading-GRC-file-in-matplotlib-tp40499.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: lkz2366 <ac...@sa...> - 2013年02月27日 23:13:30
Ok, I finally got it working after a couple of hours of experimenting. I
couldn't figure out how to get your methods to work, maybe because I'm such
a novice at Python. But, it was as easy as using a simple 'for' loop.
num = the number of lists to plot
time = a list of lists
volts = a list of lists
figure()
for x in range(0,num):
 plot(time[x],volt[x])
show()
<http://matplotlib.1069221.n5.nabble.com/file/n40498/screenshot.png> 
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Multiple-XY-plots-tp40451p40498.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Paul H. <pmh...@gm...> - 2013年02月27日 21:52:43
On Wed, Feb 27, 2013 at 1:01 AM, Sudheer Joseph <sud...@ya...>wrote:
> Dear Pierre,
> I was checking the plt.xcorr and it calls the
> np.correlate in side it. It calls np.correlate(ts1,ts2, mode=2).
> Is there a way to see which vector is sided back in time? ie
> ts1[t1,t2,t3,t4....] ts2[t1,t2,t3,t4...] ( ts2[t2] correlated with ts1[t1]
> or ts2[t1] is correlated with ts2[t2] ie {to make out which one is the
> cause and which is effect)
> in case of cross correlation it can be obtained by either sliding ts1 back
> in time or ts2 back in time. Is there a way to know this? I am not able to
> make much from np.correlate. Also is there a way to get 95% significance or
> p value from the xcorr.? in case of matlab? in matlab xcorr can be called
> with option of corcoeff instead of default cross correlation but is there
> similar option for matplotlib?
> sincerely.
> Sudheer
>
>
Sudheer:
It sounds like your needs are beyond the scope of matplotlib. It'll
probably be more productive to check in with the numpy or scipy mailing
lists.
-paul
From: Jeff W. - N. F. <jef...@no...> - 2013年02月27日 21:13:39
> Marcello Vichi <mailto:mar...@bo...>
> February 27, 2013 1:40 PM
> Thanks Jeff
>
> this is what I have
>
> In [1]: import matplotlib
> In [2]: matplotlib.__version__
> Out[2]: '1.2.0'
Marcello: As a workaround you could mask the data outside the bounding 
lat of the projection before you draw the contour lines. Something like 
this ought to do it:
from numpy import ma
sst = ma.masked_array(sst, mask=lats>-40)
-Jeff
>
> I also tried with a different dataset, the one from
> http://matplotlib.org/basemap/users/examples.html
> and I get the same problem
>
> from mpl_toolkits.basemap import Basemap
> from netCDF4 import Dataset
> import numpy as np
> import matplotlib.pyplot as plt
> date = '20071215' # date to plot.
> # open dataset for that date.
> dataset = \
> Dataset('http://www.ncdc.noaa.gov/thredds/dodsC/oisst/NetCDF/AVHRR-AMSR/%s/AVHRR-AMSR/amsr-avhrr-v2.%s.nc.gz'% 
>
> (date[0:4],date))
> # read sst. Will automatically create a masked array using
> # missing_value variable attribute. 'squeeze out' singleton dimensions.
> sst = dataset.variables['sst'][:].squeeze()
> # read ice.
> ice = dataset.variables['ice'][:].squeeze()
> # read lats and lons (representing centers of grid boxes).
> lats = dataset.variables['lat'][:]
> lons = dataset.variables['lon'][:]
> # shift lats, lons so values represent edges of grid boxes
> # (as pcolor expects).
> delon = lons[1]-lons[0]; delat = lats[1]-lats[0]
> lons = (lons - 0.5*delon).tolist()
> lons.append(lons[-1]+delon)
> lons = np.array(lons,np.float64)
> lats = (lats - 0.5*delat).tolist()
> lats.append(lats[-1]+delat)
> lats = np.array(lats,np.float64)
> # create figure, axes instances.
> fig = plt.figure()
> ax = fig.add_axes([0.05,0.05,0.9,0.9])
> m = 
> Basemap(projection='spaeqd',lat_0=-90,lon_0=180,resolution='l',boundinglat=-40,round=True) 
>
> x, y = m(*np.meshgrid(lons, lats))
> o=m.drawcoastlines(linewidth=0.25)
> o=m.drawcountries(linewidth=0.25)
> o=m.fillcontinents(color="grey",lake_color='white')
> o=m.drawmeridians(np.arange(0,360,30),labels=[1,1,1,1])
> o=m.drawparallels(np.arange(-90,90,10),labels=[1,1,1,1])
> cim=m.contour(x[:-1,:-1],y[:-1,:-1],sst,arange(2,28,2),linewidths=0.5,colors='k') 
>
> plt.clabel(cim, inline=1, fontsize=10, fmt = '%.1f',)
>
>
>
>
> Jeff Whitaker <mailto:jef...@no...>
> February 27, 2013 11:59 AM
>
>
> Marcello: I cannot reproduce your problem. From the github pull 
> request you mention, it seems like this was fixed about 3 months ago. 
> What version of basemap are you running?
>
> -Jeff
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> Marcello Vichi <mailto:mar...@bo...>
> February 19, 2013 7:33 AM
> When I plot contours in a stereographic south pole plot with a 
> bounding latitude and the rounded clipping
>
> Basemap(projection='spaeqd',lat_0=-90,lon_0=180,resolution='l',boundinglat=-40,round=True) 
>
>
> I see that the contours are correctly cut-off but not the contour 
> labels. They appear to be plotted according to a rectangular frame and 
> not the rounded one (see attached figure).
>
> Is it possible to mask the labels without having to mask the data?
>
> This issue may be related to an older topic:
> http://www.mail-archive.com/mat...@li.../msg02892.html 
>
> and to a more recent bugfix
> https://github.com/matplotlib/basemap/pull/89
> but I do not see any other clue
>
> thanks in advance
>
> marcello
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> 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. - N. F. <jef...@no...> - 2013年02月27日 21:07:55
> Marcello Vichi <mailto:mar...@bo...>
> February 27, 2013 1:40 PM
> Thanks Jeff
>
> this is what I have
>
> In [1]: import matplotlib
> In [2]: matplotlib.__version__
> Out[2]: '1.2.0'
Marcello: I asked what version of basemap you had, not matplotlib. 
Anyway, thanks for providing the script - with it I can reproduce the 
problem. It looks like the Text instances returned by clabel are not 
being clipped properly. Unfortunately, I don't have any idea why. I'll 
get back to you if I find a solution.
BTW: you don't need to shift the lons and lats to represent the center 
of the gridbox (that's only needed for pcolor).
-Jeff
>
> I also tried with a different dataset, the one from
> http://matplotlib.org/basemap/users/examples.html
> and I get the same problem
>
> from mpl_toolkits.basemap import Basemap
> from netCDF4 import Dataset
> import numpy as np
> import matplotlib.pyplot as plt
> date = '20071215' # date to plot.
> # open dataset for that date.
> dataset = \
> Dataset('http://www.ncdc.noaa.gov/thredds/dodsC/oisst/NetCDF/AVHRR-AMSR/%s/AVHRR-AMSR/amsr-avhrr-v2.%s.nc.gz'% 
>
> (date[0:4],date))
> # read sst. Will automatically create a masked array using
> # missing_value variable attribute. 'squeeze out' singleton dimensions.
> sst = dataset.variables['sst'][:].squeeze()
> # read ice.
> ice = dataset.variables['ice'][:].squeeze()
> # read lats and lons (representing centers of grid boxes).
> lats = dataset.variables['lat'][:]
> lons = dataset.variables['lon'][:]
> # shift lats, lons so values represent edges of grid boxes
> # (as pcolor expects).
> delon = lons[1]-lons[0]; delat = lats[1]-lats[0]
> lons = (lons - 0.5*delon).tolist()
> lons.append(lons[-1]+delon)
> lons = np.array(lons,np.float64)
> lats = (lats - 0.5*delat).tolist()
> lats.append(lats[-1]+delat)
> lats = np.array(lats,np.float64)
> # create figure, axes instances.
> fig = plt.figure()
> ax = fig.add_axes([0.05,0.05,0.9,0.9])
> m = 
> Basemap(projection='spaeqd',lat_0=-90,lon_0=180,resolution='l',boundinglat=-40,round=True) 
>
> x, y = m(*np.meshgrid(lons, lats))
> o=m.drawcoastlines(linewidth=0.25)
> o=m.drawcountries(linewidth=0.25)
> o=m.fillcontinents(color="grey",lake_color='white')
> o=m.drawmeridians(np.arange(0,360,30),labels=[1,1,1,1])
> o=m.drawparallels(np.arange(-90,90,10),labels=[1,1,1,1])
> cim=m.contour(x[:-1,:-1],y[:-1,:-1],sst,arange(2,28,2),linewidths=0.5,colors='k') 
>
> plt.clabel(cim, inline=1, fontsize=10, fmt = '%.1f',)
>
>
>
>
> Jeff Whitaker <mailto:jef...@no...>
> February 27, 2013 11:59 AM
>
>
> Marcello: I cannot reproduce your problem. From the github pull 
> request you mention, it seems like this was fixed about 3 months ago. 
> What version of basemap are you running?
>
> -Jeff
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> Marcello Vichi <mailto:mar...@bo...>
> February 19, 2013 7:33 AM
> When I plot contours in a stereographic south pole plot with a 
> bounding latitude and the rounded clipping
>
> Basemap(projection='spaeqd',lat_0=-90,lon_0=180,resolution='l',boundinglat=-40,round=True) 
>
>
> I see that the contours are correctly cut-off but not the contour 
> labels. They appear to be plotted according to a rectangular frame and 
> not the rounded one (see attached figure).
>
> Is it possible to mask the labels without having to mask the data?
>
> This issue may be related to an older topic:
> http://www.mail-archive.com/mat...@li.../msg02892.html 
>
> and to a more recent bugfix
> https://github.com/matplotlib/basemap/pull/89
> but I do not see any other clue
>
> thanks in advance
>
> marcello
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> 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: Marcello V. <mar...@bo...> - 2013年02月27日 20:41:32
Thanks Jeff
this is what I have
In [1]: import matplotlib
In [2]: matplotlib.__version__
Out[2]: '1.2.0'
I also tried with a different dataset, the one from
http://matplotlib.org/basemap/users/examples.html
and I get the same problem
from mpl_toolkits.basemap import Basemap
from netCDF4 import Dataset
import numpy as np
import matplotlib.pyplot as plt
date = '20071215' # date to plot.
# open dataset for that date.
dataset = \
Dataset('http://www.ncdc.noaa.gov/thredds/dodsC/oisst/NetCDF/AVHRR-AMSR/%s/AVHRR-AMSR/amsr-avhrr-v2.%s.nc.gz'%
 (date[0:4],date))
# read sst. Will automatically create a masked array using
# missing_value variable attribute. 'squeeze out' singleton dimensions.
sst = dataset.variables['sst'][:].squeeze()
# read ice.
ice = dataset.variables['ice'][:].squeeze()
# read lats and lons (representing centers of grid boxes).
lats = dataset.variables['lat'][:]
lons = dataset.variables['lon'][:]
# shift lats, lons so values represent edges of grid boxes
# (as pcolor expects).
delon = lons[1]-lons[0]; delat = lats[1]-lats[0]
lons = (lons - 0.5*delon).tolist()
lons.append(lons[-1]+delon)
lons = np.array(lons,np.float64)
lats = (lats - 0.5*delat).tolist()
lats.append(lats[-1]+delat)
lats = np.array(lats,np.float64)
# create figure, axes instances.
fig = plt.figure()
ax = fig.add_axes([0.05,0.05,0.9,0.9])
m = 
Basemap(projection='spaeqd',lat_0=-90,lon_0=180,resolution='l',boundinglat=-40,round=True)
x, y = m(*np.meshgrid(lons, lats))
o=m.drawcoastlines(linewidth=0.25)
o=m.drawcountries(linewidth=0.25)
o=m.fillcontinents(color="grey",lake_color='white')
o=m.drawmeridians(np.arange(0,360,30),labels=[1,1,1,1])
o=m.drawparallels(np.arange(-90,90,10),labels=[1,1,1,1])
cim=m.contour(x[:-1,:-1],y[:-1,:-1],sst,arange(2,28,2),linewidths=0.5,colors='k')
plt.clabel(cim, inline=1, fontsize=10, fmt = '%.1f',)
On 27/02/13 19:59, Jeff Whitaker wrote:
>
>
>> Marcello Vichi <mailto:mar...@bo...>
>> February 19, 2013 7:33 AM
>> When I plot contours in a stereographic south pole plot with a
>> bounding latitude and the rounded clipping
>>
>> Basemap(projection='spaeqd',lat_0=-90,lon_0=180,resolution='l',boundinglat=-40,round=True)
>>
>>
>> I see that the contours are correctly cut-off but not the contour
>> labels. They appear to be plotted according to a rectangular frame and
>> not the rounded one (see attached figure).
>>
>> Is it possible to mask the labels without having to mask the data?
>>
>> This issue may be related to an older topic:
>> http://www.mail-archive.com/mat...@li.../msg02892.html
>>
>> and to a more recent bugfix
>> https://github.com/matplotlib/basemap/pull/89
>> but I do not see any other clue
>>
>> thanks in advance
>>
>> marcello
> Marcello: I cannot reproduce your problem. From the github pull request
> you mention, it seems like this was fixed about 3 months ago. What
> version of basemap are you running?
>
> -Jeff
-- 
Dr Marcello Vichi
Centro Euro-Mediterraneo sui Cambiamenti Climatici (CMCC)
Istituto Nazionale di Geofisica e Vulcanologia (INGV)
Viale Aldo Moro 44, 40127 Bologna. Italy
Tel: +39 051 3782631 Fax: +39 051 3782654
Email: mar...@cm..., mar...@bo...
skype: marcello_vichi
From: Thomas S. <spr...@hd...> - 2013年02月27日 20:01:50
I'd say it's got nearly nothing to do with matplotlib.
The question is: will the font be included in the .ps and in the .pdf?
If not, which is most likely, it's upon the renderer to decide what to do if the requested glyph in the requested font is present or not in the system.
pdf is more likely to have the fonts / glyphs used also embeded in the pdf. One reason for them to be bigger than .ps. Ps, on the other hand, most of the times relys on the renderer to have the exact same font, referenced by name, pre-loaded in the system. Go figure.
To sum it up: use the old 7-bit equivalent for the degree sign, not any fancydancy UTF-8 character that is commonly not included in ye olde style postscript standard font embedded into your laser printer waaaay back then in the last millenium... 
Am 26.02.2013 um 21:26 schrieb Gökhan Sever:
> 
> 
> On Tue, Feb 26, 2013 at 8:29 AM, Pierre Haessig <pie...@cr...> wrote:
> Le 26/02/2013 14:38, Gökhan Sever a écrit :
>> 
>> Could you test my outputs if they look fine on your side?
>> 
>> http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf
>> http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps
>> 
> Good idea ! 
> 
> * your PDF file looks fine with Okular
> * your PS indeed has the problem you describe (again Okular) :
> - "°" (degree sign) is fine
> - but "0" (zero superscript) is replaced by "?"
> 
> In case it may explain the difference : I'm using mpl 1.1.1rc2 from Debian testing
> and I have the following line in my matplotlibrc (is it relevant ???)
> 
> font.sans-serif : DejaVu Sans, sans-serif
> 
> Best,
> Pierre
> 
> My matplotlib is a git clone of a couple weeks old. 
> 
> There is this line in the PS file (opening via vim)
> 
> %%BeginResource: font KDYSTE+NewCenturySchlbk-Roman
> 
> don't know where it gets this.
> 
> #font.serif : DejaVu Serif, Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
> font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
> 
> PS uses that even I choose to use fot.sans-serif.
> 
> Dont see any font specification in the PDF file.
> 
> 
> 
> -- 
> Gökhan ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Michael D. <md...@st...> - 2013年02月27日 19:48:39
That feature is specific to the Qt4 backend.
Mike
On 02/27/2013 02:23 PM, Jonno wrote:
> Can anyone explain to me why I don't see the "Edit Curves Line and 
> Axes Parameters" button in the matplotlib toolbar when using 
> matplotlib.backends.backend_wxagg.NavigationToolbar2Wx
>
> The example code here creates a Matplotlib plot with the matplotlib 
> toolbar including all buttons except for the one above.
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jonno <jon...@gm...> - 2013年02月27日 19:24:05
Can anyone explain to me why I don't see the "Edit Curves Line and Axes
Parameters" button in the matplotlib toolbar when using
matplotlib.backends.backend_wxagg.NavigationToolbar2Wx
The example code here creates a Matplotlib plot with the matplotlib toolbar
including all buttons except for the one above.
From: Jeff W. <jef...@no...> - 2013年02月27日 19:01:48
> Marcello Vichi <mailto:mar...@bo...>
> February 19, 2013 7:33 AM
> When I plot contours in a stereographic south pole plot with a 
> bounding latitude and the rounded clipping
>
> Basemap(projection='spaeqd',lat_0=-90,lon_0=180,resolution='l',boundinglat=-40,round=True) 
>
>
> I see that the contours are correctly cut-off but not the contour 
> labels. They appear to be plotted according to a rectangular frame and 
> not the rounded one (see attached figure).
>
> Is it possible to mask the labels without having to mask the data?
>
> This issue may be related to an older topic:
> http://www.mail-archive.com/mat...@li.../msg02892.html 
>
> and to a more recent bugfix
> https://github.com/matplotlib/basemap/pull/89
> but I do not see any other clue
>
> thanks in advance
>
> marcello 
Marcello: I cannot reproduce your problem. From the github pull request 
you mention, it seems like this was fixed about 3 months ago. What 
version of basemap are you running?
-Jeff
From: Paul H. <pmh...@gm...> - 2013年02月27日 16:03:07
On Wed, Feb 27, 2013 at 1:49 AM, Rita <rmo...@gm...> wrote:
> Hi,
>
> I am currently plotting cpu utilization over time (plot_time). I would
> like the color of my line to be red when at 100%. 80-90% a bit less red,
> more yellow, and lower numbers will be green. Any thoughts of doing this?
>
A few years ago, Gökhan Sever posted this technique, which is the simplest
and best I've seen:
##
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
x = np.linspace(0, 3 * np.pi, 5000)
y = np.sin(x)
z = np.cos(0.5 * (x[:-1] + x[1:])) # 1st derivative
cmap_z = cm.coolwarm(z)
fig, ax1 = plt.subplots(nrows=1, ncols=1)
ax1.scatter(x, y, c=cmap_z, marker='_', s=5)
fig.show()
##
From: Jakob G. <ga...@il...> - 2013年02月27日 10:26:27
Hi
have a look at http://matplotlib.org/examples/pylab_examples/multicolored_line.html and
http://matplotlib.org/examples/pylab_examples/show_colormaps.html.
br
Jakob
On 02/27/2013 10:49 AM, Rita wrote:
> Hi,
>
> I am currently plotting cpu utilization over time (plot_time). I would like the color of my line to be
> red when at 100%. 80-90% a bit less red, more yellow, and lower numbers will be green. Any thoughts of
> doing this?
>
>
> --
> --- Get your facts first, then you can distort them as you please.--
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Phil E. <pel...@gm...> - 2013年02月27日 10:13:09
Joe Kington's answer is the best solution I've seen to this problem:
http://stackoverflow.com/questions/13622909/matplotlib-how-to-colorize-a-large-number-of-line-segments-as-independent-gradi
There is also an example in the gallery:
http://matplotlib.org/examples/pylab_examples/multicolored_line.html
HTH
On 27 February 2013 09:49, Rita <rmo...@gm...> wrote:
> Hi,
>
> I am currently plotting cpu utilization over time (plot_time). I would
> like the color of my line to be red when at 100%. 80-90% a bit less red,
> more yellow, and lower numbers will be green. Any thoughts of doing this?
>
>
> --
> --- Get your facts first, then you can distort them as you please.--
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Rita <rmo...@gm...> - 2013年02月27日 09:50:30
Hi,
I am currently plotting cpu utilization over time (plot_time). I would like
the color of my line to be red when at 100%. 80-90% a bit less red, more
yellow, and lower numbers will be green. Any thoughts of doing this?
-- 
--- Get your facts first, then you can distort them as you please.--
From: Sudheer J. <sud...@ya...> - 2013年02月27日 09:02:20
Dear Pierre,
            I was checking the plt.xcorr and it calls the np.correlate in side it. It calls np.correlate(ts1,ts2, mode=2).
Is there a way to see which vector is sided back in time? ie ts1[t1,t2,t3,t4....] ts2[t1,t2,t3,t4...] ( ts2[t2] correlated with ts1[t1] or ts2[t1] is correlated with ts2[t2] ie {to make out which one is the cause and which is effect)
in case of cross correlation it can be obtained by either sliding ts1 back in time or ts2 back in time. Is there a way to know this? I am not able to make much from np.correlate. Also is there a way to get 95% significance or p value from the xcorr.? in case of matlab? in matlab xcorr can be called with option of corcoeff instead of default cross correlation but is there similar option for matplotlib?
sincerely.
Sudheer
          
 
***************************************************************
Sudheer Joseph 
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.
Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo...@gm...;sud...@ya...
Web- http://oppamthadathil.tripod.com
***************************************************************
________________________________
From: Scott H. <st...@co...> - 2013年02月26日 22:30:29
I am interested in using basemap and gdal to plot a georeferenced image, draw features on top of it, and then resave to the same georeferenced format. 
I'm wondering the easiest way to go about this. I made a first attempt (script & file attached), but am getting mixed up with all the coordinates (figure,image,georeferenced).
Thanks for any advice,
Scott
From: Gökhan S. <gok...@gm...> - 2013年02月26日 20:26:40
On Tue, Feb 26, 2013 at 8:29 AM, Pierre Haessig <pie...@cr...>wrote:
> Le 26/02/2013 14:38, Gökhan Sever a écrit :
>
>
> Could you test my outputs if they look fine on your side?
>
> http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf
> http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps
>
> Good idea !
>
> * your PDF file looks fine with Okular
> * your PS indeed has the problem you describe (again Okular) :
> - "°" (degree sign) is fine
> - but "0" (zero superscript) is replaced by "?"
>
> In case it may explain the difference : I'm using mpl 1.1.1rc2 from Debian
> testing
> and I have the following line in my matplotlibrc (is it relevant ???)
>
> font.sans-serif : DejaVu Sans, sans-serif
>
> Best,
> Pierre
>
My matplotlib is a git clone of a couple weeks old.
There is this line in the PS file (opening via vim)
%%BeginResource: font KDYSTE+NewCenturySchlbk-Roman
don't know where it gets this.
#font.serif : DejaVu Serif, Bitstream Vera Serif, New Century
Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus
Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida Grande,
Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
PS uses that even I choose to use fot.sans-serif.
Dont see any font specification in the PDF file.
-- 
Gökhan

Showing results of 89

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