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






Showing results of 428

<< < 1 .. 9 10 11 12 13 .. 18 > >> (Page 11 of 18)
From: Carl K. <ca...@pe...> - 2010年10月13日 15:46:12
On Wed, Oct 13, 2010 at 10:43 AM, Carl Karsten <ca...@pe...> wrote:
> On Wed, Oct 13, 2010 at 10:25 AM, John Hunter <jd...@gm...> wrote:
>> sudo apt-get build_dep numpy scipy matplotlib
>
> E: Unable to find a source package for numpy
>
> I am guessing it should be:
>
> sudo apt-get build-dep python-numpy python-scipy python-matplotlib
>
"Need to get 535MB of archives."
I am on a pretty slow shared connection, so need to wait a week to get
back home before I do this.
-- 
Carl K
From: Carl K. <ca...@pe...> - 2010年10月13日 15:43:10
On Wed, Oct 13, 2010 at 10:25 AM, John Hunter <jd...@gm...> wrote:
> sudo apt-get build_dep numpy scipy matplotlib
E: Unable to find a source package for numpy
I am guessing it should be:
 sudo apt-get build-dep python-numpy python-scipy python-matplotlib
-- 
Carl K
From: John H. <jd...@gm...> - 2010年10月13日 15:26:20
On Wed, Oct 13, 2010 at 10:19 AM, Carl Karsten <ca...@pe...> wrote:
> On Wed, Oct 13, 2010 at 8:33 AM, Michael Droettboom <md...@st...> wrote:
>> On 10/12/2010 07:16 PM, Fernando Perez wrote:
>>> On Tue, Oct 12, 2010 at 3:03 PM, Carl Karsten<ca...@pe...> wrote:
>>>
>>>> Run the code, you get a window that has a 'save' button, the dialog
>>>> has a 'type svg' option
>>>> the svg renders with the blue/green dots everywhere (rendering using
>>>> both rsvg-view and inkscape, which use different rendering engines.)
>>>> save as png, display png, dots only inside circle.
>>>>
>>>>
>>> Yup, clipping is completely broken in SVG, reported here:
>>>
>>> http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTik-Ty-V-QFEmkjhJH%2B-%3DtEZTTXyJLXxW%2B34E_hh%40mail.gmail.com&forum_name=matplotlib-devel
>>>
>> Yes, but this is fixed in SVN 1.0 branch and trunk -- at least for me.
>> Not for you?
>>
>
> carl@dc10:~/Videos/veyepar/test_client/test_show/flv$ apt-cache policy
> python-matplotlib
> python-matplotlib:
> Installed: 0.99.3-1ubuntu1
> Candidate: 0.99.3-1ubuntu1
> Version table:
> *** 0.99.3-1ubuntu1 0
>    500 http://us.archive.ubuntu.com/ubuntu/ maverick/universe
> amd64 Packages
>    100 /var/lib/dpkg/status
>
> Is there a PPA that tracks trunk?
I suggest
> sudo apt-get build_dep numpy scipy matplotlib
> svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib
> cd matplotlib
> python setup.py install --prefix=~/something
and then set your PYTHONPATH accordingly.
See also http://matplotlib.sourceforge.net/faq/installing_faq.html#install-svn
From: Carl K. <ca...@pe...> - 2010年10月13日 15:19:38
On Wed, Oct 13, 2010 at 8:33 AM, Michael Droettboom <md...@st...> wrote:
> On 10/12/2010 07:16 PM, Fernando Perez wrote:
>> On Tue, Oct 12, 2010 at 3:03 PM, Carl Karsten<ca...@pe...> wrote:
>>
>>> Run the code, you get a window that has a 'save' button, the dialog
>>> has a 'type svg' option
>>> the svg renders with the blue/green dots everywhere (rendering using
>>> both rsvg-view and inkscape, which use different rendering engines.)
>>> save as png, display png, dots only inside circle.
>>>
>>>
>> Yup, clipping is completely broken in SVG, reported here:
>>
>> http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTik-Ty-V-QFEmkjhJH%2B-%3DtEZTTXyJLXxW%2B34E_hh%40mail.gmail.com&forum_name=matplotlib-devel
>>
> Yes, but this is fixed in SVN 1.0 branch and trunk -- at least for me.
> Not for you?
>
carl@dc10:~/Videos/veyepar/test_client/test_show/flv$ apt-cache policy
python-matplotlib
python-matplotlib:
 Installed: 0.99.3-1ubuntu1
 Candidate: 0.99.3-1ubuntu1
 Version table:
 *** 0.99.3-1ubuntu1 0
 500 http://us.archive.ubuntu.com/ubuntu/ maverick/universe
amd64 Packages
 100 /var/lib/dpkg/status
Is there a PPA that tracks trunk?
-- 
Carl K
From: John H. <jd...@gm...> - 2010年10月13日 14:43:34
On Wed, Oct 13, 2010 at 9:28 AM, Waléria Antunes David
<wal...@gm...> wrote:
> Hi all,
>
> I know here is a group for matplotlib, but can anyone help me? I need to
> pass this integral equation for for scipy.integrate pack for python.
>
> My integral equation is attached.
>
> Can anyone help me?
1. Subscribe to scipy-users:
http://projects.scipy.org/mailman/listinfo/scipy-user
2. Describe your problem in more detail on scipy-users.
3. Most importantly, show what work you have already done, where you
are stuck and why. Post code. Noone wants to do your homework --
people are willing to help those who are working hard on a problem.
JDH
From: Michael D. <md...@st...> - 2010年10月13日 13:33:16
On 10/12/2010 07:16 PM, Fernando Perez wrote:
> On Tue, Oct 12, 2010 at 3:03 PM, Carl Karsten<ca...@pe...> wrote:
> 
>> Run the code, you get a window that has a 'save' button, the dialog
>> has a 'type svg' option
>> the svg renders with the blue/green dots everywhere (rendering using
>> both rsvg-view and inkscape, which use different rendering engines.)
>> save as png, display png, dots only inside circle.
>>
>> 
> Yup, clipping is completely broken in SVG, reported here:
>
> http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTik-Ty-V-QFEmkjhJH%2B-%3DtEZTTXyJLXxW%2B34E_hh%40mail.gmail.com&forum_name=matplotlib-devel
> 
Yes, but this is fixed in SVN 1.0 branch and trunk -- at least for me. 
Not for you?
Mike
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Benoit G. <ben...@un...> - 2010年10月13日 09:30:18
Actually, i must apologize
By calling fonts by their real name eg: "WenQuanYi Zen Hei" (instead 
of wqy-microhei, their file name), i can display them. So no worries 
for issue 2. However, I do not manage to export the png to pdf or eps 
due to the following error:
"TrueType font is missing table"
Is that due to my changing the font name from *.ttc to *.ttf?
regards,
benoit
Quoting Benoit Gaillard <ben...@un...>:
> Hi,
>
> When looking in my fontFile.cache, i did not find any of
> '/usr/share/fonts/truetype/wqy/wqy-zenhei.ttf',
> '/usr/share/fonts/truetype/wqy/wqy-microhei.ttf' or simhei. this is why
> i could not display the characters.
>
> I deleted the cache and re-lounched my script, so that mpl had to look
> for the fonts and update the cache. It added the simhei fonts to the
> list. I can now display chinese characters with the simhei font.
>
> I ran into 2 more issues:
> - Simhei "has no glyph names", which prevents me from exporting into pdf
> - I do not manage to make mpl take into account microhei and zenhei,
> whereas i have them in
> '/usr/share/fonts/truetype/wqy/wqy-microhei.ttc'. I changed their name
> to '/usr/share/fonts/truetype/wqy/wqy-microhei.ttf', and now mpl finds
> them. However they fail to display chinese characters
>
> So, thank you for your help, i managed to display chinese characters
> but there are still some issues. Do you have any idea?
>
> Benoit
>
>
> Quoting sunqiang <sun...@gm...>:
>
>> oh, only test it on Windows yet. both "sim hei"and "microsoft yahei"
>> are fontname on Windows Platform.
>> maybe just copy "Sim Hei" to font directory is not enough? no clue here.
>>
>> I just test the script on Linux (Ubuntu 8.04, Python 2.5, matplotlib
>> 0.98.4) with the follow steps:
>> 1, find the configure directory of matplotlib
>> import matplotlib as mpl
>> mpl.get_configdir()
>>
>> return "~/.matplotlib"
>> 2, in the configure directory, there is a file "fontList.cache"
>> I find this
>> (dp294
>> ...
>> S'WenQuanYi Zen Hei'
>> ...
>> S'/usr/share/fonts/truetype/wqy/wqy-zenhei.ttf'
>> ...
>>
>> I just know WenQuanYi is a "Chinese font"
>> http://packages.ubuntu.com/hardy/ttf-wqy-zenhei
>> 3, replace "Sim Hei" in your original script with "WenQuanYi Zen Hei",
>> now it can display Chinese.
>> both methods still work(embed fontname argument, or set
>> mpl.rcParams['font.sans-serif'])
>>
>> maybe you can find a font that support Chinese character on your
>> platform with these steps and try again?
>>
>> On Tue, Oct 12, 2010 at 10:41 PM, Benoit Gaillard
>> <ben...@un...> wrote:
>>> Thank you for your help,
>>>
>>> but it does not seem to work.
>>>
>>> I have downloaded simhei fonts and added it in my directory
>>> /usr/shared/fonts/truetype but even by using
>>> """fontname="simhei" """,
>>> or:
>>> """mpl.rcParams['font.sans-serif'] = ['SimHei']
>>> mpl.rcParams['axes.unicode_minus'] = False """
>>>
>>> i still display empty boxes instead of chinese characters.
>>>
>>> It is worth noting that these chinese characters print well on the console
>>> if i add the line:
>>> """for ytic in ytics:
>>>  print ytic"""
>>>
>>> Unfortunately, apart from copying lines of code, i cannot do much with the
>>> blog you mention, as i don't understand what is written in it.
>>>
>>> @Mike: "monospace" family is one that enables me to display accents of
>>> french words, for the xticks. "fantasy" family was the last family i tried
>>> for the chinese labels, but to no success.
>>>
>>> So, has anyone managed to do it? Is there something i am missing?,
>>>
>>> regards,
>>>
>>> Benoit.
>>>
>>> Quoting sunqiang <sun...@gm...>:
>>>
>>>> maybe change the line
>>>> """axim.set_yticklabels(ytics,fontsize=15,family='fantasy')""" to
>>>> """axim.set_yticklabels(ytics,fontsize=15, fontname= "simsun (founder
>>>> extended)")"""
>>>> (or replace fontname with "simhei" or "microsoft yahei") is enough.
>>>>
>>>>
>>>> or, put these two lines:
>>>> mpl.rcParams['font.sans-serif'] = ['SimHei']
>>>> mpl.rcParams['axes.unicode_minus'] = False
>>>>
>>>> there is a Chinese blog (not mine) maybe worth reading:
>>>> http://hi.baidu.com/lijiangshui/blog/item/a0aad703cd65ee7e3812bb49.html
>>>>
>>>> hope this help
>>>>
>>>> On Mon, Oct 11, 2010 at 3:13 AM, Benoit Gaillard
>>>> <ben...@un...> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> How can one display Mandarin labels in a plot, as yticks_labels for
>>>>> example?
>>>>> It looks to me that there is no font in matplotlib that can display
>>>>> Chinese
>>>>> characters? I can display accentuation from 'utf8' but i could not find a
>>>>> font family that would display Chinese characters.
>>>>>
>>>>> Here is an example of plot that displays empty boxes instead of Chinese
>>>>> characters. In comments you can see various failed attempts:
>>>>>
>>>>> import matplotlib as mpl
>>>>> from matplotlib import cm
>>>>> from matplotlib import rc
>>>>> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
>>>>> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
>>>>> import matplotlib.pyplot as plt
>>>>>
>>>>> matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
>>>>> fig = plt.figure()
>>>>> axim = fig.add_subplot(111)
>>>>> #ytics: caractères chinois en utf8
>>>>> ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
>>>>> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
>>>>> axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',origin='lower')
>>>>> axim.set_xticks(range(2))
>>>>>
>>>>> axim.set_xticklabels(xtics,fontsize=15,rotation=25,ha='right',family='monospace')
>>>>> axim.set_yticks(range(2))
>>>>> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR PL
>>>>> ungtiL GB')
>>>>> plt.show()
>>>>>
>>>>> Thank you for your help,
>>>>>
>>>>> Benoit
>>>>>
>>>>>
>>>>>
>>>>> ----------------------------------------------------------------
>>>>> This message was sent using IMP, the Internet Messaging Program.
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> How can one display mandarin labels in a plot, as yticks_labels for
>>>>> example?
>>>>> It looks to me that there is no font in matplotlib that can display
>>>>> chinese
>>>>> characters? I can display accentuation from 'utf8' but i could not find a
>>>>> font family that would display chinese characters.
>>>>>
>>>>> Here is an example of plot that displays empty boxes instead of chinese
>>>>> characters. In comment you can see various failed attempts:
>>>>>
>>>>> import matplotlib as mpl
>>>>> from matplotlib import cm
>>>>> from matplotlib import rc
>>>>> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
>>>>> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
>>>>> import matplotlib.pyplot as plt
>>>>>
>>>>>   matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
>>>>>   fig = plt.figure()
>>>>>   axim = fig.add_subplot(111)
>>>>>   #ytics: caractères chinois en utf8
>>>>>   ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
>>>>>
>>>>> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
>>>>>   axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',
>>>>> origin='lower')
>>>>>   axim.set_xticks(range(2))
>>>>>   axim.set_xticklabels(xtics,
>>>>> fontsize=15,rotation=25,ha='right',family='monospace')
>>>>>   axim.set_yticks(range(2))
>>>>>
>>>>> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR
>>>>> PL SungtiL GB')
>>>>>   plt.show()
>>>>>
>>>>> Thank you for your help,
>>>>>
>>>>> Benoit
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Beautiful is writing same markup. Internet Explorer 9 supports
>>>>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>>>>> Spend less time writing and rewriting code and more time creating great
>>>>> experiences on the web. Be a part of the beta today.
>>>>> http://p.sf.net/sfu/beautyoftheweb
>>>>> _______________________________________________
>>>>> Matplotlib-users mailing list
>>>>> Mat...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>> ----------------------------------------------------------------
>>> This message was sent using IMP, the Internet Messaging Program.
>>>
>>>
>>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
From: Benoit G. <ben...@un...> - 2010年10月13日 09:10:07
Hi,
When looking in my fontFile.cache, i did not find any of 
'/usr/share/fonts/truetype/wqy/wqy-zenhei.ttf', 
'/usr/share/fonts/truetype/wqy/wqy-microhei.ttf' or simhei. this is 
why i could not display the characters.
I deleted the cache and re-lounched my script, so that mpl had to look 
for the fonts and update the cache. It added the simhei fonts to the 
list. I can now display chinese characters with the simhei font.
I ran into 2 more issues:
- Simhei "has no glyph names", which prevents me from exporting into pdf
- I do not manage to make mpl take into account microhei and zenhei, 
whereas i have them in 
'/usr/share/fonts/truetype/wqy/wqy-microhei.ttc'. I changed their name 
to '/usr/share/fonts/truetype/wqy/wqy-microhei.ttf', and now mpl finds 
them. However they fail to display chinese characters
So, thank you for your help, i managed to display chinese characters 
but there are still some issues. Do you have any idea?
Benoit
Quoting sunqiang <sun...@gm...>:
> oh, only test it on Windows yet. both "sim hei"and "microsoft yahei"
> are fontname on Windows Platform.
> maybe just copy "Sim Hei" to font directory is not enough? no clue here.
>
> I just test the script on Linux (Ubuntu 8.04, Python 2.5, matplotlib
> 0.98.4) with the follow steps:
> 1, find the configure directory of matplotlib
> import matplotlib as mpl
> mpl.get_configdir()
>
> return "~/.matplotlib"
> 2, in the configure directory, there is a file "fontList.cache"
> I find this
> (dp294
> ...
> S'WenQuanYi Zen Hei'
> ...
> S'/usr/share/fonts/truetype/wqy/wqy-zenhei.ttf'
> ...
>
> I just know WenQuanYi is a "Chinese font"
> http://packages.ubuntu.com/hardy/ttf-wqy-zenhei
> 3, replace "Sim Hei" in your original script with "WenQuanYi Zen Hei",
> now it can display Chinese.
> both methods still work(embed fontname argument, or set
> mpl.rcParams['font.sans-serif'])
>
> maybe you can find a font that support Chinese character on your
> platform with these steps and try again?
>
> On Tue, Oct 12, 2010 at 10:41 PM, Benoit Gaillard
> <ben...@un...> wrote:
>> Thank you for your help,
>>
>> but it does not seem to work.
>>
>> I have downloaded simhei fonts and added it in my directory
>> /usr/shared/fonts/truetype but even by using
>> """fontname="simhei" """,
>> or:
>> """mpl.rcParams['font.sans-serif'] = ['SimHei']
>> mpl.rcParams['axes.unicode_minus'] = False """
>>
>> i still display empty boxes instead of chinese characters.
>>
>> It is worth noting that these chinese characters print well on the console
>> if i add the line:
>> """for ytic in ytics:
>>  print ytic"""
>>
>> Unfortunately, apart from copying lines of code, i cannot do much with the
>> blog you mention, as i don't understand what is written in it.
>>
>> @Mike: "monospace" family is one that enables me to display accents of
>> french words, for the xticks. "fantasy" family was the last family i tried
>> for the chinese labels, but to no success.
>>
>> So, has anyone managed to do it? Is there something i am missing?,
>>
>> regards,
>>
>> Benoit.
>>
>> Quoting sunqiang <sun...@gm...>:
>>
>>> maybe change the line
>>> """axim.set_yticklabels(ytics,fontsize=15,family='fantasy')""" to
>>> """axim.set_yticklabels(ytics,fontsize=15, fontname= "simsun (founder
>>> extended)")"""
>>> (or replace fontname with "simhei" or "microsoft yahei") is enough.
>>>
>>>
>>> or, put these two lines:
>>> mpl.rcParams['font.sans-serif'] = ['SimHei']
>>> mpl.rcParams['axes.unicode_minus'] = False
>>>
>>> there is a Chinese blog (not mine) maybe worth reading:
>>> http://hi.baidu.com/lijiangshui/blog/item/a0aad703cd65ee7e3812bb49.html
>>>
>>> hope this help
>>>
>>> On Mon, Oct 11, 2010 at 3:13 AM, Benoit Gaillard
>>> <ben...@un...> wrote:
>>>>
>>>> Hi,
>>>>
>>>> How can one display Mandarin labels in a plot, as yticks_labels for
>>>> example?
>>>> It looks to me that there is no font in matplotlib that can display
>>>> Chinese
>>>> characters? I can display accentuation from 'utf8' but i could not find a
>>>> font family that would display Chinese characters.
>>>>
>>>> Here is an example of plot that displays empty boxes instead of Chinese
>>>> characters. In comments you can see various failed attempts:
>>>>
>>>> import matplotlib as mpl
>>>> from matplotlib import cm
>>>> from matplotlib import rc
>>>> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
>>>> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
>>>> import matplotlib.pyplot as plt
>>>>
>>>> matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
>>>> fig = plt.figure()
>>>> axim = fig.add_subplot(111)
>>>> #ytics: caractères chinois en utf8
>>>> ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
>>>> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
>>>> axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',origin='lower')
>>>> axim.set_xticks(range(2))
>>>>
>>>> axim.set_xticklabels(xtics,fontsize=15,rotation=25,ha='right',family='monospace')
>>>> axim.set_yticks(range(2))
>>>> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR PL
>>>> ungtiL GB')
>>>> plt.show()
>>>>
>>>> Thank you for your help,
>>>>
>>>> Benoit
>>>>
>>>>
>>>>
>>>> ----------------------------------------------------------------
>>>> This message was sent using IMP, the Internet Messaging Program.
>>>>
>>>>
>>>> Hi,
>>>>
>>>> How can one display mandarin labels in a plot, as yticks_labels for
>>>> example?
>>>> It looks to me that there is no font in matplotlib that can display
>>>> chinese
>>>> characters? I can display accentuation from 'utf8' but i could not find a
>>>> font family that would display chinese characters.
>>>>
>>>> Here is an example of plot that displays empty boxes instead of chinese
>>>> characters. In comment you can see various failed attempts:
>>>>
>>>> import matplotlib as mpl
>>>> from matplotlib import cm
>>>> from matplotlib import rc
>>>> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
>>>> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
>>>> import matplotlib.pyplot as plt
>>>>
>>>>   matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
>>>>   fig = plt.figure()
>>>>   axim = fig.add_subplot(111)
>>>>   #ytics: caractères chinois en utf8
>>>>   ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
>>>>
>>>> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
>>>>   axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',
>>>> origin='lower')
>>>>   axim.set_xticks(range(2))
>>>>   axim.set_xticklabels(xtics,
>>>> fontsize=15,rotation=25,ha='right',family='monospace')
>>>>   axim.set_yticks(range(2))
>>>>
>>>> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR
>>>> PL SungtiL GB')
>>>>   plt.show()
>>>>
>>>> Thank you for your help,
>>>>
>>>> Benoit
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Beautiful is writing same markup. Internet Explorer 9 supports
>>>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>>>> Spend less time writing and rewriting code and more time creating great
>>>> experiences on the web. Be a part of the beta today.
>>>> http://p.sf.net/sfu/beautyoftheweb
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>>>
>>>
>>
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
From: sunqiang <sun...@gm...> - 2010年10月13日 02:29:57
oh, only test it on Windows yet. both "sim hei"and "microsoft yahei"
are fontname on Windows Platform.
maybe just copy "Sim Hei" to font directory is not enough? no clue here.
I just test the script on Linux (Ubuntu 8.04, Python 2.5, matplotlib
0.98.4) with the follow steps:
1, find the configure directory of matplotlib
import matplotlib as mpl
mpl.get_configdir()
return "~/.matplotlib"
2, in the configure directory, there is a file "fontList.cache"
I find this
(dp294
...
S'WenQuanYi Zen Hei'
...
S'/usr/share/fonts/truetype/wqy/wqy-zenhei.ttf'
...
I just know WenQuanYi is a "Chinese font"
http://packages.ubuntu.com/hardy/ttf-wqy-zenhei
3, replace "Sim Hei" in your original script with "WenQuanYi Zen Hei",
now it can display Chinese.
both methods still work(embed fontname argument, or set
mpl.rcParams['font.sans-serif'])
maybe you can find a font that support Chinese character on your
platform with these steps and try again?
On Tue, Oct 12, 2010 at 10:41 PM, Benoit Gaillard
<ben...@un...> wrote:
> Thank you for your help,
>
> but it does not seem to work.
>
> I have downloaded simhei fonts and added it in my directory
> /usr/shared/fonts/truetype but even by using
> """fontname="simhei" """,
> or:
> """mpl.rcParams['font.sans-serif'] = ['SimHei']
> mpl.rcParams['axes.unicode_minus'] = False """
>
> i still display empty boxes instead of chinese characters.
>
> It is worth noting that these chinese characters print well on the console
> if i add the line:
> """for ytic in ytics:
>  print ytic"""
>
> Unfortunately, apart from copying lines of code, i cannot do much with the
> blog you mention, as i don't understand what is written in it.
>
> @Mike: "monospace" family is one that enables me to display accents of
> french words, for the xticks. "fantasy" family was the last family i tried
> for the chinese labels, but to no success.
>
> So, has anyone managed to do it? Is there something i am missing?,
>
> regards,
>
> Benoit.
>
> Quoting sunqiang <sun...@gm...>:
>
>> maybe change the line
>> """axim.set_yticklabels(ytics,fontsize=15,family='fantasy')""" to
>> """axim.set_yticklabels(ytics,fontsize=15, fontname= "simsun (founder
>> extended)")"""
>> (or replace fontname with "simhei" or "microsoft yahei") is enough.
>>
>>
>> or, put these two lines:
>> mpl.rcParams['font.sans-serif'] = ['SimHei']
>> mpl.rcParams['axes.unicode_minus'] = False
>>
>> there is a Chinese blog (not mine) maybe worth reading:
>> http://hi.baidu.com/lijiangshui/blog/item/a0aad703cd65ee7e3812bb49.html
>>
>> hope this help
>>
>> On Mon, Oct 11, 2010 at 3:13 AM, Benoit Gaillard
>> <ben...@un...> wrote:
>>>
>>> Hi,
>>>
>>> How can one display Mandarin labels in a plot, as yticks_labels for
>>> example?
>>> It looks to me that there is no font in matplotlib that can display
>>> Chinese
>>> characters? I can display accentuation from 'utf8' but i could not find a
>>> font family that would display Chinese characters.
>>>
>>> Here is an example of plot that displays empty boxes instead of Chinese
>>> characters. In comments you can see various failed attempts:
>>>
>>> import matplotlib as mpl
>>> from matplotlib import cm
>>> from matplotlib import rc
>>> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
>>> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
>>> import matplotlib.pyplot as plt
>>>
>>> matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
>>> fig = plt.figure()
>>> axim = fig.add_subplot(111)
>>> #ytics: caractères chinois en utf8
>>> ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
>>> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
>>> axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',origin='lower')
>>> axim.set_xticks(range(2))
>>>
>>> axim.set_xticklabels(xtics,fontsize=15,rotation=25,ha='right',family='monospace')
>>> axim.set_yticks(range(2))
>>> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR PL
>>> ungtiL GB')
>>> plt.show()
>>>
>>> Thank you for your help,
>>>
>>> Benoit
>>>
>>>
>>>
>>> ----------------------------------------------------------------
>>> This message was sent using IMP, the Internet Messaging Program.
>>>
>>>
>>> Hi,
>>>
>>> How can one display mandarin labels in a plot, as yticks_labels for
>>> example?
>>> It looks to me that there is no font in matplotlib that can display
>>> chinese
>>> characters? I can display accentuation from 'utf8' but i could not find a
>>> font family that would display chinese characters.
>>>
>>> Here is an example of plot that displays empty boxes instead of chinese
>>> characters. In comment you can see various failed attempts:
>>>
>>> import matplotlib as mpl
>>> from matplotlib import cm
>>> from matplotlib import rc
>>> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
>>> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
>>> import matplotlib.pyplot as plt
>>>
>>>   matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
>>>   fig = plt.figure()
>>>   axim = fig.add_subplot(111)
>>>   #ytics: caractères chinois en utf8
>>>   ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
>>>
>>> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
>>>   axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',
>>> origin='lower')
>>>   axim.set_xticks(range(2))
>>>   axim.set_xticklabels(xtics,
>>> fontsize=15,rotation=25,ha='right',family='monospace')
>>>   axim.set_yticks(range(2))
>>>
>>> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR
>>> PL SungtiL GB')
>>>   plt.show()
>>>
>>> Thank you for your help,
>>>
>>> Benoit
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Beautiful is writing same markup. Internet Explorer 9 supports
>>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>>> Spend less time writing and rewriting code and more time creating great
>>> experiences on the web. Be a part of the beta today.
>>> http://p.sf.net/sfu/beautyoftheweb
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
From: Fernando P. <fpe...@gm...> - 2010年10月12日 23:17:23
On Tue, Oct 12, 2010 at 3:03 PM, Carl Karsten <ca...@pe...> wrote:
>
> Run the code, you get a window that has a 'save' button, the dialog
> has a 'type svg' option
> the svg renders with the blue/green dots everywhere (rendering using
> both rsvg-view and inkscape, which use different rendering engines.)
> save as png, display png, dots only inside circle.
>
Yup, clipping is completely broken in SVG, reported here:
http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTik-Ty-V-QFEmkjhJH%2B-%3DtEZTTXyJLXxW%2B34E_hh%40mail.gmail.com&forum_name=matplotlib-devel
Cheers,
f
From: Carl K. <ca...@pe...> - 2010年10月12日 22:03:34
I am sure this is not a matplotlib problem, but I am not sure whos it
is, so I'll start here:
http://matplotlib.sourceforge.net/examples/pylab_examples/dolphin.html
the blue and green dots should only be inside the circle.
Run the code, you get a window that has a 'save' button, the dialog
has a 'type svg' option
the svg renders with the blue/green dots everywhere (rendering using
both rsvg-view and inkscape, which use different rendering engines.)
save as png, display png, dots only inside circle.
-- 
Carl K
From: Carl K. <ca...@pe...> - 2010年10月12日 21:58:28
I just noticed the "videos" section of http://matplotlib.sourceforge.net
Here is one that I made at ChiPy (Chicago Python user group)
http://carlfk.blip.tv/file/2557425
Anyone know if this message is archived somewhere:
"Jeez, you guys have some crazy examples. I am surprised there isn't
dolphins swimming around inside a sphere."
I would like to add it to the description.
-- 
Carl K
From: Fernando P. <fpe...@gm...> - 2010年10月12日 18:58:54
Hi all,
Illustrating the need to *always* remember we credit in the commit
message the name of the person who made a contribution originally...
2010年10月12日 Fernando Perez <fpe...@gm...>:
> Hi all,
> - New IPython Sphinx directive. You can use this directive to mark blocks in
> reSructuredText documents as containig IPython syntax (including figures) and
> the will be executed during the build::
[...]
> The following people contributed to this release (please let us know if we
> omitted your name and we'll gladly fix this in the notes for the future):
...
I completely failed to note that this feature (one out of the only two
new features in 0.10.2!) was contributed by John Hunter.
John shall be generously compensated for this offense with fresh
coffee and tropical fruit candy from Colombia, so there's nothing to
worry :)
But this is a good lesson for the committers. I wrote the release
notes last night by scanning the full changelog and running this
function:
function gauthor() {
 git log "$@" | grep '^Author' | cut -d' ' -f 2- | sort | uniq
}
Since when John sent this, I failed to record his name in the
changelog, last night I simply forgot. It's very, very hard to
remember months after the fact where any one piece of code came from,
so let's try to be disciplined about *always*:
- if the contribution is more or less ready-to-commit as sent, and the
committer only does absolutely minimal work, use
git commit --author="Original Author <ori...@au...>"
- If the committer does significant amounts of rework, note the
original author in the long part of the commit message (after the
first summary line). This will make it possible to find that
information later when writing the release notes.
Here are some examples from our log where I didn't screw up:
- Using --author:
commit 8323fa343e74a01394e85f3874249b955131976a
Author: Sebastian Busch <>
Date: Sun Apr 25 10:57:39 2010 -0700
 Improvements to Vim support for visual mode.
 Patch by Sebastian Busch.
 Note: this patch was originally for the 0.10 series, I (fperez) minimally
 fixed it for 0.11 but it may still require some tweaking to work well with
 the refactored codebase.
 Closes https://bugs.launchpad.net/ipython/+bug/460359
-- Not using --author, but recording origin:
commit ffa96dbc431628218dec604d59bb80511af40751
Author: Fernando Perez <Fer...@be...>
Date: Sat Apr 24 20:35:08 2010 -0700
 Fix readline detection bug in OSX.
 Close https://bugs.launchpad.net/ipython/+bug/411599
 Thanks to a patch by Boyd Waters.
Ideally, when a significant new feature lands, we should immediately
summarize it in the whatsnew/ docs, but I know that is often hard to
do, as features continue to evolve or a while. All the more reason
why commit messages with sufficient, accurate information are so
important.
Cheers,
f
From: Benoit G. <ben...@un...> - 2010年10月12日 14:41:14
Thank you for your help,
but it does not seem to work.
I have downloaded simhei fonts and added it in my directory 
/usr/shared/fonts/truetype but even by using
"""fontname="simhei" """,
or:
"""mpl.rcParams['font.sans-serif'] = ['SimHei']
mpl.rcParams['axes.unicode_minus'] = False """
i still display empty boxes instead of chinese characters.
It is worth noting that these chinese characters print well on the 
console if i add the line:
"""for ytic in ytics:
 print ytic"""
Unfortunately, apart from copying lines of code, i cannot do much with 
the blog you mention, as i don't understand what is written in it.
@Mike: "monospace" family is one that enables me to display accents of 
french words, for the xticks. "fantasy" family was the last family i 
tried for the chinese labels, but to no success.
So, has anyone managed to do it? Is there something i am missing?,
regards,
Benoit.
Quoting sunqiang <sun...@gm...>:
> maybe change the line
> """axim.set_yticklabels(ytics,fontsize=15,family='fantasy')""" to
> """axim.set_yticklabels(ytics,fontsize=15, fontname= "simsun (founder
> extended)")"""
> (or replace fontname with "simhei" or "microsoft yahei") is enough.
>
>
> or, put these two lines:
> mpl.rcParams['font.sans-serif'] = ['SimHei']
> mpl.rcParams['axes.unicode_minus'] = False
>
> there is a Chinese blog (not mine) maybe worth reading:
> http://hi.baidu.com/lijiangshui/blog/item/a0aad703cd65ee7e3812bb49.html
>
> hope this help
>
> On Mon, Oct 11, 2010 at 3:13 AM, Benoit Gaillard
> <ben...@un...> wrote:
>> Hi,
>>
>> How can one display Mandarin labels in a plot, as yticks_labels for example?
>> It looks to me that there is no font in matplotlib that can display Chinese
>> characters? I can display accentuation from 'utf8' but i could not find a
>> font family that would display Chinese characters.
>>
>> Here is an example of plot that displays empty boxes instead of Chinese
>> characters. In comments you can see various failed attempts:
>>
>> import matplotlib as mpl
>> from matplotlib import cm
>> from matplotlib import rc
>> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
>> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
>> import matplotlib.pyplot as plt
>>
>> matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
>> fig = plt.figure()
>> axim = fig.add_subplot(111)
>> #ytics: caractères chinois en utf8
>> ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
>> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
>> axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',origin='lower')
>> axim.set_xticks(range(2))
>> axim.set_xticklabels(xtics,fontsize=15,rotation=25,ha='right',family='monospace')
>> axim.set_yticks(range(2))
>> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR PL
>> ungtiL GB')
>> plt.show()
>>
>> Thank you for your help,
>>
>> Benoit
>>
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>> Hi,
>>
>> How can one display mandarin labels in a plot, as yticks_labels for example?
>> It looks to me that there is no font in matplotlib that can display chinese
>> characters? I can display accentuation from 'utf8' but i could not find a
>> font family that would display chinese characters.
>>
>> Here is an example of plot that displays empty boxes instead of chinese
>> characters. In comment you can see various failed attempts:
>>
>> import matplotlib as mpl
>> from matplotlib import cm
>> from matplotlib import rc
>> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
>> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
>> import matplotlib.pyplot as plt
>>
>>   matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
>>   fig = plt.figure()
>>   axim = fig.add_subplot(111)
>>   #ytics: caractères chinois en utf8
>>   ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
>>   xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
>>   axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',
>> origin='lower')
>>   axim.set_xticks(range(2))
>>   axim.set_xticklabels(xtics,
>> fontsize=15,rotation=25,ha='right',family='monospace')
>>   axim.set_yticks(range(2))
>>   axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR
>> PL SungtiL GB')
>>   plt.show()
>>
>> Thank you for your help,
>>
>> Benoit
>>
>> ------------------------------------------------------------------------------
>> Beautiful is writing same markup. Internet Explorer 9 supports
>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>> Spend less time writing and rewriting code and more time creating great
>> experiences on the web. Be a part of the beta today.
>> http://p.sf.net/sfu/beautyoftheweb
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
From: Benjamin R. <ben...@ou...> - 2010年10月12日 14:40:14
On Tue, Oct 12, 2010 at 9:25 AM, Benjamin Root <ben...@ou...> wrote:
> On Tue, Oct 12, 2010 at 7:57 AM, Stefan Mauerberger <
> ste...@mn...> wrote:
>
>> Hi everyone,
>>
>> I am having trouble with colormaps unsing pcolormesh. I would like to
>> plot and colorise a seismic wave field above a map. Plotting works fine
>> but I do not know how to bring transparency into colormaps. For negative
>> values I want the coloration being blue then it should become
>> transparent and the greatest value should be drawn red. I have tried a
>> lot but without any success. As far as I can see, the keyarg alpha does
>> not fit my needs at all.
>>
>> Do you have any suggestions for me?
>>
>> Regards
>>
>> Stefan
>>
>>
> Stefan,
>
> If you mean using the keyword 'alpha' in the pcolormesh function, then yes,
> that isn't the right place for it. In your case, the right place to specify
> the alpha channel is in the colormap itself. Unfortunately, it is currently
> designed around the idea of a scalar value specifying the transparency.
>
> What you can do is a little trick. First, get the colormap object and then
> initialize it. This will cause it to internally create an array called
> "_lut" which holds rgba values.
>
> >>> theCM = cm.get_cmap('somemap')
> >>> theCM._init()
>
> Then, you need to fill in the alpha values for yourself. For this, I am
> going to use a triangle function:
>
> >>> alphas = np.abs(np.linspace(-1.0, 1.0, theCM.N))
> >>> theCM._lut[:,-1] = alphas
>
> Now that your colormap is set up, you can pass it into your pcolormesh
> call.
>
> >>> plt.pcolormesh(X, Y, C, cmap=theCM)
>
> That should work, but I have not fully tested it. I hope that helps!
> Ben Root
>
>
Slight correction to my code example:
>>> theCM._lut[:-3,-1] = alphas
Sorry for any confusion.
Ben Root
From: Justin B. <jus...@gm...> - 2010年10月12日 14:27:59
I am preparing 3D plots and have found that the default axis labels are too
close to the tick labels, especially when large font sizes are chosen. As
such, I would like to specify the position of the axis label.
Unfortunately, I haven't met much success. See the code below (based on one
of the mplot3d examples). Does anyone have any tips on how to move the axis
labels further away from the axis in 3D plots?
Thanks,
Justin
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
X, Y, Z = axes3d.get_test_data(0.05)
ax.plot_wireframe(X, Y, Z, rstride=5, cstride=5)
ax.set_xlabel('x')
# This doesn't work:
ax.w_xaxis.set_label_coords(-0.2, -0.2)
# This doesn't work either:
# ax.w_xaxis.label.set_position((-0.2, -0.2))
# The axis label positions appear to have changed, but not in figure
print ax.w_xaxis.label.get_position()
plt.show()
From: Scott S. <sco...@gm...> - 2010年10月12日 14:27:58
On 12 October 2010 14:57, Stefan Mauerberger
<ste...@mn...> wrote:
> I am having trouble with colormaps unsing pcolormesh. I would like to
> plot and colorise a seismic wave field above a map. Plotting works fine
> but I do not know how to bring transparency into colormaps. For negative
> values I want the coloration being blue then it should become
> transparent and the greatest value should be drawn red. I have tried a
> lot but without any success. As far as I can see, the keyarg alpha does
> not fit my needs at all.
>
> Do you have any suggestions for me?
You can't make the actual colormap contain transparent color entries,
but you can easily plot a masked array using a custom colormap. The
attached script based on
http://matplotlib.sourceforge.net/examples/pylab_examples/custom_cmap.html
should help you get what you want.
The important part of the script is to create a Numpy masked array to
exclude the regions you'd like to appear transparent:
cond = (-0.1 < Z) & (Z < 0.1)
Z_masked = np.ma.masked_where(cond, Z)
Cheers,
Scott
From: Benjamin R. <ben...@ou...> - 2010年10月12日 14:25:52
On Tue, Oct 12, 2010 at 7:57 AM, Stefan Mauerberger <
ste...@mn...> wrote:
> Hi everyone,
>
> I am having trouble with colormaps unsing pcolormesh. I would like to
> plot and colorise a seismic wave field above a map. Plotting works fine
> but I do not know how to bring transparency into colormaps. For negative
> values I want the coloration being blue then it should become
> transparent and the greatest value should be drawn red. I have tried a
> lot but without any success. As far as I can see, the keyarg alpha does
> not fit my needs at all.
>
> Do you have any suggestions for me?
>
> Regards
>
> Stefan
>
>
Stefan,
If you mean using the keyword 'alpha' in the pcolormesh function, then yes,
that isn't the right place for it. In your case, the right place to specify
the alpha channel is in the colormap itself. Unfortunately, it is currently
designed around the idea of a scalar value specifying the transparency.
What you can do is a little trick. First, get the colormap object and then
initialize it. This will cause it to internally create an array called
"_lut" which holds rgba values.
>>> theCM = cm.get_cmap('somemap')
>>> theCM._init()
Then, you need to fill in the alpha values for yourself. For this, I am
going to use a triangle function:
>>> alphas = np.abs(np.linspace(-1.0, 1.0, theCM.N))
>>> theCM._lut[:,-1] = alphas
Now that your colormap is set up, you can pass it into your pcolormesh call.
>>> plt.pcolormesh(X, Y, C, cmap=theCM)
That should work, but I have not fully tested it. I hope that helps!
Ben Root
From: Stefan M. <ste...@mn...> - 2010年10月12日 13:14:25
Hi everyone, 
I am having trouble with colormaps unsing pcolormesh. I would like to
plot and colorise a seismic wave field above a map. Plotting works fine
but I do not know how to bring transparency into colormaps. For negative
values I want the coloration being blue then it should become
transparent and the greatest value should be drawn red. I have tried a
lot but without any success. As far as I can see, the keyarg alpha does
not fit my needs at all. 
Do you have any suggestions for me? 
Regards
Stefan
From: Fernando P. <fpe...@gm...> - 2010年10月12日 07:11:09
Hi all,
we've just released IPython 0.10.1, full release notes are below.
Downloads in source and windows binary form are available in the usual location:
http://ipython.scipy.org/dist/
But since our switch to github, we also get automatic distribution of
archives there:
http://github.com/ipython/ipython/archives/rel-0.10.1
and we've also started uploading archives to the Python Package Index
(which easy_install will use by default):
http://pypi.python.org/pypi/ipython
so at any time you should find a location with good download speeds.
You can find the full documentation at:
http://ipython.scipy.org/doc/rel-0.10.1/html/index.html
Enjoy!
Fernando (on behalf of the whole IPython team)
Release 0.10.1
==============
IPython 0.10.1 was released October 11, 2010, over a year after version 0.10.
This is mostly a bugfix release, since after version 0.10 was released, the
development team's energy has been focused on the 0.11 series. We have
nonetheless tried to backport what fixes we could into 0.10.1, as it remains
the stable series that many users have in production systems they rely on.
Since the 0.11 series changes many APIs in backwards-incompatible ways, we are
willing to continue maintaining the 0.10.x series. We don't really have time
to actively write new code for 0.10.x, but we are happy to accept patches and
pull requests on the IPython `github site`_. If sufficient contributions are
made that improve 0.10.1, we will roll them into future releases. For this
purpose, we will have a branch called 0.10.2 on github, on which you can base
your contributions.
.. _github site: http://github.com/ipython
For this release, we applied approximately 60 commits totaling a diff of over
7000 lines::
 (0.10.1)amirbar[dist]> git diff --oneline rel-0.10.. | wc -l
 7296
Highlights of this release:
- The only significant new feature is that IPython's parallel computing
 machinery now supports natively the Sun Grid Engine and LSF schedulers. This
 work was a joint contribution from Justin Riley, Satra Ghosh and Matthieu
 Brucher, who put a lot of work into it. We also improved traceback handling
 in remote tasks, as well as providing better control for remote task IDs.
- New IPython Sphinx directive. You can use this directive to mark blocks in
 reSructuredText documents as containig IPython syntax (including figures) and
 the will be executed during the build::
 .. ipython::
 In [2]: plt.figure() # ensure a fresh figure
 @savefig psimple.png width=4in
 In [3]: plt.plot([1,2,3])
 Out[3]: [<matplotlib.lines.Line2D object at 0x9b74d8c>]
- Various fixes to the standalone ipython-wx application.
- We now ship internally the excellent argparse library, graciously licensed
 under BSD terms by Steven Bethard. Now (2010) that argparse has become part
 of Python 2.7 this will be less of an issue, but Steven's relicensing allowed
 us to start updating IPython to using argparse well before Python 2.7. Many
 thanks!
- Robustness improvements so that IPython doesn't crash if the readline library
 is absent (though obviously a lot of functionality that requires readline
 will not be available).
- Improvements to tab completion in Emacs with Python 2.6.
- Logging now supports timestamps (see ``%logstart?`` for full details).
- A long-standing and quite annoying bug where parentheses would be added to
 ``print`` statements, under Python 2.5 and 2.6, was finally fixed.
- Improved handling of libreadline on Apple OSX.
- Fix ``reload`` method of IPython demos, which was broken.
- Fixes for the ipipe/ibrowse system on OSX.
- Fixes for Zope profile.
- Fix %timeit reporting when the time is longer than 1000s.
- Avoid lockups with ? or ?? in SunOS, due to a bug in termios.
- The usual assortment of miscellaneous bug fixes and small improvements.
The following people contributed to this release (please let us know if we
omitted your name and we'll gladly fix this in the notes for the future):
* Beni Cherniavsky
* Boyd Waters.
* David Warde-Farley
* Fernando Perez
* Gökhan Sever
* Justin Riley
* Kiorky
* Laurent Dufrechou
* Mark E. Smith
* Matthieu Brucher
* Satrajit Ghosh
* Sebastian Busch
* Václav Šmilauer
From: sunqiang <sun...@gm...> - 2010年10月12日 07:04:26
maybe change the line
"""axim.set_yticklabels(ytics,fontsize=15,family='fantasy')""" to
"""axim.set_yticklabels(ytics,fontsize=15, fontname= "simsun (founder
extended)")"""
(or replace fontname with "simhei" or "microsoft yahei") is enough.
or, put these two lines:
mpl.rcParams['font.sans-serif'] = ['SimHei']
mpl.rcParams['axes.unicode_minus'] = False
there is a Chinese blog (not mine) maybe worth reading:
http://hi.baidu.com/lijiangshui/blog/item/a0aad703cd65ee7e3812bb49.html
hope this help
On Mon, Oct 11, 2010 at 3:13 AM, Benoit Gaillard
<ben...@un...> wrote:
> Hi,
>
> How can one display Mandarin labels in a plot, as yticks_labels for example?
> It looks to me that there is no font in matplotlib that can display Chinese
> characters? I can display accentuation from 'utf8' but i could not find a
> font family that would display Chinese characters.
>
> Here is an example of plot that displays empty boxes instead of Chinese
> characters. In comments you can see various failed attempts:
>
> import matplotlib as mpl
> from matplotlib import cm
> from matplotlib import rc
> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
> import matplotlib.pyplot as plt
>
> matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
> fig = plt.figure()
> axim = fig.add_subplot(111)
> #ytics: caractères chinois en utf8
> ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
> axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',origin='lower')
> axim.set_xticks(range(2))
> axim.set_xticklabels(xtics,fontsize=15,rotation=25,ha='right',family='monospace')
> axim.set_yticks(range(2))
> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR PL
> ungtiL GB')
> plt.show()
>
> Thank you for your help,
>
> Benoit
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
> Hi,
>
> How can one display mandarin labels in a plot, as yticks_labels for example?
> It looks to me that there is no font in matplotlib that can display chinese
> characters? I can display accentuation from 'utf8' but i could not find a
> font family that would display chinese characters.
>
> Here is an example of plot that displays empty boxes instead of chinese
> characters. In comment you can see various failed attempts:
>
> import matplotlib as mpl
> from matplotlib import cm
> from matplotlib import rc
> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
> import matplotlib.pyplot as plt
>
>   matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
>   fig = plt.figure()
>   axim = fig.add_subplot(111)
>   #ytics: caractères chinois en utf8
>   ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
>   xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
>   axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',
> origin='lower')
>   axim.set_xticks(range(2))
>   axim.set_xticklabels(xtics,
> fontsize=15,rotation=25,ha='right',family='monospace')
>   axim.set_yticks(range(2))
>   axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR
> PL SungtiL GB')
>   plt.show()
>
> Thank you for your help,
>
> Benoit
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
> Spend less time writing and rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Michael D. <md...@st...> - 2010年10月11日 16:31:55
On 10/10/2010 03:13 PM, Benoit Gaillard wrote:
> Hi,
>
> How can one display Mandarin labels in a plot, as yticks_labels for 
> example?
> It looks to me that there is no font in matplotlib that can display 
> Chinese
> characters? I can display accentuation from 'utf8' but i could not find a
> font family that would display Chinese characters.
>
> Here is an example of plot that displays empty boxes instead of Chinese
> characters. In comments you can see various failed attempts:
>
> import matplotlib as mpl
> from matplotlib import cm
> from matplotlib import rc
> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
> import matplotlib.pyplot as plt
>
> matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
> fig = plt.figure()
> axim = fig.add_subplot(111)
> #ytics: caractères chinois en utf8
> ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
> axim.imshow(matrix, cmap=cm.jet, interpolation='nearest',origin='lower')
> axim.set_xticks(range(2)) 
> axim.set_xticklabels(xtics,fontsize=15,rotation=25,ha='right',family='monospace') 
>
> axim.set_yticks(range(2))
> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR 
> PL ungtiL GB')
> plt.show()
>
> Thank you for your help,
>
> Benoit
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
>
> Hi,
>
> How can one display mandarin labels in a plot, as yticks_labels for 
> example? It looks to me that there is no font in matplotlib that can 
> display chinese characters? I can display accentuation from 'utf8' but 
> i could not find a font family that would display chinese characters.
>
> Here is an example of plot that displays empty boxes instead of 
> chinese characters. In comment you can see various failed attempts:
>
> import matplotlib as mpl
> from matplotlib import cm
> from matplotlib import rc
> #rc('font',**{'family':'sans-serif','sans-serif':['SimHei','Arial']})
> #mpl.rcParams['font.sans-serif'] = ['SimHei','Arial']
> import matplotlib.pyplot as plt
>
> matrix=[[skey+tkey for skey in [1,2]] for tkey in [1,2]]
> fig = plt.figure()
> axim = fig.add_subplot(111)
> #ytics: caractères chinois en utf8
> ytics=['\xe6\x8a\xb1'.decode('utf8'),'\xe6\x93\x81'.decode('utf8')]
> 
> xtics=['d\xc3\xa9bo\xc3\xaeter'.decode('utf8'),'diviser'.decode('utf8')]
> axim.imshow(matrix, cmap=cm.jet, interpolation='nearest', 
> origin='lower')
> axim.set_xticks(range(2))
> axim.set_xticklabels(xtics, 
> fontsize=15,rotation=25,ha='right',family='monospace')
> axim.set_yticks(range(2))
> 
> axim.set_yticklabels(ytics,fontsize=15,family='fantasy')#,fontname='AR 
> PL SungtiL GB')
Why are you setting the font family to "monospace" and "fantasy" here? 
You need to set the font to something that will have the Chinese 
characters, for example, by uncommenting the lines that set sans-serif 
to "SimHei" above. (That should work, but I don't have a Chinese font 
on my system to test with.)
Mike
> plt.show()
>
> Thank you for your help,
>
> Benoit
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2& L3.
> Spend less time writing and rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Peter B. <bu...@gm...> - 2010年10月11日 16:30:28
Hi Alessio,
Thank you for the sqlite code example.
What have been the key advantages of using a Database over a
structured array for your applications ?
http://docs.python.org/library/sqlite3.html :
SQLite is a C library that provides a lightweight disk-based database
that doesn’t require a separate server process and allows accessing
the database using a nonstandard variant of the SQL query language.
On Sun, Oct 10, 2010 at 12:56 PM, Peter Butterworth <bu...@gm...> wrote:
> Hi,
>
>
> To load csv data, I use a modified version of csv2rec for which the
> data type of each column is specified explicitly in the data file.
> By removing the dtype guessing you get a speedup and you also avoid
> potential mess-ups.
>
>
> Alessio: sadly you right about it not being possible to trust Excel with data.
> Could you please give more details on the sqlite method you suggest ?
>
>
> --
>>> by Alessio Civ Oct 10, 2010; 09:04am:
> Hi,
>
> a strong advice from someone who is using excel format with tons of
> data is to save them in csv and then import in Sqlite.
>
> Excel messes up the data types and gives a lot of troubles with
> numbers. Sqlite is fast and data are secure.
> The power of this system is that you can query your data and plot what
> you need for example.
>
> I can share with you my script to import from csv to sqlite if you want.
>
>
> --
> thanks,
> peter butterworth
>
-- 
thanks,
peter butterworth
From: Benjamin R. <ben...@ou...> - 2010年10月11日 16:19:03
On Sun, Oct 10, 2010 at 8:54 PM, Burak TUYSUZ <bz...@ps...> wrote:
>
> I am trying to show the numbers at x and y axis in scientific notation but
> it does not work.
> Can anyone help me.
> Thank you in advance.
> Here is the code and fs is 60 000 000.
>
>
> from matplotlib.ticker import ScalarFormatter
> formatter = ScalarFormatter(useMathText=True)
> formatter.set_scientific(True)
> formatter.set_powerlimits((-1,3))
>
> fig1 = plt.figure()
> ax1 = fig1.gca(projection='3d', azim=0)
> ax1.xaxis.set_major_formatter(formatter)
> ax1.yaxis.set_major_formatter(formatter)
>
> tau_val, freq_val = npy.meshgrid(npy.float64(tau_val)/fs,
> npy.float64(freq_val)*fs)
> ax1.plot_surface(tau_val, freq_val, caf, rstride=1, cstride=1,
> cmap=cm.jet, linewidth=0, antialiased=False)
>
> plt.show()
>
>
Burak,
This is because in an Axes3D object, the .xaxis and .yaxis refer to the axis
for the draw space, not the the 3d projected axis. I know it is confusing,
but the axis objects that you want are called ".w_xaxis" and ".w_yaxis" and
".w_zaxis".
I hope that helps!
Ben Root
From: Peter B. <bu...@gm...> - 2010年10月11日 16:08:02
Hi,
I believe it is not currently possible to change the toolbar in a
backend independent manner. I do agree it would be a nice feature
though.
I think it would be possible to change the toolbar without embedding
with a syntax not all that different from the one you suggest.
In the figure window, the toolbar is displayed by the FigureManager(
FigureManagerBase), you'll find the related code in the backend file
and you can gain access to the FigureManager through the figure
instance.
Please share the code for your annotation toolbar once it is
completed, I'm sure I could find use for it.
---------------
>> by Bartosz Telenczuk Oct 11, 2010; 11:44am
Dear all,
I am working on a custom toolbar with annotation tools (such as
arrows, text etc.) which would be a replacement or addition to the
standard navigation toolbar usually available at the bottom of the
figure window.
So far in order to add the toolbar I use the example
embedding_in_gtk2.py. Unfortunately this works only with gtk backends.
Is there a way to add the toolbar to the window in a
backend-independent way? For example, the following syntax would be
very convenient:
fig = figure()
tbar = NavigationToolbar()
fig.add_toolbar(tbar)
With such an API one could define on the runtime which toolbar should
be avialable. Adding multiple toolbar would be also possible.
Yours,
Bartosz
Bartosz Telenczuk
Institute for Theoretical Biology
Humboldt University of Berlin
Germany
http://neuroscience.telenczuk.pl
-- 
thanks,
peter butterworth
7 messages has been excluded from this view by a project administrator.

Showing results of 428

<< < 1 .. 9 10 11 12 13 .. 18 > >> (Page 11 of 18)
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 によって変換されたページ (->オリジナル) /