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
(8) |
2
(4) |
3
(21) |
4
(23) |
5
(3) |
|
6
|
7
(8) |
8
(2) |
9
|
10
(6) |
11
(4) |
12
(6) |
|
13
(1) |
14
(9) |
15
(10) |
16
(11) |
17
(3) |
18
(10) |
19
(9) |
|
20
(2) |
21
(10) |
22
(16) |
23
(8) |
24
(6) |
25
(6) |
26
(3) |
|
27
(5) |
28
(1) |
29
(14) |
30
(5) |
31
(14) |
|
|
|
From: Charlie M. <cw...@gm...> - 2006-08-04 17:16:24
|
On 8/4/06, Richard House <rm...@rh...> wrote:
> -----Original Message-----
> On Behalf Of Charlie Moad, Sent: 04 August 2006 14:34
> Subject: Re: [Matplotlib-users] Making the Axes Plot Area TransparentRatherthan having Color
>
> On 8/4/06, Richard House <rm...@rh...> wrote:
> > -----Original Message-----
> > On Behalf Of Charlie Moad, Sent: 04 August 2006 13:59
> > Subject: Re: [Matplotlib-users] Making the Axes Plot Area Transparent
> > Ratherthan having Color
> >
> > On 8/4/06, Richard House <rm...@rh...> wrote:
> > > I am trying to make a transparent chart and have managed to make the frame area transparent using frameon(False). However I can't find out how to make the plot area background on the chart transparent, without using a graphics package to process the matplotlib produced image. I have searched the mailing list and documentation but haven't found any information on the subject.
> > > Can anyone offer any advice?
> >
> > gca().axesPatch.set_alpha(0.0)
> >
> > Thanks for that Charlie. It works, but removes the axes plot area border so the x and y axes have no solid line. Is there a simple way to avoid that or do I need to plot the axes as lines?
>
> I don't think I am seeing that effect. I am attaching my output for this:
>
> figure(frameon=False)
> plot(rand(100))
> gca().axesPatch.set_alpha(0.0)
> savefig('out.png')
>
> Thanks again Charlie. Just had a few experiments. I wonder if we are dealing with difference platform/version behaviour? I was running WinXP, Python 2.4, Matplotlib 0.82 and your example code did not produce transparency for me. However the following code did but without the plot area border (example attached):
> #!/usr/bin/env python
> from pylab import *
> fig = figure()
> fig.set_frameon(False)
> plot(rand(100))
> gca().axesPatch.set_alpha(0.0)
> savefig('transparent.png')
>
> On upgrading to 0.87.3 (0.87.4 complains about numpy versions), and running this code, the png file produced does include a border, the same as in your output sample. The upgraded matplotlib also produces a plot area border in my own chart code, so the problem is solved.
Sounds like you got it working then. Mpl 0.87.4 requires numpy-0.9.8.
I think 0.87.3 requires 0.9.6, but I am starting to forget all the
number combinations. Once numpy 1.0 is released, this mess should be
gone.
|
|
From: Richard A. <ral...@in...> - 2006-08-04 16:03:38
|
If you are just creating graphic images you could always send the legend to a different figure, and then print both figures to file. You could then munge a layout together for whatever document you are creating. On Fri, 2006-08-04 at 16:03 +0200, Christian Meesters wrote: > Hi, > > As far I understand this a plot is per default covering the more or less whole > space. Now, is it possible to position a legend outside of a plot, e.g. on > the right of the plot. "legend" offers to supply the loc-argument with a > tuple to do that, but that doesn't create more space and hence most legends > will appear truncated. The only solution I came up with is to limit the > plotting area (using "axes") and to position the legend manually. Is there an > alternative? > > TIA > Cheers > Christian > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Rick Albright Senior Quantitvative Analyst Indie Research, LLC 254 Witherspoon Street Princeton, NJ 08542 (609)497-1030 ral...@in... |
|
From: Richard H. <rm...@rh...> - 2006-08-04 15:36:45
|
-----Original Message-----
On Behalf Of Charlie Moad, Sent: 04 August 2006 14:34
Subject: Re: [Matplotlib-users] Making the Axes Plot Area =
TransparentRatherthan having Color
On 8/4/06, Richard House <rm...@rh...> wrote:
> -----Original Message-----
> On Behalf Of Charlie Moad, Sent: 04 August 2006 13:59
> Subject: Re: [Matplotlib-users] Making the Axes Plot Area Transparent=20
> Ratherthan having Color
>
> On 8/4/06, Richard House <rm...@rh...> wrote:
> > I am trying to make a transparent chart and have managed to make the =
frame area transparent using frameon(False). However I can't find out =
how to make the plot area background on the chart transparent, without =
using a graphics package to process the matplotlib produced image. I =
have searched the mailing list and documentation but haven't found any =
information on the subject.
> > Can anyone offer any advice?
>
> gca().axesPatch.set_alpha(0.0)
>
> Thanks for that Charlie. It works, but removes the axes plot area =
border so the x and y axes have no solid line. Is there a simple way to =
avoid that or do I need to plot the axes as lines?
I don't think I am seeing that effect. I am attaching my output for =
this:
figure(frameon=3DFalse)
plot(rand(100))
gca().axesPatch.set_alpha(0.0)
savefig('out.png')
Thanks again Charlie. Just had a few experiments. I wonder if we are =
dealing with difference platform/version behaviour? I was running WinXP, =
Python 2.4, Matplotlib 0.82 and your example code did not produce =
transparency for me. However the following code did but without the plot =
area border (example attached):
#!/usr/bin/env python
from pylab import *
fig =3D figure()
fig.set_frameon(False)
plot(rand(100))
gca().axesPatch.set_alpha(0.0)
savefig('transparent.png')
On upgrading to 0.87.3 (0.87.4 complains about numpy versions), and =
running this code, the png file produced does include a border, the same =
as in your output sample. The upgraded matplotlib also produces a plot =
area border in my own chart code, so the problem is solved.
Many thanks.
|
|
From: John H. <jdh...@ac...> - 2006-08-04 15:07:34
|
>>>>> "Christian" == Christian Meesters <mee...@un...> writes:
Christian> Hi, As far I understand this a plot is per default
Christian> covering the more or less whole space. Now, is it
Christian> possible to position a legend outside of a plot,
Christian> e.g. on the right of the plot. "legend" offers to
Christian> supply the loc-argument with a tuple to do that, but
Christian> that doesn't create more space and hence most legends
Christian> will appear truncated. The only solution I came up with
Christian> is to limit the plotting area (using "axes") and to
Christian> position the legend manually. Is there an alternative?
You have to do the layout yourself -- you can also use the
"subplots_adjust" to set the bottom, top, left, right, etc of the axes
which may be easier than using "axes" itself.
We could add some auto-layout capability as we do for the colorbar...
JDH
|
|
From: Steve S. <el...@gm...> - 2006-08-04 14:59:34
|
Christian Meesters wrote: > Hi, > > As far I understand this a plot is per default covering the more or less whole > space. Now, is it possible to position a legend outside of a plot, e.g. on > the right of the plot. "legend" offers to supply the loc-argument with a > tuple to do that, but that doesn't create more space and hence most legends > will appear truncated. The only solution I came up with is to limit the > plotting area (using "axes") and to position the legend manually. Is there an > alternative? > > TIA > Cheers > Christian > I think you have to fiddle with the axes (see figlegend_demo.py in the examples folder). As far as I know, there is no such thing like gnuplot's "set key out" switch. cheer, steve -- Random number generation is the art of producing pure gibberish as quickly as possible. |
|
From: Christian M. <mee...@un...> - 2006-08-04 14:02:31
|
Hi, As far I understand this a plot is per default covering the more or less whole space. Now, is it possible to position a legend outside of a plot, e.g. on the right of the plot. "legend" offers to supply the loc-argument with a tuple to do that, but that doesn't create more space and hence most legends will appear truncated. The only solution I came up with is to limit the plotting area (using "axes") and to position the legend manually. Is there an alternative? TIA Cheers Christian |
|
From: Charlie M. <cw...@gm...> - 2006-08-04 13:34:29
|
On 8/4/06, Richard House <rm...@rh...> wrote:
> -----Original Message-----
> On Behalf Of Charlie Moad, Sent: 04 August 2006 13:59
> Subject: Re: [Matplotlib-users] Making the Axes Plot Area Transparent Ratherthan having Color
>
> On 8/4/06, Richard House <rm...@rh...> wrote:
> > I am trying to make a transparent chart and have managed to make the frame area transparent using frameon(False). However I can't find out how to make the plot area background on the chart transparent, without using a graphics package to process the matplotlib produced image. I have searched the mailing list and documentation but haven't found any information on the subject.
> > Can anyone offer any advice?
>
> gca().axesPatch.set_alpha(0.0)
>
> Thanks for that Charlie. It works, but removes the axes plot area border so the x and y axes have no solid line. Is there a simple way to avoid that or do I need to plot the axes as lines?
I don't think I am seeing that effect. I am attaching my output for this:
figure(frameon=False)
plot(rand(100))
gca().axesPatch.set_alpha(0.0)
savefig('out.png')
|
|
From: Richard H. <rm...@rh...> - 2006-08-04 13:26:35
|
-----Original Message----- On Behalf Of Charlie Moad, Sent: 04 August 2006 13:59 Subject: Re: [Matplotlib-users] Making the Axes Plot Area Transparent = Ratherthan having Color On 8/4/06, Richard House <rm...@rh...> wrote: > I am trying to make a transparent chart and have managed to make the = frame area transparent using frameon(False). However I can't find out = how to make the plot area background on the chart transparent, without = using a graphics package to process the matplotlib produced image. I = have searched the mailing list and documentation but haven't found any = information on the subject. > Can anyone offer any advice? gca().axesPatch.set_alpha(0.0) Thanks for that Charlie. It works, but removes the axes plot area border = so the x and y axes have no solid line. Is there a simple way to avoid = that or do I need to plot the axes as lines? |
|
From: Charlie M. <cw...@gm...> - 2006-08-04 12:59:14
|
On 8/4/06, Richard House <rm...@rh...> wrote: > I am trying to make a transparent chart and have managed to make the frame area transparent using frameon(False). However I can't find out how to make the plot area background on the chart transparent, without using a graphics package to process the matplotlib produced image. I have searched the mailing list and documentation but haven't found any information on the subject. > Can anyone offer any advice? gca().axesPatch.set_alpha(0.0) |
|
From: Richard H. <rm...@rh...> - 2006-08-04 12:34:43
|
I am trying to make a transparent chart and have managed to make the = frame area transparent using frameon(False). However I can't find out = how to make the plot area background on the chart transparent, without = using a graphics package to process the matplotlib produced image. I = have searched the mailing list and documentation but haven't found any = information on the subject. Can anyone offer any advice? Regards, Richard |
|
From: Jouni K S. <jk...@ik...> - 2006-08-04 12:28:40
|
João Fonseca <joa...@ma...> writes: > RuntimeError: Could not load facefile /System/Library/Fonts/ > LucidaGrande.dfont; Unknown_File_Format. I don't think there is a > problem with the font file, I checked this with Font Book and > everything is ok. Apparently matplotlib doesn't understand dfont files. You could get fondu (from e.g. darwinports) and convert the file into a bunch of ttf files and put them somewhere that matplotlib looks (I guess the matplotlib data path would work). A workaround is to edit your $HOME/.matplotlib/matplotlibrc to force the default sans-serif font to be Bitstream Vera Sans (and similarly Bitstream Vera Serif for serif and Bitstream Vera Sans Mono for monospace), which are distributed with matplotlib. Remove the ttffont.cache file from your .matplotlib directory if the changes don't come into effect otherwise. The subsystem that searches for fonts and the subsystem that uses fonts should be synchronized to accept the same fonts; preferably by improving the latter, but it would help to make the former as selective as the latter. -- Jouni |
|
From: <joa...@ma...> - 2006-08-04 12:27:46
|
This seems to have worked. Thanks a lot!
Jo=E3o
On 4 Aug 2006, at 13:11, Charlie Moad wrote:
> On 8/4/06, Jo=E3o Fonseca <joa...@ma...> wrote:
>> I have compiled version 0.87.4 of matplotlib successfully but
>> whenever I try to plot anything I get the following font error:
>>
>> RuntimeError: Could not load facefile /System/Library/Fonts/
>> LucidaGrande.dfont; Unknown_File_Format. I don't think there is a
>> problem with the font file, I checked this with Font Book and
>> everything is ok.
>>
>> If I use axis('off') to turn off the axis, plots work fine but there
>> is obviously something wrong and I can't quite work it out.
>>
>> Can anyone help?
>
> Try deleting your ~/.matplotlib folder to clear you font cache.
>
> - Charlie
|
|
From: Charlie M. <cw...@gm...> - 2006-08-04 12:11:36
|
On 8/4/06, Jo=E3o Fonseca <joa...@ma...> wrote:
> I have compiled version 0.87.4 of matplotlib successfully but
> whenever I try to plot anything I get the following font error:
>
> RuntimeError: Could not load facefile /System/Library/Fonts/
> LucidaGrande.dfont; Unknown_File_Format. I don't think there is a
> problem with the font file, I checked this with Font Book and
> everything is ok.
>
> If I use axis('off') to turn off the axis, plots work fine but there
> is obviously something wrong and I can't quite work it out.
>
> Can anyone help?
Try deleting your ~/.matplotlib folder to clear you font cache.
- Charlie
|
|
From: <joa...@ma...> - 2006-08-04 12:00:31
|
I have compiled version 0.87.4 of matplotlib successfully but
whenever I try to plot anything I get the following font error:
RuntimeError: Could not load facefile /System/Library/Fonts/
LucidaGrande.dfont; Unknown_File_Format. I don't think there is a
problem with the font file, I checked this with Font Book and
everything is ok.
If I use axis('off') to turn off the axis, plots work fine but there
is obviously something wrong and I can't quite work it out.
Can anyone help?
I compiled matplotlib with freetype2 from fink (2.1.3-22) after
unsuccessfully trying to compile it with 2.2.
I am compiling matplotlib because I needed scipy, for which I
couldn't find a binary that would work on my MacBook. That meant I
had to compile my own numpy, which in turn broke matplotlib.
Thanks,
Joao
|
|
From: Albert S. <as...@di...> - 2006-08-04 07:52:18
|
Hi I installed numpy-1.0b1 and scipy-0.5 (from source), and ran the test suites- both work fine. I also have Numeric and numarray installed. Im now trying to install matplotlib-0.87.4, but get this error when doing "python setup.py build" Why would it find the version of numpy to be 0?: import core -> failed: module compiled against version 90504 of C-API but this version of numpy is 0 import lib -> failed: No module named oldnumeric import linalg -> failed: module compiled against version 90504 of C-API but this version of numpy is 0 import dft -> failed: module compiled against version 90504 of C-API but this version of numpy is 0 import random -> failed: numpy.dtype does not appear to be the correct type object Segmentation fault |
|
From: <gre...@gm...> - 2006-08-04 01:26:09
|
On 8/3/06, PGM <pgm...@gm...> wrote:
> But Greg, if it's only for that, try to put an empty label in front of the
> others:
> figure.gca().set_yticklabels(('', 'Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
> That might do the trick
No, that didn't work. Did the barh just not work well in my version?
|
|
From: PGM <pgm...@gm...> - 2006-08-04 01:11:33
|
On Thursday 03 August 2006 20:41, Gregory Pi=F1ero wrote: > Another question, why are there only four bars showing up when I have > 5 values and 5 labels? ??? On my machine, (matplotlib.__version__ =3D '0.87.4'), the script you posted= =20 around 5PM (EST) works OK, five bars, five labels nicely placed (once=20 prepended with a fake one )... |
|
From: <gre...@gm...> - 2006-08-04 00:41:44
|
Another question, why are there only four bars showing up when I have 5 values and 5 labels? |
|
From: PGM <pgm...@gm...> - 2006-08-03 22:21:02
|
On Thursday 03 August 2006 17:44, Gregory Pi=F1ero wrote: > So all you changed was to add in align=3D'center' ? I assume me using > figure.gca() is equivalent to your use of ax? Yes, gca() is "get the current axes object". > Is it hard to upgrade to the latest version from svn? Any directions? [From=20 'http://projects.scipy.org/neuroimaging/ni/wiki/DevelopmentInstallFedora'] svn co https://svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib=20 matplotlib-trunk cd matplotlib-trunk python setup.py build sudo python setup.py install cd .. But Greg, if it's only for that, try to put an empty label in front of the= =20 others: figure.gca().set_yticklabels(('', 'Tom', 'Dick', 'Harry', 'Slim', 'Jim')) That might do the trick |
|
From: <gre...@gm...> - 2006-08-03 21:45:02
|
On 8/3/06, John Hunter <jdh...@ac...> wrote:
> The following, with svn mpl, works. If it doesn't work for you, make
> sure to upgrade your matplotlib; note the use of "align" which is a
> fairly recent addition to mpl
>
> val = [2,5,3,6,3] # the bar lengths
> pos = arange(5)+.5 # the bar centers on the y axis
>
> p1 = figure.gca().barh(pos,val, align='center')
> ax = figure.gca()
> ax.set_yticks(pos)
> ax.set_yticklabels(('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
> ax.set_xlabel('Perfomance')
> ax.set_title('How fast do you want to go today?')
> canvas=FigureCanvasAgg(figure)
So all you changed was to add in align='center' ? I assume me using
figure.gca() is equivalent to your use of ax?
Is it hard to upgrade to the latest version from svn? Any directions?
-Greg
|
|
From: John H. <jdh...@ac...> - 2006-08-03 21:39:27
|
>>>>> "Gregory" =3D=3D Gregory Pi=F1ero <gre...@gm...> writes:
Gregory> On 8/3/06, John Hunter <jdh...@ac...>
Gregory> wrote:
>> >>>>> "Gregory" =3D=3D Gregory Pi=F1ero <gre...@gm...>
>> writes:
Gregory> bar centers on the y axis p1 =3D figure.gca().barh(pos,val)
Gregory> figure.gca().set_yticks(pos)
Gregory> figure.gca().set_yticklabels(('Tom', 'Dick', 'Harry',
Gregory> 'Slim', 'Jim')) figure.gca().set_xlabel('Perfomance')
Gregory> figure.gca().set_title('How fast do you want to go
Gregory> today?') canvas=3DFigureCanvasAgg(figure) return canvas
>>
Gregory> I changed the code to above but it still gives a similair
Gregory> result.
The following, with svn mpl, works. If it doesn't work for you, make
sure to upgrade your matplotlib; note the use of "align" which is a
fairly recent addition to mpl
val =3D [2,5,3,6,3] # the bar lengths
pos =3D arange(5)+.5 # the bar centers on the y axis
=20
p1 =3D figure.gca().barh(pos,val, align=3D'center')
ax =3D figure.gca()
ax.set_yticks(pos)
ax.set_yticklabels(('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
ax.set_xlabel('Perfomance')
ax.set_title('How fast do you want to go today?')
canvas=3DFigureCanvasAgg(figure)
JDH
|
|
From: <gre...@gm...> - 2006-08-03 21:27:44
|
On 8/3/06, John Hunter <jdh...@ac...> wrote:
> >>>>> "Gregory" =3D=3D Gregory Pi=F1ero <gre...@gm...> writes:
> Gregory> bar centers on the y axis p1 =3D figure.gca().barh(pos,val)
figure.gca().set_yticks(pos)
> Gregory> figure.gca().set_yticklabels(('Tom', 'Dick', 'Harry',
> Gregory> 'Slim', 'Jim')) figure.gca().set_xlabel('Perfomance')
> Gregory> figure.gca().set_title('How fast do you want to go
> Gregory> today?') canvas=3DFigureCanvasAgg(figure) return canvas
>
I changed the code to above but it still gives a similair result.
|
|
From: John H. <jdh...@ac...> - 2006-08-03 21:13:56
|
>>>>> "Gregory" =3D=3D Gregory Pi=F1ero <gre...@gm...> writes:
Gregory> bar centers on the y axis p1 =3D figure.gca().barh(pos,val)
Gregory> figure.gca().set_yticklabels(('Tom', 'Dick', 'Harry',
Gregory> 'Slim', 'Jim')) figure.gca().set_xlabel('Perfomance')
Gregory> figure.gca().set_title('How fast do you want to go
Gregory> today?') canvas=3DFigureCanvasAgg(figure) return canvas
In the example you are following, the code reads
yticks(pos, ('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
This sets the ytick locations and labels. You are only setting the
locations, and so you are incorrectly placing a tick and label at 0.
You want
ax.set_yticks(pos)
ax.set_yticklabels(('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
JDH
|
|
From: <gre...@gm...> - 2006-08-03 21:10:19
|
Hi guys, I can't figure out why my code below is generating the attached image. What am I doing wrong? I tried to copy http://matplotlib.sourceforge.net/examples/barh_demo.py but also convert it so I can use the AGG backend. Any help is appriciated. Greg Pinero <code> from __future__ import division import cgi,cgitb import os,sys import datetime import tempfile import matplotlib matplotlib.use('Agg') # force the antigrain backend from matplotlib.dates import YearLocator, MonthLocator, WeekdayLocator, DateFormatter, date2num from matplotlib import rc from matplotlib.backends.backend_agg import FigureCanvasAgg from matplotlib.figure import Figure from matplotlib.cbook import iterable import matplotlib.numerix as nx from Numeric import arange #makes arrays def start_chart(height,width): """Handles the parts of a chart that are common to all charts. """ assert height>0 and width>0 fig = Figure(figsize=(width,height)) #add an axes at left, bottom, width, height; (in fractions of figure size) ax = fig.add_axes([0.2, 0.3, 0.7, 0.6]) return fig def make_sideways_bar_chart_proto(figure): """ """ val = [2,5,3,6,3] # the bar lengths pos = arange(5)+.5 # the bar centers on the y axis p1 = figure.gca().barh(pos,val) figure.gca().set_yticklabels(('Tom', 'Dick', 'Harry', 'Slim', 'Jim')) figure.gca().set_xlabel('Perfomance') figure.gca().set_title('How fast do you want to go today?') canvas=FigureCanvasAgg(figure) return canvas def test_routine(): height,width=3,4 figure=start_chart(float(height),float(width)) canvas=make_sideways_bar_chart_proto(figure) canvas.print_figure('test.png', dpi=150) if __name__=='__main__': test_routine() </code> |
|
From: <gre...@gm...> - 2006-08-03 18:50:45
|
Ok, figured it out. My values had to be floats. They were strings.
Sorry for the trouble.
On 8/3/06, Gregory Pi=F1ero <gre...@gm...> wrote:
> Hi Fine Matplotlib folks,
>
> I'm getting this error message and I can figure it out:
>
> Traceback (most recent call last):
> ...
> File "C:\automated tasks\GMVIEW-DEV\chart_gen.debug.py", line 26, in ?
> p1 =3D figure.gca().barh(ind, ddata['value'], width, color=3D'r')
> File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2499, in =
barh
> bottom =3D y - height/2.
> ValueError: frames are not aligned
>
> Here is the relevant code:
> <code>
> from __future__ import division
> import os,sys
> import datetime
> import tempfile
> import matplotlib
> matplotlib.use('Agg') # force the antigrain backend
> from matplotlib.dates import YearLocator, MonthLocator,
> WeekdayLocator, DateFormatter, date2num
> from matplotlib import rc
> from matplotlib.backends.backend_agg import FigureCanvasAgg
> from matplotlib.figure import Figure
> from matplotlib.cbook import iterable
> import matplotlib.numerix as nx
>
> ddata=3D{'label': ['REP1', 'REP2', 'REP3', 'REP4', 'REP5'], 'type':
> 'bar_sideways', 'value': ['23.00', '1381.56', '4606.69', '259.00',
> '50.00'], 'money_format': '1', 'title': 'Sales from 2006-08-01 to
> 2006-08-02'}
> height,width=3D3,4
> figure =3D Figure(figsize=3D(width,height))
> ax =3D figure.add_axes([0.2, 0.3, 0.7, 0.6])
> from Numeric import arange #makes arrays
> N=3Dlen(ddata['value'])
> ind =3D arange(N) # the x locations for the groups
> width=3D(figure.get_size_inches()[0]/len(ddata['value']))
> width_gap=3D(.3*width)
> width=3Dwidth-width_gap # the width of the bars
>
> #OFFENDING LINE
> p1 =3D figure.gca().barh(ind, ddata['value'], width, color=3D'r')
>
> figure.gca().set_ylabel('$Amount')
> if title:
> figure.gca().set_title('title', bbox=3D{'facecolor':'0.8', 'pad':5})
> locs =3D figure.gca().set_xticks(ind+width_gap)
> labels =3D figure.gca().set_xticklabels(ddata['label'])
> figure.gca().set_xlim(-width,len(ind))
> #try to autoscale here
> y_height=3Dmax(ddata['value'])+.2*max(ddata['value'])
> y_increment=3Dround(y_height/5,-1)
> figure.gca().set_yticks(arange(0,y_height,y_increment))
> canvas =3D FigureCanvasAgg(figure)
> </code>
>
> any help is greatly appriciated!
>
> --
> Gregory Pi=F1ero
> Chief Innovation Officer
> Blended Technologies
> (www.blendedtechnologies.com)
>
--=20
Gregory Pi=F1ero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)
|