SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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)




Showing results of 28

1 2 > >> (Page 1 of 2)
From: <jao...@gm...> - 2006年01月11日 23:51:58
On 11/01/06, John Hunter <jdh...@ac...> wrote:
>
> Hi Jose,
>
> Thanks a lot for your efforts -- 0.86 already in Fedora, now that's
> speed!
 Clearly you are the one to thank about it. ;-)
 The other person to thank is Orion (FE maintainer). :-)
> If you could write up a small blurb about where to find mpl for fedora
> with links, I'll put it in the FAQ.
 Since it is in Extras it is enough to issue from the command line as root=
:
# yum install python-matplotlib
 FWIW soon basemap will be also available using the same method:
# yum install python-basemap
> Thanks,
> JDH
 Obrigado. :-)
--
Jos=E9 Matos
From: Fernando P. <Fer...@co...> - 2006年01月11日 23:42:17
John Hunter wrote:
>>>>>>"Jos=E9" =3D=3D Jos=E9 Matos <jao...@gm...> writes:
>=20
> Jos=E9> If you or anyone else has problems with it I read this
> Jos=E9> list and although I am not its maintaineir I volunteer to
> Jos=E9> report and got those package bugs fixed In Fedora.
>=20
> Hi Jose,
>=20
> Thanks a lot for your efforts -- 0.86 already in Fedora, now that's
> speed!
>=20
> If you could write up a small blurb about where to find mpl for fedora
> with links, I'll put it in the FAQ.
I think that for Fedora 4 users, it's just
	yum install matplotlib
and whenever they do
	yum update
they'll get the newest version. These days, Fedora Extras (where matplot=
lib=20
lives, kind of like Ubuntu Universe) is officially on by default.
Cheers,
f
From: John H. <jdh...@ac...> - 2006年01月11日 23:22:04
>>>>> "Jos=E9" =3D=3D Jos=E9 Matos <jao...@gm...> writes:
 Jos=E9> If you or anyone else has problems with it I read this
 Jos=E9> list and although I am not its maintaineir I volunteer to
 Jos=E9> report and got those package bugs fixed In Fedora.
Hi Jose,
Thanks a lot for your efforts -- 0.86 already in Fedora, now that's
speed!
If you could write up a small blurb about where to find mpl for fedora
with links, I'll put it in the FAQ.
Thanks,
JDH
From: <jao...@gm...> - 2006年01月11日 23:03:12
On 11/01/06, Derrick Snowden <Der...@no...> wrote:
> Thanks Charlie, that was it.
>
> yum install gtk2-devel
>
> did the trick. Incidentally I found python-matplotlib-0.85 at the
> fedora extras repo. If I remembered that it certainly would have made
> things easier. Oh well, now I have 0.86.
 0.86 should be soon there as well. It was build already and it only
needs to be signed. (AFAIK)
 If you or anyone else has problems with it I read this list and
although I am not its maintaineir I volunteer to report and got those
package bugs fixed In Fedora.
> Thanks all who replied.
>
> Derrick
--
Jos=E9 Matos
From: Derrick S. <Der...@no...> - 2006年01月11日 22:55:06
Attachments: Derrick.Snowden.vcf
Thanks Charlie, that was it. 
yum install gtk2-devel
did the trick. Incidentally I found python-matplotlib-0.85 at the 
fedora extras repo. If I remembered that it certainly would have made 
things easier. Oh well, now I have 0.86.
Thanks all who replied.
Derrick
Charlie Moad wrote:
>Those should really be part of the gtk2-dev packages. At least they
>are on ubuntu.
>
>/usr/include/gtk-2.0/gtk/gtk.h
>
>On 1/11/06, Derrick Snowden <Der...@no...> wrote:
> 
>
>>Hi all,
>>
>>I'm trying to install mpl (I've tried both 0.86 and 0.85) on an x86_64
>>machine running Fedora Core 4. I saw one post related to gtk but it
>>referred to a problem different from mine. Below is the last few lines
>>from stderr...
>>
>> > python setup.py build
>>
>>....
>>
>>In file included from src/_nc_backend_gdk.c:12:
>>/usr/include/pygtk-2.0/pygtk/pygtk.h:8:21: error: gtk/gtk.h: No such
>>file or directory
>>In file included from src/_nc_backend_gdk.c:12:
>>/usr/include/pygtk-2.0/pygtk/pygtk.h:14: error: syntax error before 'atom'
>>/usr/include/pygtk-2.0/pygtk/pygtk.h:16: error: syntax error before
>>'GdkRectangle'
>>/usr/include/pygtk-2.0/pygtk/pygtk.h:23: error: syntax error before
>>'GdkAtom'
>>/usr/include/pygtk-2.0/pygtk/pygtk.h:23: warning: no semicolon at end of
>>struct or union
>>/usr/include/pygtk-2.0/pygtk/pygtk.h:24: warning: data definition has no
>>type or storage class
>>src/_nc_backend_gdk.c: In function 'pixbuf_get_pixels_array':
>>src/_nc_backend_gdk.c:32: error: 'GdkPixbuf' undeclared (first use in
>>this function)
>>src/_nc_backend_gdk.c:32: error: (Each undeclared identifier is reported
>>only once
>>src/_nc_backend_gdk.c:32: error: for each function it appears in.)
>>src/_nc_backend_gdk.c:32: error: 'gdk_pixbuf' undeclared (first use in
>>this function)
>>src/_nc_backend_gdk.c:52: warning: cast to pointer from integer of
>>different size
>>error: command 'gcc' failed with exit status 1
>>
>>Now the second line up above says I need gtk.h, which much to my
>>surprise is nowhere on my system. I have gtk2 and gtk+ devel rpms
>>installed and numerous other gtk related packages including pygtk. Is it
>>possible that pygtk installed correctly without gtk or am I missing
>>something subtle (or completely obvious).
>>
>>Thanks for any help,
>>Derrick
>>
>>--
>>Derrick Snowden
>>PhOD/AOML/NOAA
>>4301 Rickenbacker Causeway
>>Miami, FL 33149
>>Office: 305.361.4322 Fax: 305.361.4392
>>
>>
>>
>>
>> 
>>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
>for problems? Stop! Download the new AJAX search engine that makes
>searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
>http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> 
>
-- 
Derrick Snowden
PhOD/AOML/NOAA
4301 Rickenbacker Causeway
Miami, FL 33149
Office: 305.361.4322 Fax: 305.361.4392
From: John H. <jdh...@ac...> - 2006年01月11日 22:42:28
>>>>> "Charles" == Charles R Twardy <ct...@gm...> writes:
 Charles> John, Thanks, that did it. I don't really need to blend
 Charles> though. What I need it taken care of by:
 trans = blend_xy_sep_transform(ax.transAxes, ax.transAxes)
This is basically a no-op; if the axes transform is the one you want,
just use it
 ax.text(0.5, 1, "My Title", ha='center', va='top',transform=ax.transAxes)
