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) |
|
|
|
|
|
|
|
From: Christopher B. <Chr...@no...> - 2010-10-15 15:50:10
|
On 10/14/10 9:52 PM, Alessio Civ wrote: > Let' put things this way: if you have to work with many records, it is > better if you have a database. pyTables is worth a look, too" http://www.pytables.org/moin -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: Daniel H. <dh...@gm...> - 2010-10-15 15:31:05
|
Right, there is only a subset of marker styles supported in the scatter function, both 2D and 3D. This is because, behind the scenes, it's drawing all of the symbols as patches. See http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.scatter On Fri, Oct 15, 2010 at 10:43 AM, R. Bryn Fenwick < rob...@ir...> wrote: > > Marker types in 3d plots > > Hi, > > A few problems with marker types in 3D plots. I can use "o" and "^" > and "+". However I can not use "." or "," it seems a bit odd to me > however I get the below error. It should be possible to repeat this > with the following input > > Traceback (most recent call last): > File "test.py", line 16, in <module> > ax.scatter(xs, ys, zs, c=c, marker=m) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 1019, in > scatter > patches = Axes.scatter(self, xs, ys, *args, **kwargs) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/matplotlib/axes.py", line 5719, in scatter > raise ValueError('Unknown marker symbol to scatter') > ValueError: Unknown marker symbol to scatter > > ---- > import numpy as np > from mpl_toolkits.mplot3d import axes3d > import matplotlib.pyplot as plt > > def randrange(n, vmin, vmax): > return (vmax-vmin)*np.random.rand(n) + vmin > > fig = plt.figure() > ax = fig.add_subplot(111, projection='3d') > n = 100 > #for c, m, zl, zh in [('r', '+', -50, -25), ('b', '^', -30, -5)]: > for c, m, zl, zh in [('r', '+', -50, -25), ('b', '.', -30, -5)]: > xs = randrange(n, 23, 32) > ys = randrange(n, 0, 100) > zs = randrange(n, zl, zh) > ax.scatter(xs, ys, zs, c=c, marker=m) > > ax.set_xlabel('X Label') > ax.set_ylabel('Y Label') > ax.set_zlabel('Z Label') > > plt.show() > > > > ------------------------------------------------------------------------------ > Download new Adobe(R) Flash(R) Builder(TM) 4 > The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly > Flex(R) Builder(TM)) enable the development of rich applications that run > across multiple browsers and platforms. Download your free trials today! > http://p.sf.net/sfu/adobe-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Daniel Hyams dh...@gm... |
|
From: R. B. F. <rob...@ir...> - 2010-10-15 14:43:51
|
Marker types in 3d plots
Hi,
A few problems with marker types in 3D plots. I can use "o" and "^"
and "+". However I can not use "." or "," it seems a bit odd to me
however I get the below error. It should be possible to repeat this
with the following input
Traceback (most recent call last):
File "test.py", line 16, in <module>
ax.scatter(xs, ys, zs, c=c, marker=m)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 1019, in
scatter
patches = Axes.scatter(self, xs, ys, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/matplotlib/axes.py", line 5719, in scatter
raise ValueError('Unknown marker symbol to scatter')
ValueError: Unknown marker symbol to scatter
----
import numpy as np
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
def randrange(n, vmin, vmax):
return (vmax-vmin)*np.random.rand(n) + vmin
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
n = 100
#for c, m, zl, zh in [('r', '+', -50, -25), ('b', '^', -30, -5)]:
for c, m, zl, zh in [('r', '+', -50, -25), ('b', '.', -30, -5)]:
xs = randrange(n, 23, 32)
ys = randrange(n, 0, 100)
zs = randrange(n, zl, zh)
ax.scatter(xs, ys, zs, c=c, marker=m)
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
plt.show()
|
|
From: Daniel H. <dh...@gm...> - 2010-10-15 14:36:24
|
Ugh, if I could only undo an email send 20 seconds after I hit go ;) If setting 'edgewidths' to 0 doesn't work, try setting 'edgecolors' to 'None' as per JDH's suggestion above, which is the same suggestion as mine except for the "marker" part of the property is removed. On Fri, Oct 15, 2010 at 10:32 AM, Daniel Hyams <dh...@gm...> wrote: > Since you are talking about markers, I assume that you made the plot with > the scatter() function. > > The scatter() function creates the appropriate collection of patches > (polygon, circle, etc.) depending on what the marker style was passed to > it. As such, the normal 'marker*' properties do not work, as there is just > a collection patches that is being drawn. So the properties that you are > looking for in your situation are here: > > > http://matplotlib.sourceforge.net/api/collections_api.html#matplotlib.collections.PatchCollection > > I believe that the property you are looking for is 'edgewidth'. E.g. (and > I think this is right, but not where I can test right now): > > the_artist.set_edgewidth(0.0) > > Which I believe will work, or you may have to do > > the_artist.set_edgewidths((0.0,)) > > But anyway, hopefully this is enough to set you on your way. > > > On Fri, Oct 15, 2010 at 4:10 AM, Robert Fenwick < > rob...@ir...> wrote: > >> >> Hi, >> >> I have a 3d plot that I am trying to plot and I can not get rid of the >> marker edge. an example would help >> >> Bryn >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> Download new Adobe(R) Flash(R) Builder(TM) 4 >> The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly >> Flex(R) Builder(TM)) enable the development of rich applications that run >> across multiple browsers and platforms. Download your free trials today! >> http://p.sf.net/sfu/adobe-dev2dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > > -- > Daniel Hyams > dh...@gm... > -- Daniel Hyams dh...@gm... |
|
From: Daniel H. <dh...@gm...> - 2010-10-15 14:33:38
|
Since you are talking about markers, I assume that you made the plot with the scatter() function. The scatter() function creates the appropriate collection of patches (polygon, circle, etc.) depending on what the marker style was passed to it. As such, the normal 'marker*' properties do not work, as there is just a collection patches that is being drawn. So the properties that you are looking for in your situation are here: http://matplotlib.sourceforge.net/api/collections_api.html#matplotlib.collections.PatchCollection I believe that the property you are looking for is 'edgewidth'. E.g. (and I think this is right, but not where I can test right now): the_artist.set_edgewidth(0.0) Which I believe will work, or you may have to do the_artist.set_edgewidths((0.0,)) But anyway, hopefully this is enough to set you on your way. On Fri, Oct 15, 2010 at 4:10 AM, Robert Fenwick < rob...@ir...> wrote: > > Hi, > > I have a 3d plot that I am trying to plot and I can not get rid of the > marker edge. an example would help > > Bryn > > > > > > > > ------------------------------------------------------------------------------ > Download new Adobe(R) Flash(R) Builder(TM) 4 > The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly > Flex(R) Builder(TM)) enable the development of rich applications that run > across multiple browsers and platforms. Download your free trials today! > http://p.sf.net/sfu/adobe-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Daniel Hyams dh...@gm... |
|
From: John H. <jd...@gm...> - 2010-10-15 13:40:50
|
On Thu, Oct 14, 2010 at 2:07 PM, Carl Karsten <ca...@pe...> wrote: > yep - thanks. Not exactly how I remember it from the talk. wonder > where the story got changed. Hey Carl -- I added the talk video link on the mpl website http://carlfk.blip.tv/file/2557425 The dolphins story you were referring to starts around 39:30. Not sure how your memory of the story got deformed :-) JDH |
|
From: Jae-Joon L. <lee...@gm...> - 2010-10-15 13:25:27
|
On Fri, Oct 15, 2010 at 9:33 PM, Lorenzo Isella
<lor...@gm...> wrote:
> arr = Arrow(0, 0, .3, .3, edgecolor='white')
>
> # Get the subplot that we are currently working on
> ax = gca()
>
> # Now add the arrow
> ax.add_patch(arr)
>
>
I recommend you to use the annotate command.
annotate("", xy=(0, 0), xytext=(0.3, 0.3), arrowprops=dict(fc="g"))
see
http://matplotlib.sourceforge.net/users/annotations_guide.html#annotating-with-arrow
Regards,
-JJ
|
|
From: John H. <jd...@gm...> - 2010-10-15 12:52:02
|
On Fri, Oct 15, 2010 at 3:10 AM, Robert Fenwick
<rob...@ir...> wrote:
> I have a 3d plot that I am trying to plot and I can not get rid of the marker edge. an example would help
What have you tried -- if line is a Line3D object, the following should work:
line.set_markeredgecolor('None')
Note that 'None' is a string here, not the python object None. This
is because None in matplotlib properties means do the default, ie the
default value specified in matplotlibrc
http://matplotlib.sourceforge.net/users/customizing.html
JDH
|
|
From: Lorenzo I. <lor...@gm...> - 2010-10-15 12:33:56
|
Dear All, I am not very much into matplotlib, so please bear with me if I am asking a trivial question. I put together this small snippet with the help I got on the mailing list and using the arrow example at http://bit.ly/cI9dqj . My problem is (or at least I believe it to be) the fact that I am messing up the coordinates or rather: I am generating a x and y coordinates in the range [-1,1], but I eventually resort to polar coordinates. It all goes fine till I try adding arrows to the image (then I think about Cartesian coordinates) and the result is quite a mess. Bottom line: any ideas about how to use arrows in a polar plot? Many thanks Lorenzo ########################################################################## #!/usr/bin/env python """ See pcolor_demo2 for a much faster way of generating pcolor plots """ from __future__ import division from pylab import * # make these smaller to increase the resolution dx, dy = 0.005, 0.005 x = arange(-1.0, 1.0, dx) y = arange(-1.0, 1.0, dy) X,Y = meshgrid(x, y) # function defined in polar coordinate def func5(theta, r): y = r*np.sin(theta) theta=np.arcsin(y) return np.cos(theta) def func6(theta, r): y = r*np.sin(theta) theta=np.arcsin(y) return np.abs(sin(theta)) def func7(theta, r): y = r*np.sin(theta) theta=np.arcsin(y) return np.abs(cos(theta)) R=1. n_theta, n_r = 360, 100 # coordinates of the mesh theta = np.linspace(0, 2*np.pi, n_theta+1) r = np.linspace(0., R, n_r + 1) dr, dtheta = r[1]-r[0], theta[1]-theta[0] # cooridnate for the data point theta_d = np.arange(dtheta/2., 2*np.pi, dtheta) r_d = np.arange(dr/2., R, dr) TT, RR = meshgrid(theta_d, r_d) # Z = func6(TT, RR) Z = func7(TT, RR) ax=subplot(1,1,1, projection="polar", aspect=1.) ax.pcolormesh(theta, r, Z) # ax.set_xlabel('Model complexity --->') ax.set_yticklabels([]) ax.set_xticklabels([]) ax.grid(False) # show() arr = Arrow(0, 0, .3, .3, edgecolor='white') # Get the subplot that we are currently working on ax = gca() # Now add the arrow ax.add_patch(arr) # We should be able to make modifications to the arrow. # Lets make it green. arr.set_facecolor('g') savefig("test.pdf") clf() |
|
From: Daniel F. <dan...@we...> - 2010-10-15 10:21:05
|
Dear all, I would like to project a graphics file of some colour coded geo data that is already given in lat-lon with corners specified in lat-lon onto a map. The projection of the result should be flexible. In the end the resulting plot shows a section of the earth, either from a satallite perspective (ortho) or some convenient projection. All examples I found seem to be doing different things or special cases that I have trouble to generalize or modify. These examples transform the data from some (often unpecified) system to a coordinate system that suites the chosen projection. But the fact that the geo data file is given in lat-lon with corners must simplify everything and should make the chosen projection arbitrary. The resolution of the data file must also be arbitrary and should not appear in the code. I do not see why the final projection should require beforehand a change of the geo-data coordinate system *by hand* i.e. typing in the transform formulas and extracting pixel sizes. I would have thought that to avoid this is the whole point of using map toolkits. I imagine a function that takes the parameters - datafile, alternatively an array with a colour value or RGB for each lon-lat coordinate - its lon-lat corners, - a basemap map-object i want the data projected onto - and the projection specifier (possibly with desired corners if different from the maps corners) that determines how i want to see the the resulting piece of the globe. Could someone explain to me (a python newbie) what the sequence of steps/functions would have to be or which predefined methods are doing this. Regards Daniel |
|
From: Robert F. <rob...@ir...> - 2010-10-15 09:55:27
|
Hi, I have a 3d plot that I am trying to plot and I can not get rid of the marker edge. an example would help Bryn |
|
From: Alessio C. <via...@gm...> - 2010-10-15 04:52:58
|
Let' put things this way: if you have to work with many records, it is better if you have a database. With a database you can query what you need and only this is worthed the effort of using a DB. butterw wrote: > > 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 > > ------------------------------------------------------------------------------ > 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 > > -- View this message in context: http://old.nabble.com/Best-way-to-use-Excel-Data-tp29908079p29968676.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: sunqiang <sun...@gm...> - 2010-10-15 01:57:58
|
You are welcome, glad to help. On Thu, Oct 14, 2010 at 4:04 PM, Benoit Gaillard <ben...@un...> wrote: > Thank you very much it all works fine now, > > I downloaded and installed the font in > http://archive.ubuntu.com/ubuntu/pool/main/t/ttf-wqy-zenhei/ttf-wqy-zenhei_0.5.23.orig.tar.gz, > as you advised. Then i deleted the fontList.cache de matplotlib to force its > updating, and ran the script with """ fontname="WenQuanYi Zen Hei" """ > > I can now display the characters and save the plots as pdf. > > Thanks a lot for you wise help, i learned a lot. > > Benoit > > > Quoting sunqiang <sun...@gm...>: > >> On Wed, Oct 13, 2010 at 5:30 PM, Benoit Gaillard >> <ben...@un...> wrote: >>> >>> 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? >> >> the "c" in ".ttc" means "Container", wqy-*.ttc includes more than one ttf. >> so, maybe just rename *.ttc to *.ttf is not enough. >> I guess, You can find some font tools to extract ttf from ttc, or >> install another Chinese font provided by your operation system. or >> just download the ttf version from >> http://packages.ubuntu.com/hardy/ttf-wqy-zenhei (directly: >> >> http://archive.ubuntu.com/ubuntu/pool/main/t/ttf-wqy-zenhei/ttf-wqy-zenhei_0.5.23.orig.tar.gz) >> I don't know font enough, so I didn't test the first method. I only >> test the last method. >> after download the font into my Window machine. it can display Chinese >> with "'WenQuanYi Zen Hei'" and save figure to png and pdf.(ps, eps >> doesn't work, even without a error log"). >> (my Linux machine(Ubuntu Hardy 8.04) can display Chinese and save >> figure to png, pdf, ps, eps correctly already.) >>> >>> 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. >>> >>> >> > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > |