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
|
2
|
3
(6) |
4
(2) |
5
(7) |
6
(9) |
7
(8) |
8
(1) |
9
(1) |
10
(1) |
11
(11) |
12
(1) |
13
(11) |
14
(7) |
15
(1) |
16
|
17
|
18
(1) |
19
|
20
(1) |
21
(2) |
22
(1) |
23
(1) |
24
(2) |
25
(3) |
26
(2) |
27
(2) |
28
(2) |
29
(5) |
30
(1) |
|
|
|
|
|
|
From: mgurling <mag...@gm...> - 2013-06-11 02:15:01
|
That looks like exactly what I am looking for. Thanks JJ. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/black-and-hatched-legend-handle-tp40979p41247.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Eric F. <ef...@ha...> - 2013-06-11 01:12:42
|
On 2013/06/10 2:08 PM, Sudheer Joseph wrote: > > Thank you, > So there is no way to get J F M A etc with out reducing font size? We > often need to make presentation in front of senior people who insist for > bigger fonts. > With best regards, > Sudheer One way is to subclass DateFormatter, e.g., class MonthLetter(DateFormatter): def __init__(self): DateFormatter.__init__(self, "%b") def __call__(*args): s = DateFormatter.__call__(*args) return s[:1] class MonthLetterYear(DateFormatter): def __init__(self): DateFormatter.__init__(self, "%b\n%Y") def __call__(*args): s = DateFormatter.__call__(*args) return = s[:1] + s[3:] ... majorFmt = MonthLetterYear() minorFmt = MonthLetter() Not tested, but something like that should work. Eric > > > ------------------------------------------------------------------------ > *From: * Paul Hobson <pmh...@gm...>; > *To: * Sudheer Joseph <sud...@ya...>; > *Cc: * mat...@li... > <mat...@li...>; > *Subject: * Re: [Matplotlib-users] time axis format > *Sent: * Mon, Jun 10, 2013 8:08:18 PM > > In that case, I would use ax.tick_params(...) to make the font smaller. > > > On Sat, Jun 8, 2013 at 7:36 AM, Sudheer Joseph <sud...@ya... > <javascript:return>> wrote: > > Dear Paul, > The issue I am facing is like in the attached plot > where the month naming get cluttered. > with best regards, > Sudheer > *************************************************************** > Sudheer Joseph > Indian National Centre for Ocean Information Services > Ministry of Earth Sciences, Govt. of India > POST BOX NO: 21, IDA Jeedeemetla P.O. > Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 > Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), > Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) > E-mail:sjo...@gm... > <javascript:return>;sud...@ya... <javascript:return> > Web- http://oppamthadathil.tripod.com > *************************************************************** > > ------------------------------------------------------------------------ > *From:* Sudheer Joseph <sud...@ya... > <javascript:return>> > *To:* Paul Hobson <pmh...@gm... <javascript:return>> > *Cc:* "mat...@li... > <javascript:return>" <mat...@li... > <javascript:return>> > *Sent:* Saturday, 8 June 2013 7:46 PM > > *Subject:* Re: [Matplotlib-users] time axis format > > Thank you Paul for the helping hand, > However I was looking for > slightly different solution like in the attached plots. I used > ferret to do this based on the length of the time axis it chose > the mode of labelling. for example in case of 2 year plot it > made month labeling as j f m etc and in case of 1 year as there > is enough space on x axis it made jan feb etc with single label > of year. > > In the attached python plot (ATser_RAMA_HYCOM_U_8n90e.png) every > tick point is lablled for year, which I wanted to avoid and get > plots similar to the first types thought it is not done > automatically but at least manually. > > > *************************************************************** > Sudheer Joseph > Indian National Centre for Ocean Information Services > Ministry of Earth Sciences, Govt. of India > POST BOX NO: 21, IDA Jeedeemetla P.O. > Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 > Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), > Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) > E-mail:sjo...@gm... > <javascript:return>;sud...@ya... <javascript:return> > Web- http://oppamthadathil.tripod.com > *************************************************************** > > ------------------------------------------------------------------------ > *From:* Paul Hobson <pmh...@gm... <javascript:return>> > *To:* Sudheer Joseph <sud...@ya... > <javascript:return>> > *Cc:* "mat...@li... > <javascript:return>" <mat...@li... > <javascript:return>> > *Sent:* Friday, 7 June 2013 8:50 PM > *Subject:* Re: [Matplotlib-users] time axis format > > > > > On Thu, Jun 6, 2013 at 11:39 PM, Sudheer Joseph > <sud...@ya... <javascript:return>> wrote: > > Dear Experts, > I have been experimenting with the > plot_dates option of matplotlib to plot time series data > and have below questions > > I have used > loc = mdates.AutoDateLocator() > ax.xaxis.set_major_locator(loc) > ax.xaxis.set_major_formatter(mpl.dates.DateFormatter('%b\n > %Y')) > > > and got the tick labels in attached plot > > However I feel the repeatd year labeling is not needed > here and it is required once in a year only , Also if I > need to plot long time seris insted of "MAR" "APR" I > wanted to get them reduced to "M" "A" etc so that the > lavel congestion can be avoided. > > > I notice that below options are available, but was > wondering how commbinatins of these locateors are used > ie mark every month and every year once each. > > > Is there a way to achive the above or does it need > further development? > > fmt = mdates.DateFormatter('%Y-%m-%d') > loc = > mdates.WeekdayLocator(byweekday=mdates.MONDAY,interval=4) > locator = mdates.YearLocator() > > > If I were trying to do this, I'd cobble something together > using by the minor and major formatters. > e.g.,... > import matplotlib.dates as mdates > import matplotlib.pyplot as plt > > fig, ax = plt.subplots() > > majorLocs = mdates.MonthLocator(bymonth[1,7]) > majorFmt = mdates.DateFormatter('%b\n%Y') > > minorLocs = mdates.MonthLocator(bymonth[1,7]) > minorFmt = mdates.DateFormatter('%b') > > ax.xaxis.set_major_locator(majorLocs) > ax.xaxis.set_major_formatter(majorFmt) > > ax.xaxis.set_minor_locator(minorLocs) > ax.xaxis.set_minor_formatter(minorFmt) > > > > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: C M <cmp...@gm...> - 2013-06-11 01:12:15
|
On Mon, Jun 10, 2013 at 8:08 PM, Sudheer Joseph <sud...@ya...>wrote: > > Thank you, > So there is no way to get J F M A etc with out reducing font size? > I bet there a number of ways. Offhand I don't know the one that, once I hear about it, I will say, "D'oh, that's so easy" but I bet it exists. But you could modify the DateFormatter class. It is set to return a strftime result string. Here is the function: def __call__(self, x, pos=0): if x==0: raise ValueError('DateFormatter found a value of x=0, which is an illegal date. This usually occurs because you have not informed the axis that it is plotting dates, eg with ax.xaxis_date()') dt = num2date(x, self.tz) return self.strftime(dt, self.fmt) All you would have to do is change that last line to: return self.strftime(dt, self.fmt)[0] To slice just the first letter of the month. So you could subclass DateFormatter to do this, since you probably don't want to modify the actual DateFormatter class always in this way. Also, aside from the J F M A approach, you could just rotate the month's name, and that will reduce crowding while keeping the month a little clearer (I think "JAN FEB MAR APR" is more intuitive and pleasant to read on a graph). Che > We often need to make presentation in front of senior people who insist > for bigger fonts. > With best regards, > Sudheer > > ------------------------------ > * From: * Paul Hobson <pmh...@gm...>; > * To: * Sudheer Joseph <sud...@ya...>; > * Cc: * mat...@li... < > mat...@li...>; > * Subject: * Re: [Matplotlib-users] time axis format > * Sent: * Mon, Jun 10, 2013 8:08:18 PM > > In that case, I would use ax.tick_params(...) to make the font smaller. > > > On Sat, Jun 8, 2013 at 7:36 AM, Sudheer Joseph <sud...@ya...>wrote: > >> Dear Paul, >> The issue I am facing is like in the attached plot where >> the month naming get cluttered. >> with best regards, >> Sudheer >> >> *************************************************************** >> Sudheer Joseph >> Indian National Centre for Ocean Information Services >> Ministry of Earth Sciences, Govt. of India >> POST BOX NO: 21, IDA Jeedeemetla P.O. >> Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 >> Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), >> Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) >> E-mail:sjo...@gm...;sud...@ya... >> Web- http://oppamthadathil.tripod.com >> *************************************************************** >> >> ------------------------------ >> *From:* Sudheer Joseph <sud...@ya...> >> *To:* Paul Hobson <pmh...@gm...> >> *Cc:* "mat...@li..." < >> mat...@li...> >> *Sent:* Saturday, 8 June 2013 7:46 PM >> >> *Subject:* Re: [Matplotlib-users] time axis format >> >> Thank you Paul for the helping hand, >> However I was looking for slightly >> different solution like in the attached plots. I used ferret to do this >> based on the length of the time axis it chose the mode of labelling. for >> example in case of 2 year plot it made month labeling as j f m etc and in >> case of 1 year as there is enough space on x axis it made jan feb etc with >> single label of year. >> >> In the attached python plot (ATser_RAMA_HYCOM_U_8n90e.png) every tick >> point is lablled for year, which I wanted to avoid and get plots similar to >> the first types thought it is not done automatically but at least manually. >> >> >> >> *************************************************************** >> Sudheer Joseph >> Indian National Centre for Ocean Information Services >> Ministry of Earth Sciences, Govt. of India >> POST BOX NO: 21, IDA Jeedeemetla P.O. >> Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 >> Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), >> Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) >> E-mail:sjo...@gm...;sud...@ya... >> Web- http://oppamthadathil.tripod.com >> *************************************************************** >> >> ------------------------------ >> *From:* Paul Hobson <pmh...@gm...> >> *To:* Sudheer Joseph <sud...@ya...> >> *Cc:* "mat...@li..." < >> mat...@li...> >> *Sent:* Friday, 7 June 2013 8:50 PM >> *Subject:* Re: [Matplotlib-users] time axis format >> >> >> >> >> On Thu, Jun 6, 2013 at 11:39 PM, Sudheer Joseph <sud...@ya... >> > wrote: >> >> Dear Experts, >> I have been experimenting with the plot_dates option of >> matplotlib to plot time series data and have below questions >> >> I have used >> loc = mdates.AutoDateLocator() >> ax.xaxis.set_major_locator(loc) >> ax.xaxis.set_major_formatter(mpl.dates.DateFormatter('%b\n %Y')) >> >> >> and got the tick labels in attached plot >> >> However I feel the repeatd year labeling is not needed here and it is >> required once in a year only , Also if I need to plot long time seris >> insted of "MAR" "APR" I wanted to get them reduced to "M" "A" etc so that >> the lavel congestion can be avoided. >> >> >> I notice that below options are available, but was wondering how >> commbinatins of these locateors are used ie mark every month and every year >> once each. >> >> >> Is there a way to achive the above or does it need further development? >> >> fmt = mdates.DateFormatter('%Y-%m-%d') >> loc = mdates.WeekdayLocator(byweekday=mdates.MONDAY,interval=4) >> locator = mdates.YearLocator() >> >> >> If I were trying to do this, I'd cobble something together using by the >> minor and major formatters. >> e.g.,... >> import matplotlib.dates as mdates >> import matplotlib.pyplot as plt >> >> fig, ax = plt.subplots() >> >> majorLocs = mdates.MonthLocator(bymonth[1,7]) >> majorFmt = mdates.DateFormatter('%b\n%Y') >> >> minorLocs = mdates.MonthLocator(bymonth[1,7]) >> minorFmt = mdates.DateFormatter('%b') >> >> ax.xaxis.set_major_locator(majorLocs) >> ax.xaxis.set_major_formatter(majorFmt) >> >> ax.xaxis.set_minor_locator(minorLocs) >> ax.xaxis.set_minor_formatter(minorFmt) >> >> >> >> >> > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Sudheer J. <sud...@ya...> - 2013-06-11 00:08:46
|
Thank you, So there is no way to get J F M A etc with out reducing font size? We often need to make presentation in front of senior people who insist for bigger fonts. With best regards, Sudheer |
From: Paul H. <pmh...@gm...> - 2013-06-10 20:08:26
|
In that case, I would use ax.tick_params(...) to make the font smaller. On Sat, Jun 8, 2013 at 7:36 AM, Sudheer Joseph <sud...@ya...>wrote: > Dear Paul, > The issue I am facing is like in the attached plot where > the month naming get cluttered. > with best regards, > Sudheer > > *************************************************************** > Sudheer Joseph > Indian National Centre for Ocean Information Services > Ministry of Earth Sciences, Govt. of India > POST BOX NO: 21, IDA Jeedeemetla P.O. > Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 > Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), > Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) > E-mail:sjo...@gm...;sud...@ya... > Web- http://oppamthadathil.tripod.com > *************************************************************** > > ------------------------------ > *From:* Sudheer Joseph <sud...@ya...> > *To:* Paul Hobson <pmh...@gm...> > *Cc:* "mat...@li..." < > mat...@li...> > *Sent:* Saturday, 8 June 2013 7:46 PM > > *Subject:* Re: [Matplotlib-users] time axis format > > Thank you Paul for the helping hand, > However I was looking for slightly > different solution like in the attached plots. I used ferret to do this > based on the length of the time axis it chose the mode of labelling. for > example in case of 2 year plot it made month labeling as j f m etc and in > case of 1 year as there is enough space on x axis it made jan feb etc with > single label of year. > > In the attached python plot (ATser_RAMA_HYCOM_U_8n90e.png) every tick > point is lablled for year, which I wanted to avoid and get plots similar to > the first types thought it is not done automatically but at least manually. > > > > *************************************************************** > Sudheer Joseph > Indian National Centre for Ocean Information Services > Ministry of Earth Sciences, Govt. of India > POST BOX NO: 21, IDA Jeedeemetla P.O. > Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 > Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), > Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) > E-mail:sjo...@gm...;sud...@ya... > Web- http://oppamthadathil.tripod.com > *************************************************************** > > ------------------------------ > *From:* Paul Hobson <pmh...@gm...> > *To:* Sudheer Joseph <sud...@ya...> > *Cc:* "mat...@li..." < > mat...@li...> > *Sent:* Friday, 7 June 2013 8:50 PM > *Subject:* Re: [Matplotlib-users] time axis format > > > > > On Thu, Jun 6, 2013 at 11:39 PM, Sudheer Joseph <sud...@ya...>wrote: > > Dear Experts, > I have been experimenting with the plot_dates option of > matplotlib to plot time series data and have below questions > > I have used > loc = mdates.AutoDateLocator() > ax.xaxis.set_major_locator(loc) > ax.xaxis.set_major_formatter(mpl.dates.DateFormatter('%b\n %Y')) > > > and got the tick labels in attached plot > > However I feel the repeatd year labeling is not needed here and it is > required once in a year only , Also if I need to plot long time seris > insted of "MAR" "APR" I wanted to get them reduced to "M" "A" etc so that > the lavel congestion can be avoided. > > > I notice that below options are available, but was wondering how > commbinatins of these locateors are used ie mark every month and every year > once each. > > > Is there a way to achive the above or does it need further development? > > fmt = mdates.DateFormatter('%Y-%m-%d') > loc = mdates.WeekdayLocator(byweekday=mdates.MONDAY,interval=4) > locator = mdates.YearLocator() > > > If I were trying to do this, I'd cobble something together using by the > minor and major formatters. > e.g.,... > import matplotlib.dates as mdates > import matplotlib.pyplot as plt > > fig, ax = plt.subplots() > > majorLocs = mdates.MonthLocator(bymonth[1,7]) > majorFmt = mdates.DateFormatter('%b\n%Y') > > minorLocs = mdates.MonthLocator(bymonth[1,7]) > minorFmt = mdates.DateFormatter('%b') > > ax.xaxis.set_major_locator(majorLocs) > ax.xaxis.set_major_formatter(majorFmt) > > ax.xaxis.set_minor_locator(minorLocs) > ax.xaxis.set_minor_formatter(minorFmt) > > > > > |
From: R. O'G. <ron...@ya...> - 2013-06-09 19:47:31
|
http://www.carvalhoadvogados.net/gvbhkzwumw.php |
From: Sudheer J. <sud...@ya...> - 2013-06-08 14:36:38
|
Dear Paul, The issue I am facing is like in the attached plot where the month naming get cluttered. with best regards, Sudheer *************************************************************** Sudheer Joseph Indian National Centre for Ocean Information Services Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) E-mail:sjo...@gm...;sud...@ya... Web- http://oppamthadathil.tripod.com *************************************************************** >________________________________ > From: Sudheer Joseph <sud...@ya...> >To: Paul Hobson <pmh...@gm...> >Cc: "mat...@li..." <mat...@li...> >Sent: Saturday, 8 June 2013 7:46 PM >Subject: Re: [Matplotlib-users] time axis format > > > >Thank you Paul for the helping hand, > However I was looking for slightly different solution like in the attached plots. I used ferret to do this based on the length of the time axis it chose the mode of labelling. for example in case of 2 year plot it made month labeling as j f m etc and in case of 1 year as there is enough space on x axis it made jan feb etc with single label of year. > >In the attached python plot (ATser_RAMA_HYCOM_U_8n90e.png) every tick point is lablled for year, which I wanted to avoid and get plots similar to the first types thought it is not done automatically but at least manually. > > > > > >*************************************************************** >Sudheer Joseph >Indian National Centre for Ocean Information Services >Ministry of Earth Sciences, Govt. of India >POST BOX NO: 21, IDA Jeedeemetla P.O. >Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 >Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), >Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) >E-mail:sjo...@gm...;sud...@ya... >Web- http://oppamthadathil.tripod.com >*************************************************************** > > >>________________________________ >> From: Paul Hobson <pmh...@gm...> >>To: Sudheer Joseph <sud...@ya...> >>Cc: "mat...@li..." <mat...@li...> >>Sent: Friday, 7 June 2013 8:50 PM >>Subject: Re: [Matplotlib-users] time axis format >> >> >> >> >> >> >> >> >>On Thu, Jun 6, 2013 at 11:39 PM, Sudheer Joseph <sud...@ya...> wrote: >> >>Dear Experts, >>> I have been experimenting with the plot_dates option of matplotlib to plot time series data and have below questions >>> >>> I have used >>>loc = mdates.AutoDateLocator() >>>ax.xaxis.set_major_locator(loc) >>>ax.xaxis.set_major_formatter(mpl.dates.DateFormatter('%b\n %Y')) >>> >>> >>>and got the tick labels in attached plot >>> >>>However I feel the repeatd year labeling is not needed here and it is required once in a year only , Also if I need to plot long time seris insted of "MAR" "APR" I wanted to get them reduced to "M" "A" etc so that the lavel congestion can be avoided. >>> >>> >>>I notice that below options are available, but was wondering how commbinatins of these locateors are used ie mark every month and every year once each. >>> >>> >>>Is there a way to achive the above or does it need further development? >>> >>>fmt = mdates.DateFormatter('%Y-%m-%d') >>>loc = mdates.WeekdayLocator(byweekday=mdates.MONDAY,interval=4) >>>locator = mdates.YearLocator() >>> >> >> >>If I were trying to do this, I'd cobble something together using by the minor and major formatters. >>e.g.,... >>import matplotlib.dates as mdates >>import matplotlib.pyplot as plt >> >> >>fig, ax = plt.subplots() >> >> >>majorLocs = mdates.MonthLocator(bymonth[1,7]) >>majorFmt = mdates.DateFormatter('%b\n%Y') >> >> >> >>minorLocs = mdates.MonthLocator(bymonth[1,7]) >>minorFmt = mdates.DateFormatter('%b') >> >> >> >>ax.xaxis.set_major_locator(majorLocs) >>ax.xaxis.set_major_formatter(majorFmt) >> >> >> >>ax.xaxis.set_minor_locator(minorLocs) >>ax.xaxis.set_minor_formatter(minorFmt) >> >> > > |
From: Yoshi R. <yo...@ro...> - 2013-06-07 20:16:56
|
Fr, 7 Jun 2013 10:13:26 -0400 Michael Droettboom <md...@st...>: > Have you tried setting ps.usedistiller to False, or xpdf? There have > been problems using Ghostscript as a distiller with recent versions > of Ghostscript. No, I didn't try. Thanks for the hint, I will test that. > We'll need a minimal example, or at least a copy of the PS file to > investigate this further, however. Also, what platform, version of > matplotlib and Python are you using? If I keep everything on my system linux with python 2.7.5 and matplotlib 1.2.1 it works fine. Problems arise if I move the EPS to an older system or the printing. I will have access to these machines on Tue. I will try to create a minimal example then. Best regards, Yoshi |
From: Eric F. <ef...@ha...> - 2013-06-07 19:59:55
|
Julien, See https://github.com/matplotlib/matplotlib/pull/2119 for a proposed fix. Eric |
From: Paul H. <pmh...@gm...> - 2013-06-07 15:20:09
|
On Thu, Jun 6, 2013 at 11:39 PM, Sudheer Joseph <sud...@ya...>wrote: > Dear Experts, > I have been experimenting with the plot_dates option of > matplotlib to plot time series data and have below questions > > I have used > loc = mdates.AutoDateLocator() > ax.xaxis.set_major_locator(loc) > ax.xaxis.set_major_formatter(mpl.dates.DateFormatter('%b\n %Y')) > > > and got the tick labels in attached plot > > However I feel the repeatd year labeling is not needed here and it is > required once in a year only , Also if I need to plot long time seris > insted of "MAR" "APR" I wanted to get them reduced to "M" "A" etc so that > the lavel congestion can be avoided. > > > I notice that below options are available, but was wondering how > commbinatins of these locateors are used ie mark every month and every year > once each. > > > Is there a way to achive the above or does it need further development? > > fmt = mdates.DateFormatter('%Y-%m-%d') > loc = mdates.WeekdayLocator(byweekday=mdates.MONDAY,interval=4) > locator = mdates.YearLocator() > If I were trying to do this, I'd cobble something together using by the minor and major formatters. e.g.,... import matplotlib.dates as mdates import matplotlib.pyplot as plt fig, ax = plt.subplots() majorLocs = mdates.MonthLocator(bymonth[1,7]) majorFmt = mdates.DateFormatter('%b\n%Y') minorLocs = mdates.MonthLocator(bymonth[1,7]) minorFmt = mdates.DateFormatter('%b') ax.xaxis.set_major_locator(majorLocs) ax.xaxis.set_major_formatter(majorFmt) ax.xaxis.set_minor_locator(minorLocs) ax.xaxis.set_minor_formatter(minorFmt) |
From: Michael D. <md...@st...> - 2013-06-07 14:13:59
|
On 06/07/2013 05:07 AM, Yoshi Rokuko wrote: > I'm having problems recently with printing EPS figures created by > matplotlib. To me this is strange because printing postscript should > just work in my opinion. > > My most recent example is a Basemap thing with AxesGrid. Basically the > idea was to have six maps nicely arranged on a DIN A4 paper for > printout. The EPS looked nice on my notebook but printing them on our > freshly leased printers at the institute failed in the middle of the > fifth map (six maps in total). I have Ghostscript 9.07 and it turned out > that this EPS stopped working with just one earlier version (a college > with Ghostscript 9.06 could not open the EPS or more correct Ghostview > failed in the middle of map number five). > > I expect such a Ghostscript version thing to be the problem also with > the printer. If that is the case don't you think that's ridiculous? > Isn't at least some legacy support wanted? Yes -- legacy support is of course intended... matplotlib has been going for over 10 years, after all, and we're very conservative about intentionally breaking legacy systems. Have you tried setting ps.usedistiller to False, or xpdf? There have been problems using Ghostscript as a distiller with recent versions of Ghostscript. We'll need a minimal example, or at least a copy of the PS file to investigate this further, however. Also, what platform, version of matplotlib and Python are you using? Mike > > I don't have a minimal example yet, but I could try to create one next > week if the need is there. The above mentioned thing was something > along the lines of: > > ... > import matplotlib.pyplot as pl > from mpl_toolkits.basemap import Basemap > from mpl_toolkits.axes_grid1 import AxesGrid > > # loading data > ... > > fig = pl.figure(1, (16,19)) > grid = AxesGrid(fig, 111, > nrows_ncols = (3, 2), > axes_pad = 0.3, > cbar_location = 'top', > cbar_mode = 'each', > cbar_size = '3%', > cbar_pad = '1%', > ) > for i in range(6): > bmap = Basemap(projection='aeqd', ..., ax=grid[i]) > ... > > pl.savefig('sixer.eps', bbox_inches='tight') > > Best regards, Yoshi > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Julien C. <jul...@gm...> - 2013-06-07 10:27:34
|
Thans a lot Eric for the fast and detailed answer! On Thu, Jun 6, 2013 at 9:24 PM, Eric Firing <ef...@ha...> wrote: > On 2013/06/06 2:08 AM, Julien Cornebise wrote: > > Dear all > > > > I am puzzled: in the following code, when I call clim() *after* having > > created 3 subplots, only the last subplot takes the new limits into > > account. All other subplots ignore it. Xlim(), on the countrary, works > > as intended. Everything works fine when I set the clim() at creation > time. > > I see what the problem is, so I expect to come up with a PR for it in a > day or two. > > In the meantime, as a workaround, change your clim() line to: > > plt.gca()._gci().set_clim((5,10)) > > Eric > > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Yoshi R. <yo...@ro...> - 2013-06-07 10:17:55
|
I'm having problems recently with printing EPS figures created by matplotlib. To me this is strange because printing postscript should just work in my opinion. My most recent example is a Basemap thing with AxesGrid. Basically the idea was to have six maps nicely arranged on a DIN A4 paper for printout. The EPS looked nice on my notebook but printing them on our freshly leased printers at the institute failed in the middle of the fifth map (six maps in total). I have Ghostscript 9.07 and it turned out that this EPS stopped working with just one earlier version (a college with Ghostscript 9.06 could not open the EPS or more correct Ghostview failed in the middle of map number five). I expect such a Ghostscript version thing to be the problem also with the printer. If that is the case don't you think that's ridiculous? Isn't at least some legacy support wanted? I don't have a minimal example yet, but I could try to create one next week if the need is there. The above mentioned thing was something along the lines of: ... import matplotlib.pyplot as pl from mpl_toolkits.basemap import Basemap from mpl_toolkits.axes_grid1 import AxesGrid # loading data ... fig = pl.figure(1, (16,19)) grid = AxesGrid(fig, 111, nrows_ncols = (3, 2), axes_pad = 0.3, cbar_location = 'top', cbar_mode = 'each', cbar_size = '3%', cbar_pad = '1%', ) for i in range(6): bmap = Basemap(projection='aeqd', ..., ax=grid[i]) ... pl.savefig('sixer.eps', bbox_inches='tight') Best regards, Yoshi |
From: Sudheer J. <sud...@ya...> - 2013-06-07 06:40:04
|
Dear Experts, I have been experimenting with the plot_dates option of matplotlib to plot time series data and have below questions I have used loc = mdates.AutoDateLocator() ax.xaxis.set_major_locator(loc) ax.xaxis.set_major_formatter(mpl.dates.DateFormatter('%b\n %Y')) and got the tick labels in attached plot However I feel the repeatd year labeling is not needed here and it is required once in a year only , Also if I need to plot long time seris insted of "MAR" "APR" I wanted to get them reduced to "M" "A" etc so that the lavel congestion can be avoided. I notice that below options are available, but was wondering how commbinatins of these locateors are used ie mark every month and every year once each. Is there a way to achive the above or does it need further development? fmt = mdates.DateFormatter('%Y-%m-%d') loc = mdates.WeekdayLocator(byweekday=mdates.MONDAY,interval=4) locator = mdates.YearLocator() with best regards, Sudheer *************************************************************** Sudheer Joseph Indian National Centre for Ocean Information Services Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) E-mail:sjo...@gm...;sud...@ya... Web- http://oppamthadathil.tripod.com *************************************************************** |
From: Michiel de H. <mjl...@ya...> - 2013-06-07 02:25:35
|
Thanks! Using pcolor indeed solved the problem. Now my rows and columns are all nice and even. Best, -Michiel. ________________________________ From: Benjamin Root <ben...@ou...> To: Michael Droettboom <md...@st...> Cc: Matplotlib Users <mat...@li...> Sent: Friday, June 7, 2013 1:40 AM Subject: Re: [Matplotlib-users] matshow unequal element sizes On Thu, Jun 6, 2013 at 10:14 AM, Michael Droettboom <md...@st...> wrote: By default (when interpolation="nearest") matplotlib is performing nearest neighbor interpolation on the image to the request PDF dpi before storing it in the file. This results in rows and columns of unequal size because the ratio from the original image to the destination resolution is likely not integral. > >You can set interpolation="none", which will pass the original image as-is on to the file, but then we can't control the interpolation mode (since there's no way to tell the PDF viewer what sort of interpolation to perform), so that (usually) will result in bicubic interpolation, which is probably not what you want. > >Mike > > From experience, it seems that pcolor() or pcolormesh() works best for pdf's because it saves the polygons. You might need some tweaking to get it exactly right, but at least the pdf viewer won't smudge it all out. Cheers! Ben Root ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Eric F. <ef...@ha...> - 2013-06-06 20:24:42
|
On 2013/06/06 2:08 AM, Julien Cornebise wrote: > Dear all > > I am puzzled: in the following code, when I call clim() *after* having > created 3 subplots, only the last subplot takes the new limits into > account. All other subplots ignore it. Xlim(), on the countrary, works > as intended. Everything works fine when I set the clim() at creation time. I see what the problem is, so I expect to come up with a PR for it in a day or two. In the meantime, as a workaround, change your clim() line to: plt.gca()._gci().set_clim((5,10)) Eric |
From: Eric F. <ef...@ha...> - 2013-06-06 19:57:56
|
On 2013/06/06 2:08 AM, Julien Cornebise wrote: > Dear all > > I am puzzled: in the following code, when I call clim() *after* having > created 3 subplots, only the last subplot takes the new limits into > account. All other subplots ignore it. Xlim(), on the countrary, works > as intended. Everything works fine when I set the clim() at creation time. > > Am I doing something wrong, or is this a bug, please ? Any help much > appreciated ! It's a bug. Would you report it as an issue on github, please? (You could wait 24 hours; if I come up with a PR for fix before then there will be no need for the issue report.) Eric > The offending code is below. I use python 2.7.5 > andmatplotlib-1.3.x-py2.7-macosx-10.8-intel.egg > > Thanks for any help! > > __BEGIN_SOURCE___ > > import matplotlib.pyplot as plt > import numpy as np > > x = np.asarray([[1, 100, 20], [50, 1, 20], [20, 10, 5]]) > > # Problem when setting clim *after* having created the two subplots: > # only the last subplot honors the request > > # 1. Create the pcolormeshes in subplots > h = plt.figure() > for i in range(131, 134): > plt.subplot(i) > plt.pcolormesh(x) > plt.colorbar() > print(h.number) > > # 2. Now set the clim() > plt.figure(h.number) > for i in range(131, 134): > plt.subplot(i) > plt.clim((5,10)) > plt.xlim((2,3)) > > plt.savefig('after_creation.png') > plt.show() > > # No problem when setting clim *while* creating each subplot > h = plt.figure() > for i in range(131, 134): > plt.subplot(i) > plt.pcolormesh(x) > plt.colorbar() > plt.clim((5,10)) > plt.xlim((2,3)) > > plt.savefig('while_creating.png') > plt.show() > > __END_SOURCE___ > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Benjamin R. <ben...@ou...> - 2013-06-06 16:41:01
|
On Thu, Jun 6, 2013 at 10:14 AM, Michael Droettboom <md...@st...> wrote: > By default (when interpolation="nearest") matplotlib is performing > nearest neighbor interpolation on the image to the request PDF dpi before > storing it in the file. This results in rows and columns of unequal size > because the ratio from the original image to the destination resolution is > likely not integral. > > You can set interpolation="none", which will pass the original image as-is > on to the file, but then we can't control the interpolation mode (since > there's no way to tell the PDF viewer what sort of interpolation to > perform), so that (usually) will result in bicubic interpolation, which is > probably not what you want. > > Mike > > >From experience, it seems that pcolor() or pcolormesh() works best for pdf's because it saves the polygons. You might need some tweaking to get it exactly right, but at least the pdf viewer won't smudge it all out. Cheers! Ben Root |
From: Michael D. <md...@st...> - 2013-06-06 14:14:28
|
By default (when interpolation="nearest") matplotlib is performing nearest neighbor interpolation on the image to the request PDF dpi before storing it in the file. This results in rows and columns of unequal size because the ratio from the original image to the destination resolution is likely not integral. You can set interpolation="none", which will pass the original image as-is on to the file, but then we can't control the interpolation mode (since there's no way to tell the PDF viewer what sort of interpolation to perform), so that (usually) will result in bicubic interpolation, which is probably not what you want. Mike On 06/06/2013 05:52 AM, Michiel de Hoon wrote: > Hi all, > > I am trying to draw a heatmap using matshow, which I then save as a PDF. > If I then zoom in in the PDF, I notice that different rows have different sizes, and different columns have different sizes. It seems that some rows/columns have twice the height/width as other rows/columns. > Attached is a screenshot of part of the PDF after zooming in. > Is there some way to force all rows / columns to have the same height/width? > > Best, > -Michiel. > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Julien C. <jul...@gm...> - 2013-06-06 12:08:22
|
Dear all I am puzzled: in the following code, when I call clim() *after* having created 3 subplots, only the last subplot takes the new limits into account. All other subplots ignore it. Xlim(), on the countrary, works as intended. Everything works fine when I set the clim() at creation time. Am I doing something wrong, or is this a bug, please ? Any help much appreciated ! The offending code is below. I use python 2.7.5 andmatplotlib-1.3.x-py2.7-macosx-10.8-intel.egg Thanks for any help! __BEGIN_SOURCE___ import matplotlib.pyplot as plt import numpy as np x = np.asarray([[1, 100, 20], [50, 1, 20], [20, 10, 5]]) # Problem when setting clim *after* having created the two subplots: # only the last subplot honors the request # 1. Create the pcolormeshes in subplots h = plt.figure() for i in range(131, 134): plt.subplot(i) plt.pcolormesh(x) plt.colorbar() print(h.number) # 2. Now set the clim() plt.figure(h.number) for i in range(131, 134): plt.subplot(i) plt.clim((5,10)) plt.xlim((2,3)) plt.savefig('after_creation.png') plt.show() # No problem when setting clim *while* creating each subplot h = plt.figure() for i in range(131, 134): plt.subplot(i) plt.pcolormesh(x) plt.colorbar() plt.clim((5,10)) plt.xlim((2,3)) plt.savefig('while_creating.png') plt.show() __END_SOURCE___ |
From: Sudheer J. <sud...@ya...> - 2013-06-06 10:38:14
|
Dear members, Is there a way to add error bar to pandas ts.plot object?. with best regards, Sudheer *************************************************************** Sudheer Joseph Indian National Centre for Ocean Information Services Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) E-mail:sjo...@gm...;sud...@ya... Web- http://oppamthadathil.tripod.com *************************************************************** |
From: Michiel de H. <mjl...@ya...> - 2013-06-06 09:52:47
|
Hi all, I am trying to draw a heatmap using matshow, which I then save as a PDF. If I then zoom in in the PDF, I notice that different rows have different sizes, and different columns have different sizes. It seems that some rows/columns have twice the height/width as other rows/columns. Attached is a screenshot of part of the PDF after zooming in. Is there some way to force all rows / columns to have the same height/width? Best, -Michiel. |
From: Scott L. <sl...@sp...> - 2013-06-06 03:08:11
|
I have python 3.3.2 from python.org installed as a Framework. I set up a virtualenv to test the script $ virtualenv-3.3 mpl121 --no-site-packages $ .mpl121/bin/activate $ pip-3.3 install numpy $ pip-3.3 install matplotlib With this setup, key events are passed to the window behind the active plot window and no event is printed by the test script. Mouse clicks in the plot window do cause the script to print out the event. I even tried installing 1.4.x into the virtualenv with $ pip-3.3 install git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib The key events were not printed out by the script. I tried creating a different virtualenv using --system-site-packages and the script failed to detect key events. If I deactivate the virtualenvs and run the script with matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg in /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/ the key events are printed by the script. I'm not sure why using matplotlib from a virtualenv causes the key events to be ignored in my setup. I should have stated in my first reply that I used a virtualenv to test 1.2.1 and 1.3.0rc2 but not 1.4.x. Scott On Jun 5, 2013, at 7:49 PM, Michiel de Hoon <mjl...@ya...> wrote: > The script works for me with matplotlib-1.2.1 both with Python2 and with Python3 with the MacOSX backend. > To rule out the usual culprit, is your Python3 installed as a framework? > > Best, > -MIchiel. > > > ----- Original Message ----- > From: Scott Lasley <sl...@sp...> > To: "mat...@li..." <mat...@li...> > Cc: > Sent: Thursday, June 6, 2013 4:50 AM > Subject: Re: [Matplotlib-users] key_press_events on macosx > > > On Jun 5, 2013, at 2:51 PM, Matt Terry <mat...@gm...> wrote: > >> Hi, >> I'm working on a TextBox widget and have run into problems registering key_press_events with the macosx backend. button_press_events work, but key_press_events fail to trigger. If I change backends to tkAgg, everything triggers as expected. >> >> Can anyone reproduce this? >> Run the following script; click the figure and bang on the keyboard. Mouse clicks and keyboard clicks should echo on the screen. I'm using mpl 1.2.1 with Anaconda. >> >> -matt >> >> import pylab as plt >> plt.switch_backend('macosx') >> >> >> def print_event(event): >> print 'event', event >> >> ax = plt.subplot(111) >> fig = ax.figure >> >> x = range(10) >> ax.plot(x, x) >> # mouse clicks work on tkAgg & macosx >> fig.canvas.mpl_connect('button_press_event', print_event) >> # key presses only work on tkAgg >> fig.canvas.mpl_connect('key_press_event', print_event) >> >> plt.show() > > key_press_events in the script fail on my mac running OS X 10.8, python 3.3.2 from python.org and with both matplotlib 1.2.1 installed with pip and matplotlib-1.3.0rc2 from the matplotlib.org download page > > They do work with the latest matplotlib 1.4 from github > > hth, > Scott |
From: Matt T. <mat...@gm...> - 2013-06-06 01:23:48
|
I've only tested against the prepackaged python 2.7, mpl 1.2.1 in an anaconda install. Anaconda is not a framework build. On Jun 5, 2013 4:50 PM, "Michiel de Hoon" <mjl...@ya...> wrote: > The script works for me with matplotlib-1.2.1 both with Python2 and with > Python3 with the MacOSX backend. > To rule out the usual culprit, is your Python3 installed as a framework? > > Best, > -MIchiel. > > > > > > ----- Original Message ----- > From: Scott Lasley <sl...@sp...> > To: "mat...@li..." < > mat...@li...> > Cc: > Sent: Thursday, June 6, 2013 4:50 AM > Subject: Re: [Matplotlib-users] key_press_events on macosx > > > On Jun 5, 2013, at 2:51 PM, Matt Terry <mat...@gm...> wrote: > > > Hi, > > I'm working on a TextBox widget and have run into problems registering > key_press_events with the macosx backend. button_press_events work, but > key_press_events fail to trigger. If I change backends to tkAgg, > everything triggers as expected. > > > > Can anyone reproduce this? > > Run the following script; click the figure and bang on the keyboard. > Mouse clicks and keyboard clicks should echo on the screen. I'm using mpl > 1.2.1 with Anaconda. > > > > -matt > > > > import pylab as plt > > plt.switch_backend('macosx') > > > > > > def print_event(event): > > print 'event', event > > > > ax = plt.subplot(111) > > fig = ax.figure > > > > x = range(10) > > ax.plot(x, x) > > # mouse clicks work on tkAgg & macosx > > fig.canvas.mpl_connect('button_press_event', print_event) > > # key presses only work on tkAgg > > fig.canvas.mpl_connect('key_press_event', print_event) > > > > plt.show() > > key_press_events in the script fail on my mac running OS X 10.8, python > 3.3.2 from python.org and with both matplotlib 1.2.1 installed with pip > and matplotlib-1.3.0rc2 from the matplotlib.org download page > > They do work with the latest matplotlib 1.4 from github > > hth, > Scott > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Michiel de H. <mjl...@ya...> - 2013-06-05 23:49:43
|
The script works for me with matplotlib-1.2.1 both with Python2 and with Python3 with the MacOSX backend. To rule out the usual culprit, is your Python3 installed as a framework? Best, -MIchiel. ----- Original Message ----- From: Scott Lasley <sl...@sp...> To: "mat...@li..." <mat...@li...> Cc: Sent: Thursday, June 6, 2013 4:50 AM Subject: Re: [Matplotlib-users] key_press_events on macosx On Jun 5, 2013, at 2:51 PM, Matt Terry <mat...@gm...> wrote: > Hi, > I'm working on a TextBox widget and have run into problems registering key_press_events with the macosx backend. button_press_events work, but key_press_events fail to trigger. If I change backends to tkAgg, everything triggers as expected. > > Can anyone reproduce this? > Run the following script; click the figure and bang on the keyboard. Mouse clicks and keyboard clicks should echo on the screen. I'm using mpl 1.2.1 with Anaconda. > > -matt > > import pylab as plt > plt.switch_backend('macosx') > > > def print_event(event): > print 'event', event > > ax = plt.subplot(111) > fig = ax.figure > > x = range(10) > ax.plot(x, x) > # mouse clicks work on tkAgg & macosx > fig.canvas.mpl_connect('button_press_event', print_event) > # key presses only work on tkAgg > fig.canvas.mpl_connect('key_press_event', print_event) > > plt.show() key_press_events in the script fail on my mac running OS X 10.8, python 3.3.2 from python.org and with both matplotlib 1.2.1 installed with pip and matplotlib-1.3.0rc2 from the matplotlib.org download page They do work with the latest matplotlib 1.4 from github hth, Scott ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |