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
(14) |
3
(13) |
4
(6) |
|
5
(6) |
6
(21) |
7
(29) |
8
(30) |
9
(13) |
10
(4) |
11
(4) |
|
12
(4) |
13
(15) |
14
(22) |
15
(23) |
16
(23) |
17
(9) |
18
(23) |
|
19
(12) |
20
(10) |
21
(26) |
22
(5) |
23
(32) |
24
(5) |
25
(7) |
|
26
(4) |
27
(3) |
28
(19) |
29
(20) |
|
|
|
|
From: Ted To <rai...@th...> - 2012-02-08 16:06:35
|
If it hasn't been fixed, is there a workaround? On 02/08/2012 10:42 AM, Ted To wrote: > I believe I have traced it to some axhline and axis commands and this is > apparently an old problem. Does it work with version 1.1.0? I have > 1.0.1 installed on a debian system. > > On 02/08/2012 09:47 AM, Ted To wrote: >> Hi, >> >> I'm experiencing a very strange problem with plot_date that I can't >> figure out. >> >> pyplot.plot_date(pylab.date2num(dates),diff,'b-',label='Chained') >> pyplot.show() >> >> dates, naturally, is a list of dates and diff is an array of floats. >> With my script, this fails. But if I interactively enter dates and diff >> and then type the above commands, it works with no problems. Any ideas >> or suggestions? >> >> The traceback follows. >> >> Thanks, >> Ted >> >> Exception in Tkinter callback >> Traceback (most recent call last): >> File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__ >> return self.func(*args) >> File >> "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", >> line 245, in resize >> self.show() >> File >> "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", >> line 248, in draw >> FigureCanvasAgg.draw(self) >> File >> "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line >> 394, in draw >> self.figure.draw(self.renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 55, in >> draw_wrapper >> draw(artist, renderer, *args, **kwargs) >> File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 798, in >> draw >> func(*args) >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 55, in >> draw_wrapper >> draw(artist, renderer, *args, **kwargs) >> File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1946, in draw >> a.draw(renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 55, in >> draw_wrapper >> draw(artist, renderer, *args, **kwargs) >> File "/usr/lib/pymodules/python2.6/matplotlib/axis.py", line 971, in draw >> tick_tups = [ t for t in self.iter_ticks()] >> File "/usr/lib/pymodules/python2.6/matplotlib/axis.py", line 904, in >> iter_ticks >> majorLocs = self.major.locator() >> File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 743, in >> __call__ >> self.refresh() >> File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 752, in >> refresh >> dmin, dmax = self.viewlim_to_dt() >> File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 524, in >> viewlim_to_dt >> return num2date(vmin, self.tz), num2date(vmax, self.tz) >> File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 289, in >> num2date >> if not cbook.iterable(x): return _from_ordinalf(x, tz) >> File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 203, in >> _from_ordinalf >> dt = datetime.datetime.fromordinal(ix) >> ValueError: ordinal must be >= 1 >> >> ------------------------------------------------------------------------------ >> Keep Your Developer Skills Current with LearnDevNow! >> The most comprehensive online learning library for Microsoft developers >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >> Metro Style Apps, more. Free future releases when you subscribe now! >> http://p.sf.net/sfu/learndevnow-d2d >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: John H. <jd...@gm...> - 2012-02-08 15:54:11
|
On Wed, Feb 8, 2012 at 8:42 AM, David Craig <dcd...@gm...> wrote: Hi, I have a plot of a time series and I would like to add a single > extra tick mark and label to the plot in a different color to the > already existing tick marks. Is this possible?? > Thanks, > It's fairly easy to do if you want to set the tick locations and labels youself (see http://matplotlib.sourceforge.net/users/artists.html near the end for an overview of the mpl containers like Tick and the attributes they contain). import matplotlib.pyplot as plt import numpy as np fig, ax = plt.subplots(1) ax.plot(np.random.randn(10,2)*10) locs = np.arange(2, 10, 2) labels = ['%d'%loc for loc in locs] ticks, labels = plt.xticks(locs, labels) i = 2 # tick1line and tick2line are matplotlib.lines.Line2D instances ticks[i].tick1line.set_color('red') ticks[i].tick2line.set_color('red') labels[i].set_color('red') plt.show() If you want to "add a tick" using the existing mpl auto tick locating and labeling infrastructure, it is also possible but you will need to subclass the tick locator. JDH |
|
From: Ted To <rai...@th...> - 2012-02-08 15:42:24
|
I believe I have traced it to some axhline and axis commands and this is apparently an old problem. Does it work with version 1.1.0? I have 1.0.1 installed on a debian system. On 02/08/2012 09:47 AM, Ted To wrote: > Hi, > > I'm experiencing a very strange problem with plot_date that I can't > figure out. > > pyplot.plot_date(pylab.date2num(dates),diff,'b-',label='Chained') > pyplot.show() > > dates, naturally, is a list of dates and diff is an array of floats. > With my script, this fails. But if I interactively enter dates and diff > and then type the above commands, it works with no problems. Any ideas > or suggestions? > > The traceback follows. > > Thanks, > Ted > > Exception in Tkinter callback > Traceback (most recent call last): > File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__ > return self.func(*args) > File > "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", > line 245, in resize > self.show() > File > "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", > line 248, in draw > FigureCanvasAgg.draw(self) > File > "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line > 394, in draw > self.figure.draw(self.renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 55, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 798, in > draw > func(*args) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 55, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1946, in draw > a.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 55, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/lib/pymodules/python2.6/matplotlib/axis.py", line 971, in draw > tick_tups = [ t for t in self.iter_ticks()] > File "/usr/lib/pymodules/python2.6/matplotlib/axis.py", line 904, in > iter_ticks > majorLocs = self.major.locator() > File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 743, in > __call__ > self.refresh() > File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 752, in > refresh > dmin, dmax = self.viewlim_to_dt() > File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 524, in > viewlim_to_dt > return num2date(vmin, self.tz), num2date(vmax, self.tz) > File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 289, in > num2date > if not cbook.iterable(x): return _from_ordinalf(x, tz) > File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 203, in > _from_ordinalf > dt = datetime.datetime.fromordinal(ix) > ValueError: ordinal must be >= 1 > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Ted To <rai...@th...> - 2012-02-08 15:04:40
|
Hi,
I'm experiencing a very strange problem with plot_date that I can't
figure out.
pyplot.plot_date(pylab.date2num(dates),diff,'b-',label='Chained')
pyplot.show()
dates, naturally, is a list of dates and diff is an array of floats.
With my script, this fails. But if I interactively enter dates and diff
and then type the above commands, it works with no problems. Any ideas
or suggestions?
The traceback follows.
Thanks,
Ted
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
return self.func(*args)
File
"/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py",
line 245, in resize
self.show()
File
"/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py",
line 248, in draw
FigureCanvasAgg.draw(self)
File
"/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line
394, in draw
self.figure.draw(self.renderer)
File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 55, in
draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 798, in
draw
func(*args)
File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 55, in
draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1946, in draw
a.draw(renderer)
File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 55, in
draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/matplotlib/axis.py", line 971, in draw
tick_tups = [ t for t in self.iter_ticks()]
File "/usr/lib/pymodules/python2.6/matplotlib/axis.py", line 904, in
iter_ticks
majorLocs = self.major.locator()
File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 743, in
__call__
self.refresh()
File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 752, in
refresh
dmin, dmax = self.viewlim_to_dt()
File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 524, in
viewlim_to_dt
return num2date(vmin, self.tz), num2date(vmax, self.tz)
File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 289, in
num2date
if not cbook.iterable(x): return _from_ordinalf(x, tz)
File "/usr/lib/pymodules/python2.6/matplotlib/dates.py", line 203, in
_from_ordinalf
dt = datetime.datetime.fromordinal(ix)
ValueError: ordinal must be >= 1
|
|
From: Jae-Joon L. <lee...@gm...> - 2012-02-08 14:52:49
|
What can be done with the current Matplotlib is to use the offset boxes. Here is a modified version of a code snippet from http://abitofpythonabitofastronomy.blogspot.com/2009/05/mpl-multicolor-text.html Regards, -JJ from matplotlib.offsetbox import HPacker, TextArea, AnnotationBbox f = figure(1) ax = f.add_subplot(111) txt1 = TextArea("A$^3$", textprops=dict(color="r", size=150)) txt2 = TextArea("gb", textprops=dict(color="k", size=150)) txt = HPacker(children=[txt1, txt2], align="baseline", pad=0, sep=0) bbox = AnnotationBbox(txt, xy=(0.5, 0.5), xycoords='data', frameon=False, box_alignment=(0.5, 0.5), # alignment center, center ) ax.add_artist(bbox) show() On Wed, Feb 8, 2012 at 7:44 AM, Yann Tambouret <yan...@bu...> wrote: > Along the lines of Mike's suggestion, I thought this could be done using > Latex. > > > I posted an answer on SO with an example of doing this, but it seems only to > work with postscript backend. Other backends override the color with the mpl > text color setting. > > Is there a way to prevent this override? For example don't try to use 'PS' > backend, and look at hte figure interactively. It defaults to black. > > http://stackoverflow.com/a/9185143/717357 > > -Yann > > > > > On Tue, Feb 7, 2012 at 4:46 PM, Paul Ivanov <piv...@gm...> wrote: >> >> Benjamin Root, on 2012-02-07 13:46, wrote: >> > Also, how deep should this rabbit hole go? I could imagine one could >> > want >> > this for title() and figtitle(). Maybe it would be best to implement >> > this >> > at the Text() constructor level? >> >> For this reason, I would discourage even implementing such >> functionality in the core of matplotlib. This functionality doesn't strike >> me >> as something that ought to be available everywhere by default - if someone >> needs it, they can implement it as follows: >> >> ----- >> import matplotlib.pyplot as plt >> from matplotlib import transforms >> >> def rainbow_text(x,y,ls,lc,**kw): >> """ >> Take a list of strings ``ls`` and colors ``lc`` and place them next to >> each >> other, with text ls[i] being shown in color lc[i]. >> >> This example shows how to do both vertical and horizontal text, and >> will >> pass all keyword arguments to plt.text, so you can set the font size, >> family, etc. >> """ >> t = plt.gca().transData >> fig = plt.gcf() >> plt.show() >> >> #horizontal version >> for s,c in zip(ls,lc): >> text = plt.text(x,y," "+s+" ",color=c, transform=t, **kw) >> text.draw(fig.canvas.get_renderer()) >> ex = text.get_window_extent() >> t = transforms.offset_copy(text._transform, x=ex.width, >> units='dots') >> >> #vertical version >> for s,c in zip(ls,lc): >> text = plt.text(x,y," "+s+" ",color=c, transform=t, >> rotation=90,va='bottom',ha='center',**kw) >> text.draw(fig.canvas.get_renderer()) >> ex = text.get_window_extent() >> t = transforms.offset_copy(text._transform, y=ex.height, >> units='dots') >> >> >> plt.figure() >> rainbow_text(0.5,0.5,"all unicorns poop rainbows ! ! !".split(), >> ['red', 'orange', 'brown', 'green', 'blue', 'purple', 'black'], >> size=40) >> >> best, >> -- >> Paul Ivanov >> 314 address only used for lists, off-list direct email at: >> http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 >> >> >> ------------------------------------------------------------------------------ >> Keep Your Developer Skills Current with LearnDevNow! >> The most comprehensive online learning library for Microsoft developers >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >> Metro Style Apps, more. Free future releases when you subscribe now! >> http://p.sf.net/sfu/learndevnow-d2d >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: David C. <dcd...@gm...> - 2012-02-08 14:42:32
|
Hi, I have a plot of a time series and I would like to add a single extra tick mark and label to the plot in a different color to the already existing tick marks. Is this possible?? Thanks, D |
|
From: Jason G. <jas...@cr...> - 2012-02-08 14:15:42
|
On 2/8/12 2:53 AM, Paul Ivanov wrote: > Patrick Marsh, on 2012-02-07 13:58, wrote: >> As I continue to mature as a Python person, I want to give back >> explicitly to the community that's given so much to me. The problem >> is, I don't know how. I'm intimidated by the awesomeness of what I see >> being done around me that I don't even know where to begin. How does >> one even begin to learn how to understand the deep intricacies of MPL, >> Numpy, and Scipy so that I'd begin to develop a comfort level that >> would allow me to begin to actively contribute? I know pretty much >> everyone on these listservs, including myself, is busy. (I'm in the >> midst of a 30-day PhD General Exam, and probably shouldn't even be >> reading the listservs and/or typing this email! *wink*) But if there >> are those out there that are willing to take a little time and invest >> in me, and I'm sure there are others like me, I'd gladly become an >> active contributor instead of a lurker. > > One simple, minimally intimidating way to contribute is by making > improvements to the documentation. Here's a relevant pitch I just > made on the IPython lists about how easy, yet valuable such > improvements can be. > > http://mail.scipy.org/pipermail/ipython-user/2012-February/009428.html > > Another would be to send the colleagues whom your helping here to > these lists, that way any effort you put in to help them has a > good chance of helping others, thanks to search engines and > archives. > > Yet another would be to go through some the active issues on the > tracker and trying to make a test for them. > > Yet another still would be to test the various active pull > requests - and confirm that the fixes or new functionality they > provide actually work - look through patches and ask questions - > we have a lot PRs that get very few eyes or comments on them > (Last [academic] year, I consciously made an effort to be more > active on this list, and though I haven't pitched in as much > lately, perhaps the rest of this year I should focus my efforts > on incoming PRs) Another big way we've seen new people contribute to the Sage community is to answer questions on the ask.sagemath.org site. Scipy has a similar ask.scipy.org site, but it seems relatively quiet. Jason |
|
From: Paul I. <piv...@gm...> - 2012-02-08 08:54:02
|
Patrick Marsh, on 2012-02-07 13:58, wrote: > As I continue to mature as a Python person, I want to give back > explicitly to the community that's given so much to me. The problem > is, I don't know how. I'm intimidated by the awesomeness of what I see > being done around me that I don't even know where to begin. How does > one even begin to learn how to understand the deep intricacies of MPL, > Numpy, and Scipy so that I'd begin to develop a comfort level that > would allow me to begin to actively contribute? I know pretty much > everyone on these listservs, including myself, is busy. (I'm in the > midst of a 30-day PhD General Exam, and probably shouldn't even be > reading the listservs and/or typing this email! *wink*) But if there > are those out there that are willing to take a little time and invest > in me, and I'm sure there are others like me, I'd gladly become an > active contributor instead of a lurker. One simple, minimally intimidating way to contribute is by making improvements to the documentation. Here's a relevant pitch I just made on the IPython lists about how easy, yet valuable such improvements can be. http://mail.scipy.org/pipermail/ipython-user/2012-February/009428.html Another would be to send the colleagues whom your helping here to these lists, that way any effort you put in to help them has a good chance of helping others, thanks to search engines and archives. Yet another would be to go through some the active issues on the tracker and trying to make a test for them. Yet another still would be to test the various active pull requests - and confirm that the fixes or new functionality they provide actually work - look through patches and ask questions - we have a lot PRs that get very few eyes or comments on them (Last [academic] year, I consciously made an effort to be more active on this list, and though I haven't pitched in as much lately, perhaps the rest of this year I should focus my efforts on incoming PRs) > Anyways, I know this email is a tad on the long side, and a little off > the original topic, so if you're still reading, thanks! This is > something that's been weighing on me for a few months now, and I > thought Ben's exultation of the benefits of the community might be a > good time to open up. I'm still rather enjoying this whole thread, thanks for opening up. I got worried how relatively quiet it's been here for a few months, and glad we're starting to buck that trend. best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 |
|
From: Yann T. <yan...@bu...> - 2012-02-07 22:45:22
|
Along the lines of Mike's suggestion, I thought this could be done using Latex. I posted an answer on SO with an example of doing this, but it seems only to work with postscript backend. Other backends override the color with the mpl text color setting. Is there a way to prevent this override? For example don't try to use 'PS' backend, and look at hte figure interactively. It defaults to black. http://stackoverflow.com/a/9185143/717357 -Yann On Tue, Feb 7, 2012 at 4:46 PM, Paul Ivanov <piv...@gm...> wrote: > Benjamin Root, on 2012-02-07 13:46, wrote: > > Also, how deep should this rabbit hole go? I could imagine one could > want > > this for title() and figtitle(). Maybe it would be best to implement > this > > at the Text() constructor level? > > For this reason, I would discourage even implementing such > functionality in the core of matplotlib. This functionality doesn't strike > me > as something that ought to be available everywhere by default - if someone > needs it, they can implement it as follows: > > ----- > import matplotlib.pyplot as plt > from matplotlib import transforms > > def rainbow_text(x,y,ls,lc,**kw): > """ > Take a list of strings ``ls`` and colors ``lc`` and place them next to > each > other, with text ls[i] being shown in color lc[i]. > > This example shows how to do both vertical and horizontal text, and will > pass all keyword arguments to plt.text, so you can set the font size, > family, etc. > """ > t = plt.gca().transData > fig = plt.gcf() > plt.show() > > #horizontal version > for s,c in zip(ls,lc): > text = plt.text(x,y," "+s+" ",color=c, transform=t, **kw) > text.draw(fig.canvas.get_renderer()) > ex = text.get_window_extent() > t = transforms.offset_copy(text._transform, x=ex.width, > units='dots') > > #vertical version > for s,c in zip(ls,lc): > text = plt.text(x,y," "+s+" ",color=c, transform=t, > rotation=90,va='bottom',ha='center',**kw) > text.draw(fig.canvas.get_renderer()) > ex = text.get_window_extent() > t = transforms.offset_copy(text._transform, y=ex.height, > units='dots') > > > plt.figure() > rainbow_text(0.5,0.5,"all unicorns poop rainbows ! ! !".split(), > ['red', 'orange', 'brown', 'green', 'blue', 'purple', 'black'], > size=40) > > best, > -- > Paul Ivanov > 314 address only used for lists, off-list direct email at: > http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Paul I. <piv...@gm...> - 2012-02-07 21:47:02
|
Benjamin Root, on 2012-02-07 13:46, wrote:
> Also, how deep should this rabbit hole go? I could imagine one could want
> this for title() and figtitle(). Maybe it would be best to implement this
> at the Text() constructor level?
For this reason, I would discourage even implementing such
functionality in the core of matplotlib. This functionality doesn't strike me
as something that ought to be available everywhere by default - if someone
needs it, they can implement it as follows:
-----
import matplotlib.pyplot as plt
from matplotlib import transforms
def rainbow_text(x,y,ls,lc,**kw):
"""
Take a list of strings ``ls`` and colors ``lc`` and place them next to each
other, with text ls[i] being shown in color lc[i].
This example shows how to do both vertical and horizontal text, and will
pass all keyword arguments to plt.text, so you can set the font size,
family, etc.
"""
t = plt.gca().transData
fig = plt.gcf()
plt.show()
#horizontal version
for s,c in zip(ls,lc):
text = plt.text(x,y," "+s+" ",color=c, transform=t, **kw)
text.draw(fig.canvas.get_renderer())
ex = text.get_window_extent()
t = transforms.offset_copy(text._transform, x=ex.width, units='dots')
#vertical version
for s,c in zip(ls,lc):
text = plt.text(x,y," "+s+" ",color=c, transform=t,
rotation=90,va='bottom',ha='center',**kw)
text.draw(fig.canvas.get_renderer())
ex = text.get_window_extent()
t = transforms.offset_copy(text._transform, y=ex.height, units='dots')
plt.figure()
rainbow_text(0.5,0.5,"all unicorns poop rainbows ! ! !".split(),
['red', 'orange', 'brown', 'green', 'blue', 'purple', 'black'],
size=40)
best,
--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
|
|
From: Jason G. <jas...@cr...> - 2012-02-07 21:21:52
|
On 2/7/12 2:47 PM, Michael Droettboom wrote: > since this would never be full-fledged HTML anyway [1]. Famous last words, right? I'm curious: for the SVG backend, or a possible html5 canvas backend, can we already include html? I don't know, but I'm curious. Jason |
|
From: Michael D. <md...@st...> - 2012-02-07 20:49:11
|
In the past, I've thought having some sort of "HTML-lite" subset would
be the most powerful here. So one could do:
title("This is <b>bold</b>")
Strictly speaking, for colors, one would do:
title("This is <font color='red'>red</font>")
but that's awfully verbose. I wouldn't have a problem fudging the spec
and supporting:
title("This is <red>red</red>")
since this would never be full-fledged HTML anyway [1].
The advantage of this approach over any of the list-based ones is that
different properties can be nested, and I think most people understand
the basics of HTML/XML tags.
And I agree with Benjamin, that this should be at the Text() constructor
level so it works everywhere. I envision it being a sort of peer text
parser just as the mathtext parser is now -- in fact a lot of the
mathtext machinery would be reused.
[1] Of course, I've also considered using something like PythonWebKit to
render text for us -- the advantage being we'd also get proper bidi and
other internationalization features. But (a) WebKit is another honking
dependency and (b) I'm not sure the Python bindings are ready for prime
time.
Mike
On 02/07/2012 02:46 PM, Benjamin Root wrote:
>
>
> On Tue, Feb 7, 2012 at 1:15 PM, Gökhan Sever <gok...@gm...
> <mailto:gok...@gm...>> wrote:
>
> I was basing my whitespace split idea on single string assumption
> --eg. no list passing.
>
> I do not have a strong preference on the final argument passing,
> as long as it works instead of manually placing the texts on
> figure or axis :)
>
>
>
> On Tue, Feb 7, 2012 at 11:52 AM, Ryan May <rm...@gm...
> <mailto:rm...@gm...>> wrote:
>
> On Tue, Feb 7, 2012 at 12:49 PM, Gökhan Sever
> <gok...@gm... <mailto:gok...@gm...>> wrote:
> > This works as well, as long as it functions :)
> >
> > My idea requires little less typing. But forgot previously,
> text string
> > should be whitespace split.
>
> Right, but we shouldn't guess. If we automatically split on
> whitespace, this becomes harder:
>
> plt.ylabel(["The sun is", "yellow"], ['k', 'y'])
>
> Ryan
>
>
> I think the python mantra of "explicit over implicit" should be
> followed here. I don't think we currently allow list of strings, so
> there is no risk of breaking existing scripts, I think. We probably
> should confirm that just in case.
>
> Also, how deep should this rabbit hole go? I could imagine one could
> want this for title() and figtitle(). Maybe it would be best to
> implement this at the Text() constructor level?
>
> Ben Root
>
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Gökhan S. <gok...@gm...> - 2012-02-07 20:41:47
|
On Tue, Feb 7, 2012 at 12:46 PM, Benjamin Root <ben...@ou...> wrote: > > > On Tue, Feb 7, 2012 at 1:15 PM, Gökhan Sever <gok...@gm...>wrote: > >> I was basing my whitespace split idea on single string assumption --eg. >> no list passing. >> >> I do not have a strong preference on the final argument passing, as long >> as it works instead of manually placing the texts on figure or axis :) >> >> >> >> On Tue, Feb 7, 2012 at 11:52 AM, Ryan May <rm...@gm...> wrote: >> >>> On Tue, Feb 7, 2012 at 12:49 PM, Gökhan Sever <gok...@gm...> >>> wrote: >>> > This works as well, as long as it functions :) >>> > >>> > My idea requires little less typing. But forgot previously, text string >>> > should be whitespace split. >>> >>> Right, but we shouldn't guess. If we automatically split on >>> whitespace, this becomes harder: >>> >>> plt.ylabel(["The sun is", "yellow"], ['k', 'y']) >>> >>> Ryan >>> >>> > I think the python mantra of "explicit over implicit" should be followed > here. I don't think we currently allow list of strings, so there is no > risk of breaking existing scripts, I think. We probably should confirm > that just in case. > > Fair enough. > Also, how deep should this rabbit hole go? I could imagine one could want > this for title() and figtitle(). Maybe it would be best to implement this > at the Text() constructor level? > ylabel text coloring works for me for the time being. However, a general implementation would possibly fulfill other incoming requests. > > Ben Root > > -- Gökhan |
|
From: Patrick M. <pat...@gm...> - 2012-02-07 19:59:08
|
Congratulations, Ben! That's an awesome story! I am by no means at the level of competence that Ben (or Ryan May, another matplotlib contributor and meteorology PhD student at OU) but have been able to turn what I've learned from lurking on the MPL listserv (as well as the Numpy/Scipy listservs) into an improved lot in life. By no means is it a permanent job, but based on what I've learned from everyone here, I was able to land what amounts to a Post-Doc position with the National Severe Storms Laboratory, while I work toward finishing my PhD. It's so much so that I spend more of my time actually helping solve other's MPL/Numpy/Scipy problems than I do working on my own stuff! I'll admit there are times where I think to myself I should be more selfish and focus on finishing my degree, but I believe that I owe it to the community to give back, even if it is off-list. My knowledge is a product of your knowledge and thus I believe I'm obligated to share it with those around me who lack it, but desperately need it. I have to admit, when I first came to the world of Python (from Java and C), I was amazed at the tools readily available --- the matplotlib, numpy, and scipys of the community. Specific to MPL, I thought it was the greatest thing ever. I did all of my plotting with it. However, as I got into more advanced Python programming and needed more complex examples, I became frustrated and discouraged that I couldn't do exactly what I wanted. So much so, that I temporarily switched to R and the use of the ggplot2 package. However, as I continued to advance I learned the beauty of matplotlib and realized just how powerful it actually was. I began to see how to do all the things I couldn't do before. It's powerful enough that I'm forcing those around me to switch to Python and MPL, not because I'm telling them they have to, but because they see what I'm doing with it and realize that in order to keep up, they need to make the switch. As I continue to mature as a Python person, I want to give back explicitly to the community that's given so much to me. The problem is, I don't know how. I'm intimidated by the awesomeness of what I see being done around me that I don't even know where to begin. How does one even begin to learn how to understand the deep intricacies of MPL, Numpy, and Scipy so that I'd begin to develop a comfort level that would allow me to begin to actively contribute? I know pretty much everyone on these listservs, including myself, is busy. (I'm in the midst of a 30-day PhD General Exam, and probably shouldn't even be reading the listservs and/or typing this email! *wink*) But if there are those out there that are willing to take a little time and invest in me, and I'm sure there are others like me, I'd gladly become an active contributor instead of a lurker. Anyways, I know this email is a tad on the long side, and a little off the original topic, so if you're still reading, thanks! This is something that's been weighing on me for a few months now, and I thought Ben's exultation of the benefits of the community might be a good time to open up. Cheers, Patrick --- Patrick Marsh Ph.D. Student / Liaison to the HWT School of Meteorology / University of Oklahoma Cooperative Institute for Mesoscale Meteorological Studies National Severe Storms Laboratory http://www.patricktmarsh.com On Tue, Feb 7, 2012 at 11:19 AM, Fernando Perez <fpe...@gm...> wrote: > On Tue, Feb 7, 2012 at 9:02 AM, Ethan Gutmann <eth...@gm...> wrote: >> >> Also, congrats Ben, both on finishing the PhD and on the job. If you ever find yourself in Boulder, CO (I'm at NCAR), let me know and I'll buy you a drink. > > Indeed, congrats to Ben! And I'm very glad to see your many > contributions to the project finding acknowledgment and long-term > benefits for you. > > BTW Ethan, it's been a few years since the last time that John Hunter > and I lectured at NCAR (Dec. 2007), but in early April Min > Ragan-Kelley and I will be teaching at a workshop at CU, focusing on > data analysis with the 'scipy stack' and ipython's parallel machinery. > This will be in the context of a genomics workshop on campus, but if > you are interested we might be able to meet up with some of the python > crowd at NCAR... > > Just let me know if you are interested; best to write to > fer...@be..., as I sometimes stop monitoring mailing > lists if I get swamped. > > Cheers, > > f > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Benjamin R. <ben...@ou...> - 2012-02-07 19:47:09
|
On Tue, Feb 7, 2012 at 1:15 PM, Gökhan Sever <gok...@gm...> wrote: > I was basing my whitespace split idea on single string assumption --eg. no > list passing. > > I do not have a strong preference on the final argument passing, as long > as it works instead of manually placing the texts on figure or axis :) > > > > On Tue, Feb 7, 2012 at 11:52 AM, Ryan May <rm...@gm...> wrote: > >> On Tue, Feb 7, 2012 at 12:49 PM, Gökhan Sever <gok...@gm...> >> wrote: >> > This works as well, as long as it functions :) >> > >> > My idea requires little less typing. But forgot previously, text string >> > should be whitespace split. >> >> Right, but we shouldn't guess. If we automatically split on >> whitespace, this becomes harder: >> >> plt.ylabel(["The sun is", "yellow"], ['k', 'y']) >> >> Ryan >> >> I think the python mantra of "explicit over implicit" should be followed here. I don't think we currently allow list of strings, so there is no risk of breaking existing scripts, I think. We probably should confirm that just in case. Also, how deep should this rabbit hole go? I could imagine one could want this for title() and figtitle(). Maybe it would be best to implement this at the Text() constructor level? Ben Root |
|
From: Tony Yu <ts...@gm...> - 2012-02-07 19:25:38
|
On Tue, Feb 7, 2012 at 1:01 PM, Martin Mokrejs
<mmo...@fo...>wrote:
> Hi,
> I would like to create a bar chart like the attached example but with the
> addition
> that each bar would have a different color. I tried to learn this from the
> examples
> on matplotlib web but still do not see a close example for that. ;-)
> many thanks,
> Martin
>
>
Here's an example that does what you want (I think). There may be a better
way of setting the colors of the bars, but I don't use bar plots very often.
Hope that helps,
-Tony
import numpy as np
import matplotlib.pyplot as plt
colorcycle = ['red',
'steelblue',
'gold',
'darkorchid',
'yellowgreen',
'darkorange',
'silver',
'darkturquoise',
'hotpink',
'mediumblue']
yy = np.random.uniform(5, 200, size=10).astype(int)
xx = range(len(yy))
width = 0.5
bars = plt.bar(xx, yy, width=width)
# add bar labels
for x, y in zip(xx, yy):
plt.text(x + 0.5*width, y, str(y), ha='center', va='bottom')
# change color of bars
for b, c in zip(bars, colorcycle):
b.set_color(c)
plt.show()
|
|
From: Gökhan S. <gok...@gm...> - 2012-02-07 19:16:03
|
I was basing my whitespace split idea on single string assumption --eg. no list passing. I do not have a strong preference on the final argument passing, as long as it works instead of manually placing the texts on figure or axis :) On Tue, Feb 7, 2012 at 11:52 AM, Ryan May <rm...@gm...> wrote: > On Tue, Feb 7, 2012 at 12:49 PM, Gökhan Sever <gok...@gm...> > wrote: > > This works as well, as long as it functions :) > > > > My idea requires little less typing. But forgot previously, text string > > should be whitespace split. > > Right, but we shouldn't guess. If we automatically split on > whitespace, this becomes harder: > > plt.ylabel(["The sun is", "yellow"], ['k', 'y']) > > Ryan > > -- > Ryan May > Graduate Research Assistant > School of Meteorology > University of Oklahoma > -- Gökhan |
|
From: Ryan M. <rm...@gm...> - 2012-02-07 18:53:01
|
On Tue, Feb 7, 2012 at 12:49 PM, Gökhan Sever <gok...@gm...> wrote: > This works as well, as long as it functions :) > > My idea requires little less typing. But forgot previously, text string > should be whitespace split. Right, but we shouldn't guess. If we automatically split on whitespace, this becomes harder: plt.ylabel(["The sun is", "yellow"], ['k', 'y']) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: Gökhan S. <gok...@gm...> - 2012-02-07 18:49:13
|
This works as well, as long as it functions :) My idea requires little less typing. But forgot previously, text string should be whitespace split. On Tue, Feb 7, 2012 at 11:43 AM, Benjamin Root <ben...@ou...> wrote: > > > On Tue, Feb 7, 2012 at 12:38 PM, Gökhan Sever <gok...@gm...>wrote: > >> Posted at https://github.com/matplotlib/matplotlib/issues/697 >> >> I think a syntax like: >> >> plt.ylabel("Sun is shining.", color='rgb') >> >> would be a good start. (Assuming len of string == len of colors) >> >> > Don't know if I like that. It becomes even more difficult to convert the > color spec into rgb. How about this? > > plt.ylabel(['Sun", "is", "shining"], color=['r', 'g', 'b']) > > By having the input label be an array, that would force ylabel to > recognize that the color sequence should also be treated similarly. > > Ben Root > > -- Gökhan |
|
From: Benjamin R. <ben...@ou...> - 2012-02-07 18:43:40
|
On Tue, Feb 7, 2012 at 12:38 PM, Gökhan Sever <gok...@gm...> wrote: > Posted at https://github.com/matplotlib/matplotlib/issues/697 > > I think a syntax like: > > plt.ylabel("Sun is shining.", color='rgb') > > would be a good start. (Assuming len of string == len of colors) > > Don't know if I like that. It becomes even more difficult to convert the color spec into rgb. How about this? plt.ylabel(['Sun", "is", "shining"], color=['r', 'g', 'b']) By having the input label be an array, that would force ylabel to recognize that the color sequence should also be treated similarly. Ben Root |
|
From: Gökhan S. <gok...@gm...> - 2012-02-07 18:38:53
|
Posted at https://github.com/matplotlib/matplotlib/issues/697 I think a syntax like: plt.ylabel("Sun is shining.", color='rgb') would be a good start. (Assuming len of string == len of colors) On Tue, Feb 7, 2012 at 11:18 AM, Michael Droettboom <md...@st...> wrote: > Nope. But it's something I've wanted to add for a while. Can you file > an Issue in the github tracker? > > Mike > > > On 02/07/2012 11:40 AM, Gökhan Sever wrote: > > Is there a way in matplotlib to partially specify the color of a string? > > Example: > > plt.ylabel("Today is cloudy.") > How can I show "today" as red, "is" as green and "cloudy." as blue? > > Thanks. > > PS: Asked also on > http://stackoverflow.com/questions/9169052/partial-coloring-of-text-in-matplotlib > > -- > Gökhan > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now!http://p.sf.net/sfu/learndevnow-d2d > > > > _______________________________________________ > Matplotlib-users mailing lis...@li...://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Gökhan |
|
From: Benjamin R. <ben...@ou...> - 2012-02-07 18:33:57
|
On Tue, Feb 7, 2012 at 12:30 PM, Mark Janikas <mja...@es...> wrote: > I downloaded DejaVu Sans and pointed to that ttf file, and no love L… > Again, the default font seems to work for English, French, German, Spanish, > Italian other Euros etal… but Chinese and Arabic either come out blank > (default font, DejaVu Sans) or choke on the glyphs (MS Unicode). **** > > ** ** > > MJ**** > > ** > Just a quick sanity check, does everything work properly if you render to the screen or to a PNG file? What about EPS? Ben Root |
|
From: Mark J. <mja...@es...> - 2012-02-07 18:30:29
|
I downloaded DejaVu Sans and pointed to that ttf file, and no love :(... Again, the default font seems to work for English, French, German, Spanish, Italian other Euros etal... but Chinese and Arabic either come out blank (default font, DejaVu Sans) or choke on the glyphs (MS Unicode).
MJ
From: Michael Droettboom [mailto:md...@st...]
Sent: Tuesday, February 07, 2012 6:56 AM
To: mat...@li...
Subject: Re: [Matplotlib-users] rendering unicode using the PDF backend
It looks like perhaps we'll need to "synthesize" glyph names if they aren't provided in the font (though it's not clear to me why they are not). This will be difficult to test for, as that's a proprietary font. Have you tried using another Unicode font, such as DejaVu Sans?
Mike
On 02/06/2012 06:53 PM, Mark Janikas wrote:
Hi All,
I am having trouble rendering my Unicode strings in matplotlib using the PDF backend. When I use certain fonts (like the Win 7 default), I get no complaints but the characters are not rendered.... When I use a font like Arial Unicode MS, that I know contains all the chars, then I get the error message below. I did in fact, find a tty file that would work with Chinese ("Microsoft YaHei"), but I would like to avoid trying to map font files to languages. Any info on this subject would be greatly appreciated. Here is a snippet that reproduces the error below... if you remove the fontproperties option to the PYLAB.xlabel() call then the error is avoided but the result is not rendered. Thanks so much!
MJ
import matplotlib.pyplot as PLT
import pylab as PYLAB
from matplotlib.backends.backend_pdf import PdfPages as PDF
import matplotlib.font_manager as fm
fontFile = r'C:\Windows\Fonts\ARIALUNI.TTF'
fp1 = fm.FontProperties(fname=fontFile)
reportFile = r'C:\Temp\TestUnicode.pdf'
pdfOutput = PDF(reportFile)
vals = range(100)
PLT.plot(vals, vals, color = "r", linestyle = "-")
mess = u'\u6B63\u5728\u8BFB\u53D6\u6570\u636E...'
PYLAB.xlabel(mess, fontproperties = fp1)
PLT.savefig(pdfOutput, format='pdf')
PLT.close()
pdfOutput.close()
Traceback (most recent call last):
File "C:\Data\CRs\10.1\MemLeak\matplotlib\Scripts\matplotlib_unicode.py", line 27, in <module>
PLT.savefig(pdfOutput, format='pdf')
File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 472, in savefig
return fig.savefig(*args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 1173, in savefig
self.canvas.print_figure(*args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line 2027, in print_figure
**kwargs)
File "C:\Python27\lib\site-packages\matplotlib\backends\backend_pdf.py", line 2181, in print_pdf
self.figure.draw(renderer)
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 886, in draw
func(*args)
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 1983, in draw
a.draw(renderer)
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 1054, in draw
self.label.draw(renderer)
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\text.py", line 587, in draw
ismath=ismath)
File "C:\Python27\lib\site-packages\matplotlib\backends\backend_pdf.py", line 1784, in draw_text
return draw_text_woven(chunks)
File "C:\Python27\lib\site-packages\matplotlib\backends\backend_pdf.py", line 1754, in draw_text_woven
glyph_name = font.get_glyph_name(gind)
RuntimeError: Face has no glyph names
PS. I cannot use a different backend.
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Matplotlib-users mailing list
Mat...@li...<mailto:Mat...@li...>
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Michael D. <md...@st...> - 2012-02-07 18:18:59
|
Nope. But it's something I've wanted to add for a while. Can you file
an Issue in the github tracker?
Mike
On 02/07/2012 11:40 AM, Gökhan Sever wrote:
> Is there a way in matplotlib to partially specify the color of a string?
>
> Example:
>
> plt.ylabel("Today is cloudy.")
> How can I show "today" as red, "is" as green and "cloudy." as blue?
>
> Thanks.
>
> PS: Asked also on
> http://stackoverflow.com/questions/9169052/partial-coloring-of-text-in-matplotlib
>
> --
> Gökhan
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Martin M. <mmo...@fo...> - 2012-02-07 18:01:21
|
Hi, I would like to create a bar chart like the attached example but with the addition that each bar would have a different color. I tried to learn this from the examples on matplotlib web but still do not see a close example for that. ;-) many thanks, Martin |