My example placed the text below the ticks, which is where the data
component came in.
JDH
From: Charles R. T. <ct...@gm...> - 2006年01月11日 22:10:18
John,
Thanks, that did it. I don't really need to blend though. What I
need it taken care of by:
#trans =3D blend_xy_sep_transform(ax.transData, ax.transAxes)
trans =3D blend_xy_sep_transform(ax.transAxes, ax.transAxes)
scale =3D fig.dpi/Value(72.) # points -> pixels
point_trans =3D scale_transform(scale, scale)
trans.set_offset((0,-ticksize-2),point_trans)
ax.text(0.5, 1, "My Title", ha=3D'center', va=3D'top', transform=3Dtrans)
It seems a bit silly to call the blend_xy transform for that (since
I'm using transAxes for both x and y), but copy.copy doesn't work, so
there we are.
Thanks again.
-C
On 1/11/06, John Hunter <jdh...@ni...> wrote:
> >>>>> "Charles" =3D=3D Charles R Twardy <ct...@gm...> writes:
>
> Charles> I don't think so. I looked at that. Maybe I'm mistaken,
> Charles> but seems that in the end, it just places the text at y
> Charles> position 0.9 in Axes coordinates. That's just below the
> Charles> markers for small subplots, but WAY below the markers for
> Charles> tall skinny ones. I want it to place the text at a fixed
> Charles> absolute y position of just below the markers. As the
> Charles> graph gets taller, that will go from .9 to .95 to .99,
> Charles> etc. in Axes coordinates.
>
> Charles> So one approach would be to find the Axes coordinates for
> Charles> the lower limit of the tick markers. Any ideas?
>
> This is a bit tricky but doable. The transformation that places the
> xticks is a "blend" of the data transform and the axes transform, in
> that the x value of the x ticks is a data coord, and the y value is an
> axes coord(0 is bottom, 1 is top). The transform module provides a
> helper function to build such a beast
>
> from matplotlib.transforms import blend_xy_sep_transform
> trans =3D blend_xy_sep_transform(ax.transData, ax.transAxes)
>
>
> If you then make a call to text
>
> ax.text(.2,1,'hi mom', transform=3Dtrans)
>
> it will be placed at the top of the yaxis at 0.2 on the xaxis.
>
>
> What you want to do is offset this by a couple of points below the
> tick like. To do this, you need to set an offset on the transform,
> where the coordinates of the offset are in points. The offset is
> always an xy tuple with a transform to transform that tuple into
> figure coords. In the case of points, you want to do
>
>
> scale =3D fig.dpi/Value(72.) # points -> pixels
> point_trans =3D scale_transform(scale, scale)
> trans.set_offset((0,-ticksize-2),point_trans)
>
>
>
> Here is a complete example: now when you resize the figure window or
> pan/zoom your text will remain 2 points below the ticks...
>
> from matplotlib import rcParams
> import matplotlib.numerix as nx
> from pylab import figure, show
> from matplotlib.transforms import blend_xy_sep_transform, Value, scale_tr=
ansform
>
> ticksize =3D rcParams['xtick.major.size']
>
> fig =3D figure()
> ax =3D fig.add_subplot(111)
> x,y =3D nx.mlab.rand(2,100)
> ax.plot(x,y)
> locs =3D nx.arange(0,1.0,0.2)
> ax.set_xticks(locs)
>
>
> trans =3D blend_xy_sep_transform(ax.transData, ax.transAxes)
> scale =3D fig.dpi/Value(72.) # points -> pixels
> point_trans =3D scale_transform(scale, scale)
>
> # the offset is an xy tup and a transformation instance for that tuple
> trans.set_offset((0,-ticksize-2),point_trans)
>
> for loc in locs:
> ax.text(loc,1,'%1.1f'%loc, transform=3Dtrans, va=3D'top', ha=3D'cente=
r')
> show()
>
>
--
Charles R. Twardy
From: Charlie M. <cw...@gm...> - 2006年01月11日 22:08:36
Those should really be part of the gtk2-dev packages. At least they
are on ubuntu.
/usr/include/gtk-2.0/gtk/gtk.h
On 1/11/06, Derrick Snowden <Der...@no...> wrote:
> Hi all,
>
> I'm trying to install mpl (I've tried both 0.86 and 0.85) on an x86_64
> machine running Fedora Core 4. I saw one post related to gtk but it
> referred to a problem different from mine. Below is the last few lines
> from stderr...
>
> > python setup.py build
>
> ....
>
> In file included from src/_nc_backend_gdk.c:12:
> /usr/include/pygtk-2.0/pygtk/pygtk.h:8:21: error: gtk/gtk.h: No such
> file or directory
> In file included from src/_nc_backend_gdk.c:12:
> /usr/include/pygtk-2.0/pygtk/pygtk.h:14: error: syntax error before 'atom=
'
> /usr/include/pygtk-2.0/pygtk/pygtk.h:16: error: syntax error before
> 'GdkRectangle'
> /usr/include/pygtk-2.0/pygtk/pygtk.h:23: error: syntax error before
> 'GdkAtom'
> /usr/include/pygtk-2.0/pygtk/pygtk.h:23: warning: no semicolon at end of
> struct or union
> /usr/include/pygtk-2.0/pygtk/pygtk.h:24: warning: data definition has no
> type or storage class
> src/_nc_backend_gdk.c: In function 'pixbuf_get_pixels_array':
> src/_nc_backend_gdk.c:32: error: 'GdkPixbuf' undeclared (first use in
> this function)
> src/_nc_backend_gdk.c:32: error: (Each undeclared identifier is reported
> only once
> src/_nc_backend_gdk.c:32: error: for each function it appears in.)
> src/_nc_backend_gdk.c:32: error: 'gdk_pixbuf' undeclared (first use in
> this function)
> src/_nc_backend_gdk.c:52: warning: cast to pointer from integer of
> different size
> error: command 'gcc' failed with exit status 1
>
> Now the second line up above says I need gtk.h, which much to my
> surprise is nowhere on my system. I have gtk2 and gtk+ devel rpms
> installed and numerous other gtk related packages including pygtk. Is it
> possible that pygtk installed correctly without gtk or am I missing
> something subtle (or completely obvious).
>
> Thanks for any help,
> Derrick
>
> --
> Derrick Snowden
> PhOD/AOML/NOAA
> 4301 Rickenbacker Causeway
> Miami, FL 33149
> Office: 305.361.4322 Fax: 305.361.4392
>
>
>
>
From: Charlie M. <cw...@gm...> - 2006年01月11日 22:04:17
> > That and the are a pain to maintain.
>
> Why's that? I do have a little patch to setup.py and friends to add the
> StaticLibs path, but that's it. I keep meaning to give that patch to
> John, but haven't gotten around to it.
I was building against frameworks of libpng and freetype. It was the
more mac way of doing things, but took a little more effort.
> > I have been
> > playing with eggs lately and prefer them.
>
> Maybe it's time to look into that. How do you install an egg?
Once you install setuptools, there is a command line tool called
easy_install. Its name doesn't do it justice. You can pass easy
install a module name and it will look on the cheeseshop. You can
pass a source url and it will download, build, and install it. You
can pass it a local directory pointing to a source. You get the
pattern. It has a lot of logic built in and does the right thing 99%
of the time.
> > I usually stick with Apple's bundled python. I also build for wx and
> > tk since both come with tiger.
>
> Are you building Tiger only then? Damn, there are a lot of python+OS-X
> combinations to support! Also the wx version that comes with Tiger is
> pretty old, so I'm not sure how helpful that is. Boy, this is a pain!
I don't have access to 10.3.
> I really think the Python-OS-X community needs to have a fairly unified
> pile of packages to install. pythonmac.org is a good place for them,
> only because it's there. My goal is to have a MPL that works with the
> other packages there, so you can do one stop shopping. I'm running 10.3,
> so I currently build versions for Apple's 2.3 and Bob I's 2.4.1. Both of
> those have Numeric, numarray and wxPython packages on that site. Those
> need some updating, but they are there.
I am willing to help, but osx is not my primary/only target. This is
another reason I like eggs. They work great on osx/linux/windows.
From: Derrick S. <Der...@no...> - 2006年01月11日 21:56:23
Attachments: Derrick.Snowden.vcf
Hi all,
I'm trying to install mpl (I've tried both 0.86 and 0.85) on an x86_64=20
machine running Fedora Core 4. I saw one post related to gtk but it=20
referred to a problem different from mine. Below is the last few lines=20
from stderr...
 > python setup.py build
....
In file included from src/_nc_backend_gdk.c:12:
/usr/include/pygtk-2.0/pygtk/pygtk.h:8:21: error: gtk/gtk.h: No such=20
file or directory
In file included from src/_nc_backend_gdk.c:12:
/usr/include/pygtk-2.0/pygtk/pygtk.h:14: error: syntax error before =91at=
om=92
/usr/include/pygtk-2.0/pygtk/pygtk.h:16: error: syntax error before=20
=91GdkRectangle=92
/usr/include/pygtk-2.0/pygtk/pygtk.h:23: error: syntax error before=20
=91GdkAtom=92
/usr/include/pygtk-2.0/pygtk/pygtk.h:23: warning: no semicolon at end of=20
struct or union
/usr/include/pygtk-2.0/pygtk/pygtk.h:24: warning: data definition has no=20
type or storage class
src/_nc_backend_gdk.c: In function =91pixbuf_get_pixels_array=92:
src/_nc_backend_gdk.c:32: error: =91GdkPixbuf=92 undeclared (first use in=
=20
this function)
src/_nc_backend_gdk.c:32: error: (Each undeclared identifier is reported=20
only once
src/_nc_backend_gdk.c:32: error: for each function it appears in.)
src/_nc_backend_gdk.c:32: error: =91gdk_pixbuf=92 undeclared (first use i=
n=20
this function)
src/_nc_backend_gdk.c:52: warning: cast to pointer from integer of=20
different size
error: command 'gcc' failed with exit status 1
Now the second line up above says I need gtk.h, which much to my=20
surprise is nowhere on my system. I have gtk2 and gtk+ devel rpms=20
installed and numerous other gtk related packages including pygtk. Is it=20
possible that pygtk installed correctly without gtk or am I missing=20
something subtle (or completely obvious).
Thanks for any help,
Derrick
--=20
Derrick Snowden
PhOD/AOML/NOAA
4301 Rickenbacker Causeway
Miami, FL 33149
Office: 305.361.4322 Fax: 305.361.4392
From: Christopher B. <Chr...@no...> - 2006年01月11日 21:50:51
Charlie Moad wrote:
> I was maintaining mpkgs here:
> http://sda.iu.edu/links.shtml?prim=lab_links, but they are a little
> out of date.
Mine too. I almost got 0.85 built, and then you went and released 0.86!
 > That and the are a pain to maintain.
Why's that? I do have a little patch to setup.py and friends to add the 
StaticLibs path, but that's it. I keep meaning to give that patch to 
John, but haven't gotten around to it.
> I have been
> playing with eggs lately and prefer them.
Maybe it's time to look into that. How do you install an egg?
 > You can
> check them out here, http://euclid.uits.iupui.edu/~cmoad/mpleggs/
will do.
> I usually stick with Apple's bundled python. I also build for wx and
> tk since both come with tiger.
Are you building Tiger only then? Damn, there are a lot of python+OS-X 
combinations to support! Also the wx version that comes with Tiger is 
pretty old, so I'm not sure how helpful that is. Boy, this is a pain!
> I don't really have a preference on
> numerix.
I try to support both Numeric and numarray, but I'll be adding numpy soon.
I really think the Python-OS-X community needs to have a fairly unified 
pile of packages to install. pythonmac.org is a good place for them, 
only because it's there. My goal is to have a MPL that works with the 
other packages there, so you can do one stop shopping. I'm running 10.3, 
so I currently build versions for Apple's 2.3 and Bob I's 2.4.1. Both of 
those have Numeric, numarray and wxPython packages on that site. Those 
need some updating, but they are there.
If the three of us could come up with a unified way to build these, and 
get that way into the official MPL setup.py, then it should be easy to 
maintain: download the latest tarball and run a script. (OK, then debug 
the problems, but what can you do?)
-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: Charles R. T. <ct...@gm...> - 2006年01月11日 21:38:38
Nic,
I downloaded NetworkX from sourceforge and unpacked it. Then:
cd networkx-0.26
python setup.py build && sudo python setup.py install
cd doc/examples
python draw_colors.py
It ran fine.
I changed the code to avoid all the "import *". Try this?
#!/usr/bin/env python
"""
Draw a graph with matplotlib.
You must have matplotlib for this to work.
"""
__author__ =3D """Aric Hagberg (ha...@la...)"""
__date__ =3D "$Date: 2005年03月22日 13:57:46 -0700 (2005年3月22日) $"
__credits__ =3D """"""
__revision__ =3D "$Revision: 831 $"
# Copyright (C) 2004 by
# Aric Hagberg <ha...@la...>
# Dan Schult <ds...@co...>
# Pieter Swart <sw...@la...>
# Distributed under the terms of the GNU Lesser General Public License
# http://www.gnu.org/copyleft/lesser.html
try:
 import pylab
except:
 print "pylab not found: see https://networkx.lanl.gov/Drawing.html for =
info"
 raise
import networkx as net
G =3D net.grid_2d_graph(4,4) #4x4 grid
pos =3D net.spring_layout(G)
net.draw(G,pos,alpha=3D0.5,with_labels=3DFalse)
net.draw(G,pos,nodelist=3D[1,2,3,4],node_color=3D'b') # blue
pylab.savefig("grid.png") # save as png
pylab.show() # display
--
Charles R. Twardy
From: Charlie M. <cw...@gm...> - 2006年01月11日 21:23:08
On 1/11/06, Christopher Barker <Chr...@no...> wrote:
> Christopher Fonnesbeck wrote:
> > wx has always given me headaches, so I dont bother with it anymore.
> > Since ActivePython 2.4.2 for Mac already comes with Tk, I just try and
> > make sure it works for TkAgg.
>
> well, I need wx, so that's a given for me. I never use TK, but I want to
> support it.
>
> Will the same package work for the ActivePython install as the "official
> unoffical" one, or do we need different installers? Also, does
> activestate provide a place to put packages built for their distro?
>
> > I just need a portable matplotlib installer, as my MCMC module require=
s
> > it. I have been generating eggs out of convenience, but I am not
> > married to the format (in fact, I have been generating mpkg installers
> > as well.
>
> I've been doing only mpkg. What advantage do Eggs have? I kind of like
> using the native OS-X way -- users know what to do with them.
>
> Have you had to do any hacks to the setup.py and friends?
>
> What do you do with libpng and libfreetype?
I was maintaining mpkgs here,
http://sda.iu.edu/links.shtml?prim=3Dlab_links, but they are a little
out of date. That and the are a pain to maintain. I have been
playing with eggs lately and prefer them. I include libpng and
freetype statically in the egg, and it seems to work for me. You can
check them out here, http://euclid.uits.iupui.edu/~cmoad/mpleggs/, if
you want.
I usually stick with Apple's bundled python. I also build for wx and
tk since both come with tiger. I don't really have a preference on
numerix.
From: Christopher B. <Chr...@no...> - 2006年01月11日 20:31:28
Christopher Fonnesbeck wrote:
> wx has always given me headaches, so I dont bother with it anymore. 
> Since ActivePython 2.4.2 for Mac already comes with Tk, I just try and 
> make sure it works for TkAgg.
well, I need wx, so that's a given for me. I never use TK, but I want to 
support it.
Will the same package work for the ActivePython install as the "official 
unoffical" one, or do we need different installers? Also, does 
activestate provide a place to put packages built for their distro?
> I just need a portable matplotlib installer, as my MCMC module requires 
> it. I have been generating eggs out of convenience, but I am not 
> married to the format (in fact, I have been generating mpkg installers 
> as well.
I've been doing only mpkg. What advantage do Eggs have? I kind of like 
using the native OS-X way -- users know what to do with them.
Have you had to do any hacks to the setup.py and friends?
What do you do with libpng and libfreetype?
-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: Christopher F. <ch...@tr...> - 2006年01月11日 19:42:39
Attachments: smime.p7s
On Jan 11, 2006, at 2:14 PM, Christopher Barker wrote:
> The way I'm doing it, I'm statically linking libfreetype and 
> libpng, so that we end up with a stand-along module that works on 
> any OS-X (10.3 an above, anyway). I've made one for the Apple 
> supplied 2.3 or the framework build 2.4.1.
>
> It supports wx, tk, and Agg. It doesn't support GTK, because I 
> don't know of a GTK package that is built outside of fink or 
> darwinports.
wx has always given me headaches, so I dont bother with it anymore. 
Since ActivePython 2.4.2 for Mac already comes with Tk, I just try 
and make sure it works for TkAgg.
>
> Do you guys have similar goals? is it time to use Eggs? I have no 
> particular desire to do this, but I do want a point+click installer 
> that the folks I work with can use.
I just need a portable matplotlib installer, as my MCMC module 
requires it. I have been generating eggs out of convenience, but I am 
not married to the format (in fact, I have been generating mpkg 
installers as well.
C.
--
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 B. <Chr...@no...> - 2006年01月11日 19:14:41
> On 1/11/06, Christopher Fonnesbeck <ch...@tr...> wrote:
> 
>>I have built some matplotlib installers for OSX.
I've been working on this too. It's be nice if we coordinated our 
efforts, and got a single package up on pythonmac.org/packages.
The way I'm doing it, I'm statically linking libfreetype and libpng, so 
that we end up with a stand-along module that works on any OS-X (10.3 an 
above, anyway). I've made one for the Apple supplied 2.3 or the 
framework build 2.4.1.
It supports wx, tk, and Agg. It doesn't support GTK, because I don't 
know of a GTK package that is built outside of fink or darwinports.
Do you guys have similar goals? is it time to use Eggs? I have no 
particular desire to do this, but I do want a point+click installer that 
the folks I work with can use.
-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: Charlie M. <cw...@gm...> - 2006年01月11日 17:43:15
With the new setuptools support it is assumed that if you have
setuptools installed, you are going to use it. Hence, if you run
bdist with setuptools installed, the mpl-data folder will get stuck in
the wrong place. You shouldn't be able to do the reverse since you
can't run bdist_egg without setuptools. In any case, the mpl-data
folder should ALWAYS be put inside the matplotlib module folder. This
is where it is found at runtime.
On 1/11/06, Christopher Fonnesbeck <ch...@tr...> wrote:
> I have built some matplotlib installers for OSX, but some users are
> running into problems running them afterwards:
>
> >>> from pylab import *
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2 .4/site-packages/pylab.py", line 1, in ?
> from matplotlib.pylab import *
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/matplotlib/__i nit__.py", line 620, in ?
> defaultParams =3D {
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/matplotlib/__i nit__.py", line 266, in wrapper
> ret =3D func(*args, **kwargs)
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
> python2.4/site-packages/matplotlib/__i nit__.py", line 427, in
> _get_data_path
> raise RuntimeError('Could not find the matplotlib data files')
> RuntimeError: Could not find the matplotlib data files
>
> It appears that the mpl.fata subdirectory is missing; is there any
> way of ensuring that everything is included in the installer?
>
> Thanks,
> C.
>
> --
> 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月11日 17:12:27
Attachments: smime.p7s
I have built some matplotlib installers for OSX, but some users are 
running into problems running them afterwards:
 >>> from pylab import *
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2 .4/site-packages/pylab.py", line 1, in ?
 from matplotlib.pylab import *
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/matplotlib/__i nit__.py", line 620, in ?
 defaultParams = {
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/matplotlib/__i nit__.py", line 266, in wrapper
 ret = func(*args, **kwargs)
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/matplotlib/__i nit__.py", line 427, in 
_get_data_path
 raise RuntimeError('Could not find the matplotlib data files')
RuntimeError: Could not find the matplotlib data files
It appears that the mpl.fata subdirectory is missing; is there any 
way of ensuring that everything is included in the installer?
Thanks,
C.
--
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
Ahah, I just blindly copied the format string from the manual, which
contains a typo.
The format string in the manual: %b %d.
What it should be: %b %y (might want to change this in the manual sometime
so that fig 5.2 is correct). This will get you jan 92, feb 92, mar 92 and s=
o
on.
For full details on all the date format strings, see
http://docs.python.org/lib/module-time.html
BTW, very slick how easy the labels can be rotated!
Mark
On 1/11/06, John Hunter <jdh...@ac...> wrote:
>
> >>>>> "Mark" =3D=3D Mark Bakker <ma...@gm...> writes:
>
> Mark> Hello all - I tried to have dates along the x-axis and tried
> Mark> to plot it in the month-year format. There is a nice
> Mark> example in Fig. 5.2 of the manual.
>
> Mark> Problem is, the year always plots as year 01, even in
> Mark> Fig. 5.2! Check it out.
>
> Mark> I just tried this on 0.86, and it is still wrong.
>
> Mark> Easy to fix? Easy workaround?
>
> Look at the function matplotlib.dates.date_ticker_factory, which looks
> at the date range of your axis and returns a locator and date string
> formatter.
>
> There must be an error in one of the format strings. I don't have
> time to look at it right now, but it is fairly easy to grok the code.
> Sometimes these errors occur just if we accidentally used an upper
> case letter in a format string or vice versa...
>
> I you hurry, you can probably send a fix in time for the 0.86.1
> bugfix release :-)
>
>
> JDH
>
From: John H. <jdh...@ac...> - 2006年01月11日 15:07:11
>>>>> "Charles" == Charles R Twardy <ct...@gm...> writes:
 Charles> I don't think so. I looked at that. Maybe I'm mistaken,
 Charles> but seems that in the end, it just places the text at y
 Charles> position 0.9 in Axes coordinates. That's just below the
 Charles> markers for small subplots, but WAY below the markers for
 Charles> tall skinny ones. I want it to place the text at a fixed
 Charles> absolute y position of just below the markers. As the
 Charles> graph gets taller, that will go from .9 to .95 to .99,
 Charles> etc. in Axes coordinates.
 Charles> So one approach would be to find the Axes coordinates for
 Charles> the lower limit of the tick markers. Any ideas?
This is a bit tricky but doable. The transformation that places the
xticks is a "blend" of the data transform and the axes transform, in
that the x value of the x ticks is a data coord, and the y value is an
axes coord(0 is bottom, 1 is top). The transform module provides a
helper function to build such a beast
 from matplotlib.transforms import blend_xy_sep_transform
 trans = blend_xy_sep_transform(ax.transData, ax.transAxes)
If you then make a call to text
 ax.text(.2,1,'hi mom', transform=trans) 
it will be placed at the top of the yaxis at 0.2 on the xaxis.
What you want to do is offset this by a couple of points below the
tick like. To do this, you need to set an offset on the transform,
where the coordinates of the offset are in points. The offset is
always an xy tuple with a transform to transform that tuple into
figure coords. In the case of points, you want to do
 scale = fig.dpi/Value(72.) # points -> pixels
 point_trans = scale_transform(scale, scale)
 trans.set_offset((0,-ticksize-2),point_trans)
Here is a complete example: now when you resize the figure window or
pan/zoom your text will remain 2 points below the ticks...
from matplotlib import rcParams
import matplotlib.numerix as nx
from pylab import figure, show
from matplotlib.transforms import blend_xy_sep_transform, Value, scale_transform
ticksize = rcParams['xtick.major.size']
fig = figure()
ax = fig.add_subplot(111)
x,y = nx.mlab.rand(2,100)
ax.plot(x,y)
locs = nx.arange(0,1.0,0.2)
ax.set_xticks(locs)
trans = blend_xy_sep_transform(ax.transData, ax.transAxes)
scale = fig.dpi/Value(72.) # points -> pixels
point_trans = scale_transform(scale, scale)
# the offset is an xy tup and a transformation instance for that tuple
trans.set_offset((0,-ticksize-2),point_trans)
for loc in locs:
 ax.text(loc,1,'%1.1f'%loc, transform=trans, va='top', ha='center')
show()
From: John H. <jdh...@ac...> - 2006年01月11日 14:40:31
>>>>> "Mark" == Mark Bakker <ma...@gm...> writes:
 Mark> Hello all - I tried to have dates along the x-axis and tried
 Mark> to plot it in the month-year format. There is a nice
 Mark> example in Fig. 5.2 of the manual.
 Mark> Problem is, the year always plots as year 01, even in
 Mark> Fig. 5.2! Check it out.
 Mark> I just tried this on 0.86, and it is still wrong.
 Mark> Easy to fix? Easy workaround?
Look at the function matplotlib.dates.date_ticker_factory, which looks
at the date range of your axis and returns a locator and date string
formatter.
There must be an error in one of the format strings. I don't have
time to look at it right now, but it is fairly easy to grok the code.
Sometimes these errors occur just if we accidentally used an upper
case letter in a format string or vice versa...
I you hurry, you can probably send a fix in time for the 0.86.1
bugfix release :-)
JDH
From: Mark B. <ma...@gm...> - 2006年01月11日 14:05:09
Hello all -
I tried to have dates along the x-axis and tried to plot it in the
month-year format.
There is a nice example in Fig. 5.2 of the manual.
Problem is, the year always plots as year 01, even in Fig. 5.2!
Check it out.
I just tried this on 0.86, and it is still wrong.
Easy to fix? Easy workaround?
Thanks, Mark
From: Charles R. T. <ct...@gm...> - 2006年01月11日 13:20:11
> http://www.scipy.org/wikis/topical_software/Transformations
>
> Does this help with your problem?
Jouni,
I don't think so. I looked at that. Maybe I'm mistaken, but seems
that in the end, it just places the text at y position 0.9 in Axes
coordinates. That's just below the markers for small subplots, but
WAY below the markers for tall skinny ones. I want it to place the
text at a fixed absolute y position of just below the markers. As the
graph gets taller, that will go from .9 to .95 to .99, etc. in Axes
coordinates.
So one approach would be to find the Axes coordinates for the lower
limit of the tick markers. Any ideas?
-C
--
Charles R. Twardy
From: Giandomenico S. <gia...@po...> - 2006年01月11日 09:27:50
Hi, 
Many thanks.
I tried to use this new code, but nothing to do.
The error remains the same.
DO you have other suggestions please?
Thanks.
Nico
Il giorno mar, 10/01/2006 alle 14.20 -0500, Charles R. Twardy ha
scritto: 
> (first reply mistakenly went only to Giandomenico)
> 
> Hi,
> 
> I have a guess. I didn't download NetworkX to give it a try, but both
> pylab and networkx have draw() functions, and the example just does a
> "from blah import *" for both. At a guess, the pylab draw() function
> is clobbering the intended NetworkX draw() function. Try this:
> 
> try:
> import pylab # DON'T DO: from pylab import *
> except:
> print "pylab not found: see
https://networkx.lanl.gov/Drawing.html for info"
> raise
> 
> from networkx import *
> 
> G=grid_2d_graph(4,4) #4x4 grid
> pos=spring_layout(G)
> draw(G,pos,alpha=0.5,with_labels=False)
> draw(G,pos,nodelist=[1,2,3,4],node_color='b') # blue
> pylab.savefig("grid.png") # save as png
> pylab.show() # display
> 
> 
> 
> > File "draw_colors.py", line 27, in ?
> > draw(G,pos,node_color=array([G.degree(v) for v in G]))
> > TypeError: draw() takes exactly 1 non-keyword argument (2 given)
> 
> --
> Charles R. Twardy
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD
SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: G. S. <g....@po...> - 2006年01月11日 09:27:13
Hi, 
Many thanks.
I tried to use this new code, but nothing to do.
The error remains the same.
DO you have other suggestions please?
Thanks.
Nico
Il giorno mar, 10/01/2006 alle 14.20 -0500, Charles R. Twardy ha
scritto: 
> (first reply mistakenly went only to Giandomenico)
> 
> Hi,
> 
> I have a guess. I didn't download NetworkX to give it a try, but both
> pylab and networkx have draw() functions, and the example just does a
> "from blah import *" for both. At a guess, the pylab draw() function
> is clobbering the intended NetworkX draw() function. Try this:
> 
> try:
> import pylab # DON'T DO: from pylab import *
> except:
> print "pylab not found: see https://networkx.lanl.gov/Drawing.html for info"
> raise
> 
> from networkx import *
> 
> G=grid_2d_graph(4,4) #4x4 grid
> pos=spring_layout(G)
> draw(G,pos,alpha=0.5,with_labels=False)
> draw(G,pos,nodelist=[1,2,3,4],node_color='b') # blue
> pylab.savefig("grid.png") # save as png
> pylab.show() # display
> 
> 
> 
> > File "draw_colors.py", line 27, in ?
> > draw(G,pos,node_color=array([G.degree(v) for v in G]))
> > TypeError: draw() takes exactly 1 non-keyword argument (2 given)
> 
> --
> Charles R. Twardy
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 

Showing results of 28

1 2 > >> (Page 1 of 2)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /