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) |
2
(1) |
3
(6) |
4
(19) |
5
(11) |
6
(2) |
7
|
|
8
(5) |
9
(13) |
10
(25) |
11
(28) |
12
(6) |
13
(10) |
14
(3) |
|
15
(4) |
16
(8) |
17
(16) |
18
(12) |
19
(16) |
20
(12) |
21
(11) |
|
22
(13) |
23
(11) |
24
(22) |
25
(28) |
26
(11) |
27
(8) |
28
(7) |
|
29
(19) |
30
(3) |
31
(20) |
|
|
|
|
|
From: Darren D. <dd...@co...> - 2006-01-09 17:32:34
|
On Monday 09 January 2006 12:02, Bowen, Brian M wrote:
> Matplotlib-users,
>
> I am stuck on a problem in trying to label the xaxis for some plots. I
> am trying to do something similar to the following:
>
> plot([1,2,3,4], [1,4,9,16])
> labels = setp(gca(), 'xticklabels', ['one', 'two', 'three', 'four'])
> set(labels, 'rotation', 'vertical')
> show()
>
>
> Once the plot is displayed, moving the mouse causes the following stack
> trace:
>
> TypeError: list indices must be integers Traceback (most recent call
> last):
> File
> "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py",
> line 188, in motion_notify_event
> FigureCanvasBase.motion_notify_event(self, x, y)
> File "/usr/lib/python2.4/site-packages/matplotlib/backend_bases.py",
> line 797, in motion_notify_event
> func(event)
> File "/usr/lib/python2.4/site-packages/matplotlib/backend_bases.py",
> line 1085, in mouse_move
> try: s = event.inaxes.format_coord(event.xdata, event.ydata)
> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 611,
> in format_coord
> xs = self.format_xdata(x)
> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 593,
> in format_xdata
> val = func(x)
> File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line
> 152, in format_data
> return self.__call__(value)
> File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line
> 178, in __call__
> else: return self.seq[pos]
>
>
> Line 3 of the code seems to be the culprit. Does anyone have any idea on
> how I might be able to workaround this? I have seen posts describing
> issues that seem to be related to the same problem, but I have not seen
> a solution.
That doesnt make any sense to me. Line 152 calls self.__call__ with only one
argument, which means the pos argument is initialized to none, and an empty
string should be returned. We need to know what the value of pos is, please
replace line 178 with this:
else:
print pos
return self.seq[pos]
and post the result.
Darren
|
|
From: Bowen, B. M <bm...@sa...> - 2006-01-09 17:03:48
|
Matplotlib-users,=20
I am stuck on a problem in trying to label the xaxis for some plots. I
am trying to do something similar to the following:
plot([1,2,3,4], [1,4,9,16])
labels =3D setp(gca(), 'xticklabels', ['one', 'two', 'three', 'four'])
set(labels, 'rotation', 'vertical')
show()=20
Once the plot is displayed, moving the mouse causes the following stack
trace:
TypeError: list indices must be integers Traceback (most recent call
last):
File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py",
line 188, in motion_notify_event
FigureCanvasBase.motion_notify_event(self, x, y)
File "/usr/lib/python2.4/site-packages/matplotlib/backend_bases.py",
line 797, in motion_notify_event
func(event)
File "/usr/lib/python2.4/site-packages/matplotlib/backend_bases.py",
line 1085, in mouse_move
try: s =3D event.inaxes.format_coord(event.xdata, event.ydata)
File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 611,
in format_coord
xs =3D self.format_xdata(x)
File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 593,
in format_xdata
val =3D func(x)
File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line
152, in format_data
return self.__call__(value)
File "/usr/lib/python2.4/site-packages/matplotlib/ticker.py", line
178, in __call__
else: return self.seq[pos]
Line 3 of the code seems to be the culprit. Does anyone have any idea on
how I might be able to workaround this? I have seen posts describing
issues that seem to be related to the same problem, but I have not seen
a solution.
Thanks,
Brian Bowen
|
|
From: Charlie M. <cw...@gm...> - 2006-01-09 15:06:09
|
There is support for numpy in the latest release we are trying to push now. You can download the source here: http://cheeseshop.python.org/pypi/matplotlib/0.86 - Charlie On 1/9/06, Christopher Fonnesbeck <ch...@tr...> wrote: > I am trying to use numpy as the backend for matplotlib (I see now > that you can specify it in setup.py). But the matplotlib/numerix/fft/ > __init__.py still appears to be out of date: > > 1 from matplotlib.numerix import which > 2 > 3 if which[0] =3D=3D "numarray": > 4 from numarray.fft import * > 5 elif which[0] =3D=3D "numeric": > 6 from FFT import * > 7 elif which[0] =3D=3D "scipy": > 8 from scipy import * > 9 inverse_fft =3D ifft > 10 from scipy.basic.fft import * > 11 from scipy.corefft import * > 12 else: > 13 raise RuntimeError("invalid numerix selector") > > If this is changed to numpy, should one expect the numpy backend to > work? > > > Thanks. > > -- > Christopher J. Fonnesbeck > > Population Ecologist, Marine Mammal Section > Fish & Wildlife Research Institute (FWC) > St. Petersburg, FL > > Adjunct Assistant Professor > Warnell School of Forest Resources > University of Georgia > Athens, GA > > T: 727.235.5570 > E: chris at trichech.us > > > > > |
|
From: Christopher F. <ch...@tr...> - 2006-01-09 15:02:35
|
I am trying to use numpy as the backend for matplotlib (I see now
that you can specify it in setup.py). But the matplotlib/numerix/fft/
__init__.py still appears to be out of date:
1 from matplotlib.numerix import which
2
3 if which[0] == "numarray":
4 from numarray.fft import *
5 elif which[0] == "numeric":
6 from FFT import *
7 elif which[0] == "scipy":
8 from scipy import *
9 inverse_fft = ifft
10 from scipy.basic.fft import *
11 from scipy.corefft import *
12 else:
13 raise RuntimeError("invalid numerix selector")
If this is changed to numpy, should one expect the numpy backend to
work?
Thanks.
--
Christopher J. Fonnesbeck
Population Ecologist, Marine Mammal Section
Fish & Wildlife Research Institute (FWC)
St. Petersburg, FL
Adjunct Assistant Professor
Warnell School of Forest Resources
University of Georgia
Athens, GA
T: 727.235.5570
E: chris at trichech.us
|
|
From: Philip A. <pa...@eo...> - 2006-01-09 02:20:26
|
This behavior has to be idiosyncratic to my system (Fedora Core 3,
HP LaserJet 4050N),
but I'd appreciate any suggestions about how to debug it.
Specifically, when I
run the following script:
==> bugreport.py <==
from pylab import *
fig1=figure(1)
plot([0,1],[0,1])
savefig('file1.ps')
The resulting file1.ps looks fine with ghostview
(ggv-2.8.0-1).
Printing with either ggv or lpr using
cups-libs-1.1.22-0.rc1.8.7) does nothing
(no response, nothing queued).
When I run ps2pdf (Aladin 8.53) on the file
> ps2pdf file1.ps file1_ps2pdf.pdf
the resulting file1_ps2pdf.pdf looks find under xpdf, but once
again won't print.
It also looks fine with Adobe Reader 7.0, and will print.
If I then produce a roundtrip postscript file with:
acroread -toPostScript -pairs file1_ps2pdf.pdf file1_roundtrip.ps
The resulting file1_roundtrip.ps does print.
On the off chance that anyone has a clue about what could be going on,
I've put file1.ps, file1_ps2pdf.pdf and file1_roundtrip.ps in
http://clouds.eos.ubc.ca/~phil/matplotlib_postscript
python bugreport.py --verbose-helpful
matplotlib data path /home/phil/usr24/share/matplotlib
$HOME=/home/phil
CONFIGDIR=/home/phil/.matplotlib
loaded rc file /home/phil/.matplotlib/matplotlibrc
matplotlib version 0.85.1.cvs
verbose.level helpful
interactive is False
platform is linux2
numerix Numeric 24.2
font search path ['/home/phil/usr24/share/matplotlib']
loaded ttfcache file /home/phil/.matplotlib/ttffont.cache
backend PS version Level II
This is dvips(k) 5.92b Copyright 2002 Radical Eye Software (www.radicaleye.com)
' TeX output 2006.01.08:1818' -> 1367d6d32a9c3bf965ed7bd8deb2e91a.ps
<texc.pro><psfrag.pro><texps.pro><special.pro><color.pro>. <cmr10.pfb>[1
<1367d6d32a9c3bf965ed7bd8deb2e91a.eps>]
Thanks, Phil
|
|
From: Philip A. <pa...@eo...> - 2006-01-09 01:19:53
|
The following script:
_________________________
from pylab import *
fig1=figure(1)
plot([0,1],[0,1])
xlabel(r'$c_p \overline{w^\prime\,\theta_v^\prime}\ \mathrm{(W\,m^{-2})$')
#xlabel(r'$c_p \overline{w^\prime\,\theta_v^\prime}$')
savefig('bug.ps')
_________________________
fails for me with the popup message:
"Failed to save
Error message: [Errno 2] No such file or directory:
'aa457a9c63ca3a79b3754ed98a30c2ba.ps'"
(although the figure window is plotted correctly).
The script works when I switch to the second xlabel statement,
or change the savefig output to png.
My setup:
~/teaching/atsc500/finalcode phil@owl% python bugreport.py --verbose-helpful
matplotlib data path /home/phil/usr24/share/matplotlib
$HOME=/home/phil
CONFIGDIR=/home/phil/.matplotlib
loaded rc file /home/phil/.matplotlib/matplotlibrc
matplotlib version 0.85.1.cvs
verbose.level helpful
interactive is True
platform is linux2
numerix Numeric 24.2
font search path ['/home/phil/usr24/share/matplotlib']
loaded ttfcache file /home/phil/.matplotlib/ttffont.cache
backend GTKAgg version 2.4.1
This is dvips(k) 5.92b Copyright 2002 Radical Eye Software (www.radicaleye.com)
dvips: ! DVI file can't be opened.
thanks, Phil Austin
|
|
From: Ken M. <mc...@ii...> - 2006-01-08 22:37:36
|
On Jan 8, 2006, at 1:19 PM, Giandomenico Sica wrote: > I'm trying to create a .ps image -- 762x190px -- representing a > complex > multi-layered network -- example of multi-layered network: the first > picture on the right at the web-page https://networkx.lanl.gov/ Hopefully someone here will be able to help you, but you may have more luck asking on the networkx mailing list: http://sourceforge.net/mail/?group_id=122233 Ken |
|
From: Giandomenico S. <gia...@po...> - 2006-01-08 19:18:59
|
I'm trying to create a .ps image -- 762x190px -- representing a complex multi-layered network -- example of multi-layered network: the first picture on the right at the web-page https://networkx.lanl.gov/ -- where nodes have different colours, namely all the rainbow colours. At the present the situation it's quite problematic. I'm able to draw, using networkx and matplotlib, simple networks like the red ones available at the page http://sourceforge.net/project/screenshots.php?group_id=122233. On the contrary, I'm not able to draw multi-layered networks where nodes have different colours. Furthermore, I'm not able to settle the image size. Can you help me please? Many thanks. nic |
|
From: John H. <jdh...@ac...> - 2006-01-08 13:24:48
|
>>>>> "Christopher" == Christopher Barker <Chr...@no...> writes:
Christopher> John Hunter wrote:
>> To rectify this, I've been wanting to improve the drawing
>> model, eg along the line of enthought's kiva.
Christopher> Have you looked at Cairo? that may be another option.
As you probably know, matplotlib already has a cairo backend. But as
a core API for all the backends to implement, we haven't really
considered it. Eric Jones has considered replacing agg with cairo for
their core renderer, since agg is complex and a bit hard.
JDH
|
|
From: John H. <jdh...@ac...> - 2006-01-08 13:23:04
|
>>>>> "frank" == frank h <fra...@gm...> writes:
frank> Hello, I have a table that contains a series of values for
frank> each day I would like to use matplotlib to plot the running
frank> total of those values over time right now, I am computing
frank> an intermediary "running total table" myself and then plot
frank> that. I just wonder whether matplotlib can be instructed
frank> to plot running totals so I can skip that intermediary step
frank> thanks for any insight you might have -frank
If you posted an example we might be able to advise on a better
approach. See also the numerix cumsum function...
JDH
|
|
From: frank h. <fra...@gm...> - 2006-01-08 12:02:07
|
Hello, I have a table that contains a series of values for each day I would like to use matplotlib to plot the running total of those values over time right now, I am computing an intermediary "running total table" myself and then plot that. I just wonder whether matplotlib can be instructed to plot running totals so I can skip that intermediary step thanks for any insight you might have -frank |
|
From: Graeme L. <gra...@gm...> - 2006-01-06 14:54:10
|
Thanks, this is enough to get me started. You weren't kidding about
the "not really documented" part. The Agg documentation is also
lacking. One of my thesis advisor's favorite lines, "Use the source,
Luke", comes to mind. It's only funny the first time you hear it.
I'm using GTK, so I replaced the PIL show() business at the end of
the example with the following, and it works. Maybe this will help
someone else.
import pygtk
pygtk.require('2.0')
import gtk
def area_expose_cb(area, event):
=09s =3D buffer.to_string()
=09gc =3D area.get_style().fg_gc[gtk.STATE_NORMAL]
=09area.window.draw_rgb_32_image(gc, 0, 0, width, height,
gtk.gdk.RGB_DITHER_NONE, s)
win =3D gtk.Window(gtk.WINDOW_TOPLEVEL)
win.set_title('Direct Agg drawing into GTK app')
win.connect("destroy", lambda w: gtk.main_quit())
area =3D gtk.DrawingArea()
area.set_size_request(width, height)
area.connect("expose-event", area_expose_cb)
win.add(area)
win.show_all()
gtk.main()
On 1/4/06, John Hunter <jdh...@ac...> wrote:
> this direction, I exposed a good bit of agg in the matplotlib.agg
> module. Unfortunately, it is not really documented and you pretty
> much have to know agg to use it. But there is an example:
--
-- Graeme
gra...@gm...
|
|
From: Dragos C. <d.c...@fi...> - 2006-01-06 06:18:41
|
Hi, Starting from the example http://matplotlib.sourceforge.net/screenshots/barchart_demo.py I tried to add more data to it. Please see the attached picture with the result. Is there a way to display the legend outside the chart area because in some cases, like this one, parts of the chart are hidden? Any suggestion will be appreciated. Thank you very much. Regards, Dragos |
|
From: Christopher B. <Chr...@no...> - 2006-01-05 22:36:37
|
John Hunter wrote:
> To rectify this, I've been wanting to improve the drawing model, eg
> along the line of enthought's kiva.
Have you looked at Cairo? that may be another option.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: Norbert N. <Nor...@gm...> - 2006-01-05 21:03:46
|
Dave wrote: > > Thanks Chris! I'm using ipython -- why suffer with anything > else;-) -- and I use tab completion to see namespace properties. I > have it set to filter out double-underscore names on the assumption > that these are intended to be private by convention. It seems to me > that __version__ should not be double-underscored unless I > misunderstand the convention. AFAIU, in python, a leading *single* underscore means "private". Double underscore is generally used for "special" symbols. These may be symbols that have a special meaning for the python interpreter itself or are just special by convention. (Documentation, meta-information etc.) |
|
From: Dave <da...@gm...> - 2006-01-05 20:06:36
|
On 1/4/06, Christopher Barker <Chr...@no...> wrote: > > Dave wrote: > > Also, unrelated but is there a property I can check once using > matplotlib to > > get the version information (something like matplotlib.version)? > > matplotlib.__version__ > > this has become something of a python standard. > Thanks Chris! I'm using ipython -- why suffer with anything else;-) -- and I use tab completion to see namespace properties. I have it set to filter out double-underscore names on the assumption that these are intended to be private by convention. It seems to me that __version__ should not be double-underscored unless I misunderstand the convention. Anyway it works and I will certainly remember it now. As soon as i type matplotlib.__v(tab= ) it shows up. My version is 0.81 for those who can't handle suspense. Originally my question was about how to handle line properties when using psd and other higher-level plotting routines. I figured out how to set the= m manually by keeping a reference to the axis before plotting and then manually adjusting things one item at a time. It's wordy but works fine. I see now there is a setp() function that should help with this but I still have to get the lines from the axes object first. Directly setting these properties in psd would be much cleaner in common use cases I think. I looked in to how to improve this for psd and csd at least. It turns out to be trivial to add. I just added '**kwargs' to the parameter lists of ps= d def and to it's call to plot(). this is in file axes.py. This way the extra keywords just get passed along. I don't know how to submit a patch but could this be added to psd and csd functions? I also don't know if there would be any side effects so it might need to be checked a bit more carefuly. -- Dave |
|
From: Christopher B. <Chr...@no...> - 2006-01-05 19:43:08
|
John Hunter wrote:
> To rectify this, I've been wanting to improve the drawing model, eg
> along the line of enthought's kiva.
This sounds like a great idea -- why not use Kiva itself (or a fork)?
I'm looking forward this in any case.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: Eric E. <ems...@ob...> - 2006-01-05 15:54:20
|
Hi, how would you do a scatter plot using "plusses". I see that "plot" can do that using '+' but then how do you change the size of these plusses? It seems to me that the symbol list for "scatter" is rather limited (why not extending it with the plot marker options?) Thanks! Eric |
|
From: John H. <jdh...@ac...> - 2006-01-05 01:57:52
|
>>>>> "Graeme" == Graeme Lufkin <gra...@gm...> writes:
Graeme> Matplotlib wraps the Antigrain library quite nicely,
Graeme> and now I'd like to use the bindings for my own nefarious
Graeme> purposes. Right now, what I'd like is to create a
There are two ways to do this (using matplotlib, Chris already pointed
you to the effbot wrappers). One is to use the RendererAgg as you
discussed, another is to use the matplotlib.agg drawing module, which
is not currently used by matplotlib but is slated to replace backend
agg at some point to give agg users the ability to make arbitrary agg
draws on the canvas.
BackendAgg uses the GTk drawing API, as do all matplotlib backends.
This is a little unfortunate, since the GTK drawing model is not as
good as postscript, SVG, display PDF, or agg (all of which are pretty
similar). Call it a historical accidcent by some developer who knew
GTk but not a lot about drawing APIs.
To rectify this, I've been wanting to improve the drawing model, eg
along the line of enthought's kiva. In taking some first steps in
this direction, I exposed a good bit of agg in the matplotlib.agg
module. Unfortunately, it is not really documented and you pretty
much have to know agg to use it. But there is an example:
Once you've drawn your agg pixel buffer, you'll need to transfer it to
your canvas using string or buffer methods:
# this example uses the agg python module directly there is no
# documentation -- you have to know how to use the agg c++ API to use
# it
import matplotlib.agg as agg
from math import pi
## Define some colors
red = agg.rgba8(255,0,0,255)
blue = agg.rgba8(0,0,255,255)
green = agg.rgba8(0,255,0,255)
black = agg.rgba8(0,0,0,255)
white = agg.rgba8(255,255,255,255)
yellow = agg.rgba8(192,192,255,255)
## Create the rendering buffer, rasterizer, etc
width, height = 600,400
stride = width*4
buffer = agg.buffer(width, height, stride)
rbuf = agg.rendering_buffer()
rbuf.attachb(buffer)
pf = agg.pixel_format_rgba(rbuf)
rbase = agg.renderer_base_rgba(pf)
rbase.clear_rgba8(blue)
renderer = agg.renderer_scanline_aa_solid_rgba(rbase);
renderer.color_rgba8( red )
rasterizer = agg.rasterizer_scanline_aa()
scanline = agg.scanline_p8()
## A polygon path
path = agg.path_storage()
path.move_to(10,10)
path.line_to(100,100)
path.line_to(200,200)
path.line_to(100,200)
path.close_polygon()
# stroke it
stroke = agg.conv_stroke_path(path)
stroke.width(3.0)
rasterizer.add_path(stroke)
agg.render_scanlines_rgba(rasterizer, scanline, renderer);
## A curved path
path = agg.path_storage()
path.move_to(200,10)
path.line_to(350,50)
path.curve3(150,200)
path.curve3(100,70)
path.close_polygon()
curve = agg.conv_curve_path(path)
# fill it
rasterizer.add_path(curve)
renderer.color_rgba8( green )
agg.render_scanlines_rgba(rasterizer, scanline, renderer);
# and stroke it
stroke = agg.conv_stroke_curve(curve)
stroke.width(5.0)
rasterizer.add_path(stroke)
renderer.color_rgba8( yellow )
agg.render_scanlines_rgba(rasterizer, scanline, renderer);
## Transforming a path
path = agg.path_storage()
path.move_to(0,0)
path.line_to(1,0)
path.line_to(1,1)
path.line_to(0,1)
path.close_polygon()
rotation = agg.trans_affine_rotation(pi/4)
scaling = agg.trans_affine_scaling(30,30)
translation = agg.trans_affine_translation(300,300)
trans = rotation*scaling*translation
transpath = agg.conv_transform_path(path, trans)
stroke = agg.conv_stroke_transpath(transpath)
stroke.width(2.0)
rasterizer.add_path(stroke)
renderer.color_rgba8( black )
agg.render_scanlines_rgba(rasterizer, scanline, renderer);
## Converting a transformed path to a curve
path = agg.path_storage()
path.move_to(0,0)
path.curve3(1,0)
path.curve3(1,1)
path.curve3(0,1)
path.close_polygon()
rotation = agg.trans_affine_rotation(pi/4)
scaling = agg.trans_affine_scaling(30,30)
translation = agg.trans_affine_translation(300,250)
trans = rotation*scaling*translation
trans.flip_y()
transpath = agg.conv_transform_path(path, trans)
curvetrans = agg.conv_curve_trans(transpath)
stroke = agg.conv_stroke_curvetrans(curvetrans)
stroke.width(2.0)
rasterizer.add_path(stroke)
renderer.color_rgba8( white )
agg.render_scanlines_rgba(rasterizer, scanline, renderer);
## Copy a rectangle from the buffer the rectangle defined by
## x0,y0->x1,y1 and paste it at xdest, ydest
x0, y0 = 10, 50
x1, y1 = 110, 190
xdest, ydest = 350, 200
widthr, heightr = x1-x0, y1-y0
strider = widthr*4
copybuffer = agg.buffer(widthr, heightr, strider)
rbufcopy = agg.rendering_buffer()
rbufcopy.attachb(copybuffer)
pfcopy = agg.pixel_format_rgba(rbufcopy)
rbasecopy = agg.renderer_base_rgba(pfcopy)
rect = agg.rect(x0, y0, x1, y1)
print rect.is_valid()
rectp = agg.rectPtr(rect)
#print dir(rbasecopy)
# agg is funny about the arguments to copy from; the last 2 args are
# dx, dy. If the src and dest buffers are the same size and you omit
# the dx and dy args, the position of the copy in the dest buffer is
# the same as in the src. Since our dest buffer is smaller than our
# src buffer, we have to offset the location by -x0, -y0
rbasecopy.copy_from(rbuf, rect, -x0, -y0);
# paste the rectangle at a new location xdest, ydest
rbase.copy_from(rbufcopy, None, xdest, ydest);
## Display it with PIL
s = buffer.to_string()
print len(s)
import Image
im = Image.fromstring( "RGBA", (width, height), s)
im.show()
|
|
From: John H. <jdh...@ac...> - 2006-01-05 01:52:36
|
>>>>> "Christian" == Christian Seberino <seb...@sp...> writes:
Christian> The first method did *not* for some reason!?!? :(
Christian> I would prefer to make the second method work because
Christian> it lets me avoid having to define a Figure object
Christian> /explicitly/ as above. The problem with adding a
Christian> subplot to a Figure object is that that many defaults
Christian> change that I would have to fix. (e.g. grid lines
Christian> disappear, plot dimensions are altered in strange way,
Christian> etc.)
Christian> How fix second way to avoid a Figure object?
This is a matplotlib bug -- in axes.py in the Axes.text function,
replace the line
if t.get_clip_on(): t.set_clip_box(self.bbox)
with
if kwargs.has_key('clip_on'): t.set_clip_box(self.bbox)
Thanks for the report!
JDH
|
|
From: John H. <jdh...@ac...> - 2006-01-05 01:51:05
|
>>>>> "Christian" == Christian Seberino <seb...@sp...> writes:
Christian> I've notice that if I (1) create a plot vs. e.g.
Christian> plot([1,2,3])
Christian> (2) explicitly add a plot to a Figure object
Christian> e.g. fig = Figure() p = fig.add_subplot(111)
Christian> plot([1,2,3])
Christian> it looks DIFFERENT?!?
Not sure what your problem is: please post complete examples. But
it looks like you are improperly mixing pylab and the OO API. If you
want to use a minimal set of pylab and use OO matplotlib for every
thing else, I recommend
import matplotlib.numerix as nx
from pylab import figure, show, close
The first command lets pylab handle figure management, the most
complex part, and the second gives you access to the numpy namespace
Here is the equivalent of the canonical pylab :
plot([1,2,3[)
using a more pythonic style:
from pylab import figure, show, close
fig = figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3])
show()
Note in your example:
fig = Figure()
p = fig.add_subplot(111)
plot([1,2,3])
You used fig.add_subplot to create an Axes, which you named "p", but
then did not use it. You would have wanted something like
p.plot([1,2,3])
JDH
|
|
From: John H. <jdh...@ac...> - 2006-01-05 01:45:59
|
>>>>> "Christian" == Christian Seberino <seb...@sp...> writes:
Christian> It appears when I use add_subplot method to add a plot
Christian> to a Figure object that it is NOT semi-logarithmic if I
Christian> use semilogy method later.
Works for me...
import matplotlib.numerix as nx
from pylab import figure, show
fig = figure()
ax = fig.add_subplot(111)
x = nx.arange(0.01, 5.0, 0.01)
y = nx.exp(-x)
ax.semilogy(x,y)
show()
|
|
From: Christian S. <seb...@sp...> - 2006-01-05 00:52:37
|
It appears when I use add_subplot method to add a plot to a Figure object that it is NOT semi-logarithmic if I use semilogy method later. how fix? Chris |
|
From: Christian S. <seb...@sp...> - 2006-01-05 00:34:13
|
I've notice that if I=20 (1) create a plot vs. e.g.=20 plot([1,2,3]) (2) explicitly add a plot to a Figure object e.g.=20 fig =3D Figure() p =3D fig.add_subplot(111) plot([1,2,3]) it looks DIFFERENT?!? (2) remove grid lines and changes ratios of axes to each other it appears. how make (1) and (2) LOOK the same? Chris |
|
From: Christopher B. <Chr...@no...> - 2006-01-04 23:06:41
|
Graeme Lufkin wrote: > Matplotlib wraps the Antigrain library quite nicely, and now I'd > like to use the bindings for my own nefarious purposes. Perhaps it would be easier to use agg-draw: http://effbot.org/downloads/#aggdraw If not, I'd love to see a general purpose python binding to Agg. Personally, I'd use it with wxPython. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |