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





Showing 17 results of 17

From: Mark B. <ma...@gm...> - 2007年12月14日 23:20:04
I would guess:
CS=contour(A,[50,])
CS.clabel(fmt=FormatFaker('I')) # Labels contour 50 with I
CS=contour(A,[60,])
CS.clabel(fmt=FormatFaker('II')) # Labels contour 60 with II
Or write a loop if you have many values.
Mark
On Dec 14, 2007 11:44 PM, Michael Hearne <mh...@us...> wrote:
> I've seen this, but I'm not clever enough to see how to extend that to
> multiple levels - after all, I don't want to label every line with the same
> string...
> --Mike
> On Dec 14, 2007, at 3:20 PM, Mark Bakker wrote:
>
> Michael -
>
> This trick for replacing contour labels with a string was posted a little
> while back (by someone else):*
> *
>
> class FormatFaker(object):
> def __init__(self, str): self.str = str
> def __mod__(self, stuff): return self.str
>
> A=arange(100).reshape(10,10)
> CS=contour(A,[50,])
> CS.clabel(fmt=FormatFaker('Some String'))
>
>
>
> >
> > From: Michael Hearne <mh...@us... >
> > Subject: [Matplotlib-users] labeling contours with roman numerals
> > To: Matplotlib Users <mat...@li...>
> > Message-ID: < 843...@us...>
> > Content-Type: text/plain; charset="us-ascii"
> >
> > Does a LineCollection generated by contour() have a property that
> > holds the labels? I would like to label my contour lines with roman
> > numerals, and cannot figure out how to get clabel to do that.
> >
> > Thanks,
> >
> > Mike
> >
> >
> >
>
>
>
>
> ------------------------------------------------------
> Michael Hearne
> mh...@us...
> (303) 273-8620
> USGS National Earthquake Information Center
> 1711 Illinois St. Golden CO 80401
> Senior Software Engineer
> Synergetics, Inc.
> ------------------------------------------------------
>
>
>
From: Michael H. <mh...@us...> - 2007年12月14日 22:45:06
I've seen this, but I'm not clever enough to see how to extend that 
to multiple levels - after all, I don't want to label every line with 
the same string...
--Mike
On Dec 14, 2007, at 3:20 PM, Mark Bakker wrote:
> Michael -
> This trick for replacing contour labels with a string was posted a 
> little while back (by someone else):
> class FormatFaker(object):
> def __init__(self, str): self.str = str
> def __mod__(self, stuff): return self.str
>
> A=arange(100).reshape(10,10)
> CS=contour(A,[50,])
> CS.clabel(fmt=FormatFaker('Some String'))
>
>
>
> From: Michael Hearne <mh...@us... >
> Subject: [Matplotlib-users] labeling contours with roman numerals
> To: Matplotlib Users <mat...@li...>
> Message-ID: < 843...@us...>
> Content-Type: text/plain; charset="us-ascii"
>
> Does a LineCollection generated by contour() have a property that
> holds the labels? I would like to label my contour lines with roman
> numerals, and cannot figure out how to get clabel to do that.
>
> Thanks,
>
> Mike
>
>
>
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
From: Mark B. <ma...@gm...> - 2007年12月14日 22:20:32
Michael -
This trick for replacing contour labels with a string was posted a little
while back (by someone else):*
*
class FormatFaker(object):
 def __init__(self, str): self.str = str
 def __mod__(self, stuff): return self.str
A=arange(100).reshape(10,10)
CS=contour(A,[50,])
CS.clabel(fmt=FormatFaker('Some String'))
>
> From: Michael Hearne <mh...@us...>
> Subject: [Matplotlib-users] labeling contours with roman numerals
> To: Matplotlib Users <mat...@li...>
> Message-ID: <843...@us...>
> Content-Type: text/plain; charset="us-ascii"
>
> Does a LineCollection generated by contour() have a property that
> holds the labels? I would like to label my contour lines with roman
> numerals, and cannot figure out how to get clabel to do that.
>
> Thanks,
>
> Mike
>
>
>
From: Jeff W. <js...@fa...> - 2007年12月14日 20:48:11
Michael Hearne wrote:
> Jeff - Yes! I'm working on implementing this now for my app...
>
> FYI, I got the following error:
> TypeError: drawmapboundary() got an unexpected keyword argument 
> 'fill_color'
>
>
> and again for 'lake_color' on the fillcontinents() method.
>
> I'm using 0.9.7, which I think is the latest released version...
Mike: Those are new keywords in 0.9.8 (released a few weeks ago).
-Jeff
>
> --Mike
> On Dec 14, 2007, at 1:31 PM, Jeff Whitaker wrote:
>
>> from matplotlib.toolkits.basemap import Basemap
>>
>> import pylab
>>
>> fig = pylab.figure()
>>
>> ax1 = fig.add_axes([0.1,0.1,0.8,0.8])
>>
>> m = Basemap(ax=ax1)
>>
>> m.drawcoastlines(linewidth=0.5)
>>
>> m.fillcontinents()
>>
>> ax2 = fig.add_axes([0.1,0.425,0.15,0.15])
>>
>> m2 = Basemap(projection='ortho',lon_0=-105,lat_0=40,ax=ax2)
>>
>> m2.drawmapboundary(fill_color='aqua')
>>
>> m2.drawcoastlines(linewidth=0.1)
>>
>> m2.fillcontinents(color='coral',lake_color='aqua')
>>
>> pylab.show()
>>
>
>
>
>
> ------------------------------------------------------
> Michael Hearne
> mh...@us... <mailto:mh...@us...>
> (303) 273-8620
> USGS National Earthquake Information Center
> 1711 Illinois St. Golden CO 80401
> Senior Software Engineer
> Synergetics, Inc.
> ------------------------------------------------------
>
>
-- 
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-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Michael H. <mh...@us...> - 2007年12月14日 20:38:46
Jeff - Yes! I'm working on implementing this now for my app...
FYI, I got the following error:
TypeError: drawmapboundary() got an unexpected keyword argument 
'fill_color'
and again for 'lake_color' on the fillcontinents() method.
I'm using 0.9.7, which I think is the latest released version...
--Mike
On Dec 14, 2007, at 1:31 PM, Jeff Whitaker wrote:
> from matplotlib.toolkits.basemap import Basemap
> import pylab
> fig = pylab.figure()
> ax1 = fig.add_axes([0.1,0.1,0.8,0.8])
> m = Basemap(ax=ax1)
> m.drawcoastlines(linewidth=0.5)
> m.fillcontinents()
> ax2 = fig.add_axes([0.1,0.425,0.15,0.15])
> m2 = Basemap(projection='ortho',lon_0=-105,lat_0=40,ax=ax2)
> m2.drawmapboundary(fill_color='aqua')
> m2.drawcoastlines(linewidth=0.1)
> m2.fillcontinents(color='coral',lake_color='aqua')
> pylab.show()
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
From: Jeff W. <js...@fa...> - 2007年12月14日 20:31:29
Attachments: testinset.png
Michael Hearne wrote:
> Jeff - Yes, that's what I want, thanks.
>
> I think more explanation is in order - my large-scale map is the 
> default basemap projection. The inset map of the globe is a 
> orthogonal projection, which means it comes out as a little circle. I 
> want to insert this smaller map into the larger one, without having to 
> see the area around the circle.
>
> I'm having trouble explaining this... here's an example:
> http://earthquake.usgs.gov/eqcenter/pager/us/2007kwau/us/1/onePAGER.pdf
>
> I want to replicate the little inset globe on the map with the contours.
>
> --Mike
Mike: Something like this?
from matplotlib.toolkits.basemap import Basemap
import pylab
fig = pylab.figure()
ax1 = fig.add_axes([0.1,0.1,0.8,0.8])
m = Basemap(ax=ax1)
m.drawcoastlines(linewidth=0.5)
m.fillcontinents()
ax2 = fig.add_axes([0.1,0.425,0.15,0.15])
m2 = Basemap(projection='ortho',lon_0=-105,lat_0=40,ax=ax2)
m2.drawmapboundary(fill_color='aqua')
m2.drawcoastlines(linewidth=0.1)
m2.fillcontinents(color='coral',lake_color='aqua')
pylab.show()
-Jeff
-- 
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-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Michael H. <mh...@us...> - 2007年12月14日 20:03:03
Jeff - Yes, that's what I want, thanks.
I think more explanation is in order - my large-scale map is the 
default basemap projection. The inset map of the globe is a 
orthogonal projection, which means it comes out as a little circle. 
I want to insert this smaller map into the larger one, without having 
to see the area around the circle.
I'm having trouble explaining this... here's an example:
http://earthquake.usgs.gov/eqcenter/pager/us/2007kwau/us/1/onePAGER.pdf
I want to replicate the little inset globe on the map with the contours.
--Mike
On Dec 14, 2007, at 12:49 PM, Jeff Whitaker wrote:
> Michael Hearne wrote:
>> Jeff - Darn it. So is there a way to embed an axis _inside_ 
>> another, possibly with a transparent background?
>>
>> --Mike
>
>
> Mike: Not quite sure why you need to have it transparent - you 
> definitely can't have that with postscript, but it should be 
> possible with the other backends (png, pdf or svg). There's an 
> example of embedded axes at http://matplotlib.sourceforge.net/ 
> screenshots.html (axes_demo.py). The inset axes is just drawn on 
> top of the primary axes in the same figure. Is that what you want?
>
> -Jeff
>
>> On Dec 14, 2007, at 12:28 PM, Jeff Whitaker wrote:
>>
>>> Michael Hearne wrote:
>>>> I am using Basemap, and trying to create two maps:
>>>>
>>>> One large-scale map, and a small-scale inset map of the world 
>>>> centered on the location of the large-scale map. My ultimate 
>>>> goal is to create a figure where the inset map is inserted into 
>>>> a corner of the large-scale map. I can see two ways of doing this:
>>>>
>>>> 1) Create both as encapsulated postscript images separately, and 
>>>> put them together in a later "compositing" process. (I'm doing 
>>>> this already).
>>>> 2) Create both as basemap instances, and then draw the smaller 
>>>> one on top of the large-scale one. I have no idea how to do this.
>>>>
>>>> A problem I have encountered with the first method is that my 
>>>> image background is set to white by default. I've tried to make 
>>>> it transparent by doing the following:
>>>>
>>>> fig = figure(figsize=(5,5),frameon=False) #turn the frame off 
>>>> completely
>>>> fig.figurePatch.set_alpha(0.0) #tried setting this to 1.0 and 
>>>> 0.0, neither works
>>>>
>>>> Method #2 would be cleaner, if I could do what I wanted to do in 
>>>> terms of transparencies, but if not, I'll take method #1.
>>>>
>>>> Does anyone know if it is possible to set the image background 
>>>> transparent for encapsulated postscript output?
>>>>
>>>> Thanks,
>>>>
>>>> Mike
>>>
>>> Mike: Postscript doesn't support alpha transparency. It might 
>>> work with PDF though.
>>>
>>> -Jeff
>>>
>>> -- 
>>> Jeffrey S. Whitaker Phone : (303)497-6313
>>> Meteorologist FAX : (303)497-6449
>>> NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 
>>> <mailto:Jef...@no...>
>>> 325 Broadway Office : Skaggs Research Cntr 1D-124
>>> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
>>
>>
>>
>>
>> ------------------------------------------------------
>> Michael Hearne
>> mh...@us... <mailto:mh...@us...>
>> (303) 273-8620
>> USGS National Earthquake Information Center
>> 1711 Illinois St. Golden CO 80401
>> Senior Software Engineer
>> Synergetics, Inc.
>> ------------------------------------------------------
>>
>>
>
>
> -- 
> 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-124
> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
From: Jeff W. <js...@fa...> - 2007年12月14日 19:50:06
Michael Hearne wrote:
> Jeff - Darn it. So is there a way to embed an axis _inside_ another, 
> possibly with a transparent background?
>
> --Mike
Mike: Not quite sure why you need to have it transparent - you 
definitely can't have that with postscript, but it should be possible 
with the other backends (png, pdf or svg). There's an example of 
embedded axes at http://matplotlib.sourceforge.net/screenshots.html 
(axes_demo.py). The inset axes is just drawn on top of the primary axes 
in the same figure. Is that what you want?
-Jeff
> On Dec 14, 2007, at 12:28 PM, Jeff Whitaker wrote:
>
>> Michael Hearne wrote:
>>> I am using Basemap, and trying to create two maps:
>>>
>>> One large-scale map, and a small-scale inset map of the world 
>>> centered on the location of the large-scale map. My ultimate goal 
>>> is to create a figure where the inset map is inserted into a corner 
>>> of the large-scale map. I can see two ways of doing this:
>>>
>>> 1) Create both as encapsulated postscript images separately, and put 
>>> them together in a later "compositing" process. (I'm doing this 
>>> already).
>>> 2) Create both as basemap instances, and then draw the smaller one 
>>> on top of the large-scale one. I have no idea how to do this.
>>>
>>> A problem I have encountered with the first method is that my image 
>>> background is set to white by default. I've tried to make it 
>>> transparent by doing the following:
>>>
>>> fig = figure(figsize=(5,5),frameon=False) #turn the frame off completely
>>> fig.figurePatch.set_alpha(0.0) #tried setting this to 1.0 and 0.0, 
>>> neither works
>>>
>>> Method #2 would be cleaner, if I could do what I wanted to do in 
>>> terms of transparencies, but if not, I'll take method #1.
>>>
>>> Does anyone know if it is possible to set the image background 
>>> transparent for encapsulated postscript output?
>>>
>>> Thanks,
>>>
>>> Mike 
>>>
>>
>> Mike: Postscript doesn't support alpha transparency. It might work 
>> with PDF though.
>>
>> -Jeff
>>
>> -- 
>> Jeffrey S. Whitaker Phone : (303)497-6313
>> Meteorologist FAX : (303)497-6449
>> NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 
>> <mailto:Jef...@no...>
>> 325 Broadway Office : Skaggs Research Cntr 1D-124
>> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
>
>
>
>
> ------------------------------------------------------
> Michael Hearne
> mh...@us... <mailto:mh...@us...>
> (303) 273-8620
> USGS National Earthquake Information Center
> 1711 Illinois St. Golden CO 80401
> Senior Software Engineer
> Synergetics, Inc.
> ------------------------------------------------------
>
>
-- 
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-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Jeff W. <js...@fa...> - 2007年12月14日 19:28:39
Michael Hearne wrote:
> I am using Basemap, and trying to create two maps:
>
> One large-scale map, and a small-scale inset map of the world centered 
> on the location of the large-scale map. My ultimate goal is to create 
> a figure where the inset map is inserted into a corner of the 
> large-scale map. I can see two ways of doing this:
>
> 1) Create both as encapsulated postscript images separately, and put 
> them together in a later "compositing" process. (I'm doing this already).
> 2) Create both as basemap instances, and then draw the smaller one on 
> top of the large-scale one. I have no idea how to do this.
>
> A problem I have encountered with the first method is that my image 
> background is set to white by default. I've tried to make it 
> transparent by doing the following:
>
> fig = figure(figsize=(5,5),frameon=False) #turn the frame off completely
> fig.figurePatch.set_alpha(0.0) #tried setting this to 1.0 and 0.0, 
> neither works
>
> Method #2 would be cleaner, if I could do what I wanted to do in terms 
> of transparencies, but if not, I'll take method #1.
>
> Does anyone know if it is possible to set the image background 
> transparent for encapsulated postscript output?
>
> Thanks,
>
> Mike 
>
>
Mike: Postscript doesn't support alpha transparency. It might work 
with PDF though.
-Jeff
-- 
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-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Michael H. <mh...@us...> - 2007年12月14日 19:26:12
I am using Basemap, and trying to create two maps:
One large-scale map, and a small-scale inset map of the world 
centered on the location of the large-scale map. My ultimate goal is 
to create a figure where the inset map is inserted into a corner of 
the large-scale map. I can see two ways of doing this:
1) Create both as encapsulated postscript images separately, and put 
them together in a later "compositing" process. (I'm doing this 
already).
2) Create both as basemap instances, and then draw the smaller one on 
top of the large-scale one. I have no idea how to do this.
A problem I have encountered with the first method is that my image 
background is set to white by default. I've tried to make it 
transparent by doing the following:
fig = figure(figsize=(5,5),frameon=False) #turn the frame off completely
fig.figurePatch.set_alpha(0.0) #tried setting this to 1.0 and 0.0, 
neither works
Method #2 would be cleaner, if I could do what I wanted to do in 
terms of transparencies, but if not, I'll take method #1.
Does anyone know if it is possible to set the image background 
transparent for encapsulated postscript output?
Thanks,
Mike
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
On Dec 13, 2007 4:01 PM, Orest Kozyar <ore...@gm...> wrote:
> I've been trying to set the font properties of the plots that I've
> been making with matplotlib; however, there appears to be a problem
> with font rendering. For example, when I check the properties of text
> on the axes, etc, the font class is set to serif; however, the font in
> the plot does not appear to be serif. I ran several of the font demos
> in the matplotlib examples directory, and the fonts all looked the
> same (except for size). Attached is the PNG of the fonts_demo.py
> output.
>
> The only way I was able to get serif fonts was if I call:
>
> rc('text', usetex=True), and even then this only changes the fonts on
> the axis tick labels. xlabel, ylabel still remain sans-serif.
>
> I'm sure I am missing something obvious, but have read through all the
> documentation available on the matplotlib website regarding fonts, and
> they don't seem to indicate that I need to install anything else.
>
> This is Python 2.5 on Windows XP.
>
> Thanks,
> Orest
>
Not sure if this is your issue but I had problems with fonts until I
uncommented the RC file in the fonts section of it. Matplotlib ships with
the RC commented out. The file matplotlibrc is found in the
matplotlib\mpl-data folder. You can just edit it with Notepad and uncomment
the lines regarding fonts and try it again.
From: Michael D. <md...@st...> - 2007年12月14日 16:05:50
0.90 had a number of issues where it was way too strict in what it would 
consider a font match -- so it may be that it is rejecting Times New 
Roman because the numerical weight isn't an exact match, or something 
like that.
In any case, it should be able to match against the serif font included 
in matplotlib -- that's still a bit of a puzzle.
You can try removing your font cache file (which will force it to 
regenerate), which in Windows (I believe) is in c:\Documents and 
Settings\<user>\.matplotlib\ttffont.cache . If that doesn't work, can 
you send me that file (off-list) -- then I can see what fonts it thinks 
you have.
Cheers,
Mike
Orest Kozyar wrote:
> Hi Mike,
> 
> It's matplotlib 0.90.1.0003, and it does not seem to matter which
> backend I am using. All backends available on my machine give me a
> sans-serif font, with the exception of WX, which gives me a serif
> font. I've attached the debug output to this email. It looks like
> findfont is failing to find the requested serif fonts so it is
> returning the default font. I'm not sure why this would be the case
> as I know I have Times New Roman (times.ttf) in my c:\windows\fonts
> folder.
> 
> I looked through the matplotlib docs and it says that findfont should
> be able to find the fonts if they are in system default locations, so
> I'm a bit stumped as to what to do now.
> 
> Thanks!
> Orest
> 
> On Dec 14, 2007 8:16 AM, Michael Droettboom <md...@st...> wrote:
>> I'm not able to reproduce this bug here (on a Linux machine).
>>
>> Which backend are you using? What version of matplotlib? Can you set
>> the parameter "verbose.level" to "debug-annoying" and send the output to
>> this list?
>>
>> Cheers,
>> Mike
>>
>>
>> Orest Kozyar wrote:
>>> I've been trying to set the font properties of the plots that I've
>>> been making with matplotlib; however, there appears to be a problem
>>> with font rendering. For example, when I check the properties of text
>>> on the axes, etc, the font class is set to serif; however, the font in
>>> the plot does not appear to be serif. I ran several of the font demos
>>> in the matplotlib examples directory, and the fonts all looked the
>>> same (except for size). Attached is the PNG of the fonts_demo.py
>>> output.
>>>
>>> The only way I was able to get serif fonts was if I call:
>>>
>>> rc('text', usetex=True), and even then this only changes the fonts on
>>> the axis tick labels. xlabel, ylabel still remain sans-serif.
>>>
>>> I'm sure I am missing something obvious, but have read through all the
>>> documentation available on the matplotlib website regarding fonts, and
>>> they don't seem to indicate that I need to install anything else.
>>>
>>> This is Python 2.5 on Windows XP.
>>>
>>> Thanks,
>>> Orest
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> -------------------------------------------------------------------------
>>> SF.Net email is sponsored by:
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services
>>> for just about anything Open Source.
>>> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> --
>> Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Orest K. <ore...@gm...> - 2007年12月14日 15:15:17
Attachments: debug-annoying.txt
Hi Mike,
It's matplotlib 0.90.1.0003, and it does not seem to matter which
backend I am using. All backends available on my machine give me a
sans-serif font, with the exception of WX, which gives me a serif
font. I've attached the debug output to this email. It looks like
findfont is failing to find the requested serif fonts so it is
returning the default font. I'm not sure why this would be the case
as I know I have Times New Roman (times.ttf) in my c:\windows\fonts
folder.
I looked through the matplotlib docs and it says that findfont should
be able to find the fonts if they are in system default locations, so
I'm a bit stumped as to what to do now.
Thanks!
Orest
On Dec 14, 2007 8:16 AM, Michael Droettboom <md...@st...> wrote:
> I'm not able to reproduce this bug here (on a Linux machine).
>
> Which backend are you using? What version of matplotlib? Can you set
> the parameter "verbose.level" to "debug-annoying" and send the output to
> this list?
>
> Cheers,
> Mike
>
>
> Orest Kozyar wrote:
> > I've been trying to set the font properties of the plots that I've
> > been making with matplotlib; however, there appears to be a problem
> > with font rendering. For example, when I check the properties of text
> > on the axes, etc, the font class is set to serif; however, the font in
> > the plot does not appear to be serif. I ran several of the font demos
> > in the matplotlib examples directory, and the fonts all looked the
> > same (except for size). Attached is the PNG of the fonts_demo.py
> > output.
> >
> > The only way I was able to get serif fonts was if I call:
> >
> > rc('text', usetex=True), and even then this only changes the fonts on
> > the axis tick labels. xlabel, ylabel still remain sans-serif.
> >
> > I'm sure I am missing something obvious, but have read through all the
> > documentation available on the matplotlib website regarding fonts, and
> > they don't seem to indicate that I need to install anything else.
> >
> > This is Python 2.5 on Windows XP.
> >
> > Thanks,
> > Orest
> >
> >
> > ------------------------------------------------------------------------
> >
> >
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > SF.Net email is sponsored by:
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services
> > for just about anything Open Source.
> > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
From: Michael D. <md...@st...> - 2007年12月14日 13:40:53
Can you provide a standalone example that exhibits this problem? I'm 
not able to reproduce this with 0.90.1 and the imshow examples 
(image_demo.py, image_origin.py).
Which backend are you using?
My only wild guess is -- with the Agg backend (possibly others), the 
image is stored flipped from how Agg wants to render it. So, the image 
is flipped (not the data, just the stride), then it is drawn, then it is 
flipped back. If there were an exception in the middle there, the 
number of flips may not remain even. Are there any exceptions being 
output? (These exceptions, since they're inside a GUI callback wouldn't 
necessarily halt the application). Beyond that, you could trace calls 
to im.flipupd_out and make sure they are even in number.
Cheers,
Mike
John Pye wrote:
> Hi all
> 
> I have a problem with 'imshow' under matplotlib 0.90.1-2ubuntu1 on
> ubuntu 7.10. I have an 'incidence matrix' created using the 'imshow'
> command, and it works well except for the fact that sometimes when
> resizing my window, the incidence matrix flips upside-down.
> 
> Can I control this flipping of the incidence matrix? it seems to me to
> be something that has just happened in a recent release of matplotlib,
> as my application didn't used to show this problem.
> 
> FYI The code that I'm using to drive mpl is here:
> http://ascendcode.cheme.cmu.edu/viewvc.cgi/code/branches/extfn/pygtk/incidencematrix.py?view=markup
> 
> Cheers
> JP
> 
> 
> 
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2007年12月14日 13:27:06
I don't think it's currently possible in any sort of "automatic" way. 
There have been thoughts of adding support for multiple y labels in the 
past, but that's a medium-sized chunk of work.
However, as a roundabout approach, you could add figure text:
t = gcf().text(0.5, 0.05, "Margin $",
 horizontalalignment='center', color=marginColor)
The location of the text is specified relative to the whole figure (in 
the range 0-1). It may take some tweaking to get the positioning right.
BTW -- I don't know if you're using 0.90 or 0.91. In 0.91, since the 
string "Sales $\nMargin $" has two dollar-signs, the section between 
them will be treated as math notation. To avoid that, you can escape 
the dollar signs, i.e. "Sales \\$\nMargin \\$".
Cheers,
Mike
John Harrison wrote:
> Is there a way to have two colors of text on an axis label? I am 
> trying to plot sales dollars and margin dollars on the same graph in 
> different colors. That works well enough but I'm having a hard time 
> labeling the yaxis
> 
> plot_date(dates,units,visible = False)
> bar(dates,sales,width=5.0,color = salesColor)
> bar(dates,margin,width=5.0,color = marginColor)
> ylabel("Sales $\nMargin $",color=salesColor)
> 
> gets me "Sales $" in the proper color but I can't figure out if it is 
> possible to have "Margin $" in its color as well.
> 
> Thanks!
> John
> 
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2007年12月14日 13:16:51
I'm not able to reproduce this bug here (on a Linux machine).
Which backend are you using? What version of matplotlib? Can you set 
the parameter "verbose.level" to "debug-annoying" and send the output to 
this list?
Cheers,
Mike
Orest Kozyar wrote:
> I've been trying to set the font properties of the plots that I've
> been making with matplotlib; however, there appears to be a problem
> with font rendering. For example, when I check the properties of text
> on the axes, etc, the font class is set to serif; however, the font in
> the plot does not appear to be serif. I ran several of the font demos
> in the matplotlib examples directory, and the fonts all looked the
> same (except for size). Attached is the PNG of the fonts_demo.py
> output.
> 
> The only way I was able to get serif fonts was if I call:
> 
> rc('text', usetex=True), and even then this only changes the fonts on
> the axis tick labels. xlabel, ylabel still remain sans-serif.
> 
> I'm sure I am missing something obvious, but have read through all the
> documentation available on the matplotlib website regarding fonts, and
> they don't seem to indicate that I need to install anything else.
> 
> This is Python 2.5 on Windows XP.
> 
> Thanks,
> Orest
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: John P. <jo...@cu...> - 2007年12月14日 06:50:17
Hi all
I have a problem with 'imshow' under matplotlib 0.90.1-2ubuntu1 on
ubuntu 7.10. I have an 'incidence matrix' created using the 'imshow'
command, and it works well except for the fact that sometimes when
resizing my window, the incidence matrix flips upside-down.
Can I control this flipping of the incidence matrix? it seems to me to
be something that has just happened in a recent release of matplotlib,
as my application didn't used to show this problem.
FYI The code that I'm using to drive mpl is here:
http://ascendcode.cheme.cmu.edu/viewvc.cgi/code/branches/extfn/pygtk/incidencematrix.py?view=markup
Cheers
JP

Showing 17 results of 17

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