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
(13)
2
(11)
3
4
(9)
5
(3)
6
(17)
7
(24)
8
(11)
9
(26)
10
(19)
11
(4)
12
(4)
13
(14)
14
(9)
15
(5)
16
(18)
17
(23)
18
(3)
19
(1)
20
(7)
21
(27)
22
(26)
23
(6)
24
(17)
25
(1)
26
27
(7)
28
(1)
29
(4)
30
(5)


Showing results of 312

1 2 3 .. 13 > >> (Page 1 of 13)
From: Eric F. <ef...@ha...> - 2006年11月30日 23:18:22
Curtis,
clabel works as it should in contour_demo.py, so please post a 
simplest-possible example showing the problem. Also specify what mpl 
version you are using.
Thanks.
Eric
Curtis Cooper wrote:
> Hi,
> 
> I'm using clabel to label contour plots, but when I use the 'inline'
> option, the contour lines break up. That is, they stop going in the
> direction they were going. I'm wondering if there's a bug in the line
> collection routine for this option.
> 
> Thanks,
> Curtis
> 
> 
> * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> * Curtis S. Cooper, Postdoctoral Research Associate *
> * Lunar and Planetary Laboratory, University of Arizona *
> * http://www.lpl.arizona.edu/~curtis/		 *
> * Kuiper Space Sciences, Rm. 423A *
> * 1629 E. University Blvd., *
> * Tucson, AZ 85721 * * * * * * * * * * * * * * *
> * Wk: (520) 626-8596 *
> * * * * * * * * * * * *
> 
> 
> -------------------------------------------------------------------------
> 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
From: Glen W. M. <Gle...@sw...> - 2006年11月30日 21:33:23
Hello,
Searching on the MPL-users and -devel for set_position did not produce
any leads on this topic, so I doubt it's possible but ...
When using MPL as a widget within an application, I find it hard to set
the relative position of the axes in such a way that is appropriate
over a wide range of total window sizes.
That is, I've assigned set_position so that the tick and axis labels
don't get clipped when the widget it small (while trying to maximize the
area that displays the plot). But then the widget gets enlarged , it
seems like there is a lot of wasted space in the border -- space that I
wish were usable for the plot itself.
So I ask: Is there any way to set the border size in pixels instead of a
percentage of the total widget size?
Thank you!
Glen Mabey
From: Curtis C. <cu...@lp...> - 2006年11月30日 20:48:17
Hi,
I'm using clabel to label contour plots, but when I use the 'inline'
option, the contour lines break up. That is, they stop going in the
direction they were going. I'm wondering if there's a bug in the line
collection routine for this option.
Thanks,
Curtis
 * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Curtis S. Cooper, Postdoctoral Research Associate *
 * Lunar and Planetary Laboratory, University of Arizona *
 * http://www.lpl.arizona.edu/~curtis/		 *
 * Kuiper Space Sciences, Rm. 423A *
 * 1629 E. University Blvd., *
 * Tucson, AZ 85721 * * * * * * * * * * * * * * *
 * Wk: (520) 626-8596 *
 * * * * * * * * * * * *
From: Frank Z. <fz...@gm...> - 2006年11月30日 10:49:28
Hi
a newbie question.
After having a look at the date examples of matplotlib, I still have
some problem with this:
I have data starting at a certain date/time (e.g. 30 Nov 2006 12.00
pm). I have one data for every hour starting from the 13th hour after
the starting time until the 96th hour.
I would like to put on the x axis the day/hour (let's say every 3 or 6 hour).
Could you please help me setting me on the right way to the solution?
Thanx
Frank
From: Brent F. <bfi...@me...> - 2006年11月30日 06:25:19
Hi All
I am new to Matplotlib, and was wondering if anybody knew of an easy way to
construct a dropline from a data point in a plot to the x axis, i.e. a
vertical line from (x1,y1) to (x1,0)?
Regards
Brent Fillery
-- 
View this message in context: http://www.nabble.com/Construction-of-Drop-Lines-in-Plot-tf2729919.html#a7614274
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michael G. <mg...@tx...> - 2006年11月29日 19:59:46
That worked perfectly. Thanks!
-Mike
On Nov 29, 2006, at 11:56 AM, Eric Firing wrote:
> linspace(minVal, maxVal, 20)
From: Eric F. <ef...@ha...> - 2006年11月29日 18:57:16
Michael,
You have found a big bug that I introduced recently. Here is a patch, 
which I committed to svn: (watch out for line-breaking by the mailer)
--- lib/matplotlib/contour.py (revision 2899)
+++ lib/matplotlib/contour.py (working copy)
@@ -680,7 +680,12 @@
 if self.extend in ('both', 'max', 'min'):
 self.norm.clip = False
 self.set_array(self.layers)
- # self.tcolors will be set by the "changed" method
+ # self.tcolors are set by the "changed" method,
+ # but need to be set here also
+ # until some refactoring is done.
+ tcolors = [ (tuple(rgba),) for rgba in
+ self.to_rgba(self.cvalues, 
alpha=self.alpha)]
+ self.tcolors = tcolors
 def _process_linewidths(self):
 linewidths = self.linewidths
As the comments indicate, I think I will want to make more extensive 
changes, but this removes the immediate problem.
To get the result you want, however, I think that your approach using 
the norm will not work; maybe it should, but right now it doesn't. 
Instead, simply specify the contour levels that you want, like this:
contourf(x, y, z, linspace(minVal, maxVal, 20), cmap=matplotlib.cm.RdBu_r)
The option you were using, specifying only the number of contours, is 
designed for quick-and-dirty automatic contouring, not for fine control.
Eric
Michael Galloy wrote:
> Hello,
> 
> I'm having trouble scaling the z-values for a filled contour plot. I 
> would like to produce a series of plots like:
> 
> plot.contourf(x, y, z, 20, cmap=matplotlib.cm.RdBu_r)
> 
> but I would like there to be an absolute correspondence between a given 
> z-value and a given color in the colormap no matter what the range of 
> z-values for a particular plot. I thought the way to do this would be to 
> use the norm keyword like:
> 
> normFunction = matplotlib.colors.normalize(vmin=minValue, maxValue) 
> plot.contourf(x, y, z, 20, norm=normFunction, cmap=matplotlib.cm.RdBu_r)
> 
> but this gives the error:
> 
> File 
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axes.py", 
> line 4054, in contourf
> return ContourSet(self, *args, **kwargs)
> File 
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/contour.py", 
> line 456, in __init__
> for level, level_upper, color in zip(lowers, uppers, self.tcolors):
> AttributeError: ContourSet instance has no attribute 'tcolors'
> 
> Any suggestions?
> 
> Thanks,
> Mike
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> 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
From: Fabian B. <f.b...@gm...> - 2006年11月29日 17:11:43
Hi,
I am trying to install matplotlib 0.87.7 with my newly
separate installed python 2.5. For this I installed 'pygtk
2.4.1' and numpy 1.0 using this python 2.5 installation.
Now, running 'python2.5 setup.py build' I get this error:
...
/usr/include/pygtk-2.0/pygobject.h:140: error: expected `,' or `...' before "typename"
/usr/include/pygtk-2.0/pygobject.h:147: error: expected `,' or `...' before "typename"
./CXX/Extensions.hxx: In constructor `Py::PythonExtension<T>::PythonExtension() [with T = BufferRegion]':
src/_backend_agg.h:50: instantiated from here
./CXX/Extensions.hxx:477: warning: right-hand operand of comma has no effect
./CXX/Extensions.hxx: In constructor `Py::PythonExtension<T>::PythonExtension() [with T = LazyValue]':
src/_transforms.h:57: instantiated from here
./CXX/Extensions.hxx:477: warning: right-hand operand of comma has no effect
./CXX/Extensions.hxx: In constructor `Py::PythonExtension<T>::PythonExtension() [with T = Func]':
src/_transforms.h:379: instantiated from here
./CXX/Extensions.hxx:477: warning: right-hand operand of comma has no effect
./CXX/Extensions.hxx: In constructor `Py::PythonExtension<T>::PythonExtension() [with T = FuncXY]':
src/_transforms.h:466: instantiated from here
./CXX/Extensions.hxx:477: warning: right-hand operand of comma has no effect
./CXX/Extensions.hxx: In constructor `Py::PythonExtension<T>::PythonExtension() [with T = Transformation]':
src/_transforms.h:538: instantiated from here
./CXX/Extensions.hxx:477: warning: right-hand operand of comma has no effect
error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I. -Isrc -Iswig -Iagg23/include -I. -I/usr/local/include -I/usr/include -I. -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -Isrc/freetype2 -Iswig/freetype2 -Iagg23/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/opt/python-2.5/include/python2.5 -c src/_gtkagg.cpp -o build/temp.linux-i686-2.5/src/_gtkagg.o" failed with exit status 1
it seems, that matplotlib tries to use the old installed pygtk version; the new
one is located in /usr/local/include/...
Can I adjust this problem somewhere?
Greetings!
 Fabian
From: Michael G. <mg...@tx...> - 2006年11月29日 01:15:29
Hello,
I'm having trouble scaling the z-values for a filled contour plot. I 
would like to produce a series of plots like:
plot.contourf(x, y, z, 20, cmap=matplotlib.cm.RdBu_r)
but I would like there to be an absolute correspondence between a 
given z-value and a given color in the colormap no matter what the 
range of z-values for a particular plot. I thought the way to do this 
would be to use the norm keyword like:
normFunction = matplotlib.colors.normalize(vmin=minValue, maxValue)
plot.contourf(x, y, z, 20, norm=normFunction, cmap=matplotlib.cm.RdBu_r)
but this gives the error:
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/matplotlib/axes.py", line 4054, in contourf
 return ContourSet(self, *args, **kwargs)
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/matplotlib/contour.py", line 456, in __init__
 for level, level_upper, color in zip(lowers, uppers, self.tcolors):
AttributeError: ContourSet instance has no attribute 'tcolors'
Any suggestions?
Thanks,
Mike
From: Martin R. <law...@gm...> - 2006年11月28日 16:31:44
Thank you Angus,
this was exactly what I was looking for!
Martin
From: Michael H. <mic...@bc...> - 2006年11月27日 23:28:33
hello matplotlib-community,
the x,y,z labels of Axes3D are not oriented in the same 
azimuth/elevation as the plot is and often interferes with the ticks.
is this a known problem and does anybody know how to circumvent this?
thanks a lot!
michael
-- 
Michael Held, Dipl.-Inf.
ETH Zurich
Institute of Biochemistry
HPM E17, Schafmattstrasse 18
8093 Zuerich, Switzerland
Phone: +41 44 632 3148, Fax: +41 44 632 1269
mic...@bc...
From: Adam M. <am...@gr...> - 2006年11月27日 21:23:50
Hi,
 I'm trying to build FC4 i386 and x86_64 rpms of matplotlib-0.87.7 with 
GTK and/or GTKAgg backends.
Install Environment:
FC4 i386 
gtk+-devel-1.2.10-39
gtk+-1.2.10-39
numpy-1.0-1
numpy-debuginfo-1.0-1
pygtk2-2.6.2-0.fc4.4
pygtk2-devel-2.6.2-0.fc4.4
pygtk2-libglade-2.6.2-0.fc4.4
X11 is currently running on the box.
Snipit of 'rpmbuild -ba python-matplotlib.spec'
import gtk # directory /usr/lib/python2.4/site-packages/gtk-2.0/gtk
# /usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.pyc matches 
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py
import gtk # precompiled from 
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.pyc
dlopen("/usr/lib/python2.4/site-packages/gtk-2.0/gobject.so", 2);
import gobject # dynamically loaded from 
/usr/lib/python2.4/site-packages/gtk-2.0/gobject.so
# /usr/lib/python2.4/site-packages/gtk-2.0/gtk/keysyms.pyc matches 
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/keysyms.py
import gtk.keysyms # precompiled from 
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/keysyms.pyc
dlopen("/usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so", 2);
# /usr/lib/python2.4/encodings/utf_8.pyc matches 
/usr/lib/python2.4/encodings/utf_8.py
import encodings.utf_8 # precompiled from 
/usr/lib/python2.4/encodings/utf_8.pyc
pygtk present but import failed
import gtk # directory /usr/lib/python2.4/site-packages/gtk-2.0/gtk
# /usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.pyc matches 
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py
import gtk # precompiled from 
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.pyc
pygtk present but import failed
TKAgg requires TkInter
# /usr/lib/python2.4/ConfigParser.pyc matches 
/usr/lib/python2.4/ConfigParser.py
import ConfigParser # precompiled from /usr/lib/python2.4/ConfigParser.pyc
# /usr/lib/python2.4/distutils/command/build.pyc matches 
/usr/lib/python2.4/distutils/command/build.py
import distutils.command.build # precompiled from 
/usr/lib/python2.4/distutils/command/build.pyc
running build
running build_py
# /usr/lib/python2.4/distutils/command/build_py.pyc matches 
/usr/lib/python2.4/distutils/command/build_py.py
import distutils.command.build_py # precompiled from 
/usr/lib/python2.4/distutils/command/build_py.pyc
creating build
After building the rpm I can then install it and do the following:
Python 2.4.3 (#1, Jun 13 2006, 16:41:18)
[GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylab
>>> import gtk
>>>
Importing gtk only fails when I run rpmbuild. I can manually enter 
/usr/src/redhat/SOURCES/matplotlib-0.87.7/ and run 'python setup.py 
build' and get no errors.
TKAgg requires TkInter
running build
running build_py
running build_ext
What am I doing wrong??
Thanks!
Adam Miller
From: Pierre GM <pgm...@gm...> - 2006年11月27日 19:54:30
Teemu
> Any ideas where the conflict might be coming from?
When you type from MA import *, you overwrite the definition of 'array'. And 
surprisingly enough, a masked array in numpy.core.ma is an object 
independent of ndarray. Some functions such as swapaxes are not imported by 
MA (because they were not implemented for one reason or another): you then 
use the regular numpy function, which doesn't know how to deal with these 
'masked arrays' objects. (I simplify a bit, here, but the gist is there)
As you've noticed, the best solution is to use
import MA
That way, you leave the original numpy namespace alone, and are sure to use 
only "MA-approved" functions. But you'll likely gonna have to use MA.sqrt, 
MA.log all over your code. And may run into problems with functions that 
don't handle masked arrays. Still, it's the cleanest solution (the "from blah 
import *" tend to be frowned upon these days anyway).
An alternative solution is to try the new implementation of masked arrays I've 
been working on: with this implementation, masked arrays are subclasses of 
regular arrays, which simplifies life a lot.The source file is available 
here:
http://projects.scipy.org/scipy/numpy/wiki/MaskedArray
Note the disclaimer: it's still a work in progress (even if I use it everyday 
and it works fine) and you'll have to modify a line in the matplotlib source 
to make it work OK with matplotlib, which is a bit tedious I agree. But it 
works. And it's actively maintained.
Hope it helps
P.
From: Teemu R. <Tee...@he...> - 2006年11月27日 19:17:38
Hi,
I downloaded&installed matplotlib 0.87.7 and other binary packages from
pythonmac.org for my new Intel Mac Pro. Then I downloaded and compiled the
latest scipy package. My collection of packages runs ok otherwise but there
seems to be something wrong with pylab/masked array behavior.
This works on my older installations (g5):
import matplotlib
matplotlib.use("TkAgg")
from pylab import *
from MA import *
#import MA
a=arange(100)
a.shape=(5,20)
a=swapaxes(a,0,1)
m=array([1,2,3],mask=[0,1,0])
#m=MA.array([1,2,3],mask=[0,1,0])
On my Intel Mac Pro, I get:
File "test.py", line 12, in ?
 a=swapaxes(a,0,1)
 File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/core/fromnumeric.py",
line 106, in swapaxes
 return _wrapit(a, 'swapaxes', axis1, axis2)
 File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/core/fromnumeric.py",
line 39, in _wrapit
 result = getattr(asarray(obj),method)(*args, **kwds)
 File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/core/numeric.py",
line 132, in asarray
 return array(a, dtype, copy=False, order=order)
ValueError: object __array__ method not producing an array
There seems to be some kind of name space conflict. The line
'a=swapaxes(a,0,1)' works as expected without 'from MA import *'. If I do
'import MA' and use MA.array etc for all operations with masked arrays
everything seems to work fine. 
Any ideas where the conflict might be coming from? 
--
Teemu Rinne
Dept Psychology
University of Helsinki
From: John H. <jdh...@ac...> - 2006年11月27日 18:30:38
>>>>> "Christopher" == Christopher Barker <Chr...@no...> writes:
 Christopher> Dav...@no... wrote:
 >> OK, I see (kind of, i.e., via the pylab interface) how to do it
 >> - indirectly, i.e., by catching the click-on-figure event, then
 >> figuring out where that event happened and comparing that to
 >> the locations of the figure's pieces -
 Christopher> Does MPL have some kind of hit-testing built-in? this
 Christopher> seems a bit harder than it should be.
There is an Axes.pick method that will pick on lines, text and
patches. See examples/picker_demo.py. I plan on extending and
refining this functionality in the not-too-distant-future.
JDH
From: Christopher B. <Chr...@no...> - 2006年11月27日 17:58:44
Dav...@no... wrote:
> OK, I see (kind of, i.e., via the pylab interface) how to do it -
> indirectly, i.e., by catching the click-on-figure event, then figuring
> out where that event happened and comparing that to the locations of the
> figure's pieces - 
Does MPL have some kind of hit-testing built-in? this seems a bit harder 
than it should be.
> using matplotlib only, so here's hoping that wxmpl has
> made it A) more direct (i.e., provided some way to access a figure's
> pieces seemingly directly, i.e., without having to figure out where in
> the figure those pieces are as an explicit intermediate step), and
> thereby B) easier.
I don't' think so....
However, Mplot may be worth a look-see:
http://cars9.uchicago.edu/~newville/Epics/Python/MPlot/
As far as I can tell, it provides a user-editable plot. However, I can't 
tell with a quick perusal if you can click on an axis and get feedback 
for that.
It would be nice if wxMPL and MPlot shored a code base, but alas -- they 
were started independently.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Nicolas G. <nic...@ga...> - 2006年11月27日 17:23:00
I'm not sure, but I guess you should make
matplotlib.interactive(False) and matplotlib.use('PS') BEFORE
importing pylab.
Nicolas Grilly
On 11/16/06, Emin.shopper Martinian.shopper <emi...@gm...> wrote:
> Whenever I try to use matplotlib from a python session inside emacs, python
> freezes. What I do is start GNU Emacs version 21.1.3 for Windows, do ESC-x
> shell and enter the commands shown below. Note that I set the backend to PS
> and interactive to false, but my python interpreter still freezes. I suspect
> that this is because matplotlib is generating some GUI events which upset
> emacs. The example works fine if I run python through the shell without
> emacs, but I would very much like to run python through an emacs session.
> Similar problems happen with other backends. Any suggestions on how to solve
> this problem would be much appreciated.
From: Tony M. <Ton...@jp...> - 2006年11月25日 08:08:26
Chris,
Yes, well I probably installed libfreetype myself, as part of the 
source installs. I know very little about these internals, so I did 
nothing "on purpose." It's disconcerting that the X11 update 
overwrote things in this way. Luckily, it appears there are no other 
side effects. The fix was possible because of good error reporting 
from mpl.
Thanks for your comments.
-Tony
At 7:53 AM -0800 11/22/06, Christopher Barker wrote:
>Tony Mannucci wrote:
>>If you saw my previous post about upgrading to XDarwin 1.1.3, and 
>>breaking matplotlib, the following seems to work:
>>
>>Soft-linking to libfreetype.6.3.8.dylib rather than 
>>libfreetype.6.3.dylib (see below, copied from previous email).
>
>That's interesting. I don't have a 6.3.8, only 6.3 (and 6, linked to 
>6.3). I did just install the latest Apple X11 update.
>
>Also, in the past, MPL has been know not to work with Apple's X11 
>libfreetype. I wonder if you had installed 6.3.8 yourself. That 
>would have explained it, in that usually if you install, for 
>instance, 6.3.8, there would be a link from 6.3 to 6.3.8, which may 
>have been what you linked to originally. Then, if Apple provided a 
>new 6.3 with their X11, it overwrote yours.
>
>I do note that your 6.3.8 is MUCH larger than 6.3, which is a bit curious.
>
>Anyway, most of us end up linking MPL statically against a 
>self-installed libfreetype, just for these reasons.
>
>-Chris
>
>
>
>--
>Christopher Barker, Ph.D.
>Oceanographer
>
>Emergency Response Division
>NOAA/NOS/OR&R (206) 526-6959 voice
>7600 Sand Point Way NE (206) 526-6329 fax
>Seattle, WA 98115 (206) 526-6317 main reception
>
>Chr...@no...
-- 
Tony Mannucci
Supervisor, Ionospheric and Atmospheric Remote Sensing Group
 Mail-Stop 138-308, Tel > (818) 354-1699
 Jet Propulsion Laboratory, Fax > (818) 393-5115
 California Institute of Technology, Email > Ton...@jp...
 4800 Oak Grove Drive, http://genesis.jpl.nasa.gov
 Pasadena, CA 91109
From: <Dav...@no...> - 2006年11月24日 23:38:41
OK, I see (kind of, i.e., via the pylab interface) how to do it -
indirectly, i.e., by catching the click-on-figure event, then figuring
out where that event happened and comparing that to the locations of the
figure's pieces - using matplotlib only, so here's hoping that wxmpl has
made it A) more direct (i.e., provided some way to access a figure's
pieces seemingly directly, i.e., without having to figure out where in
the figure those pieces are as an explicit intermediate step), and
thereby B) easier.
DG
From: <Dav...@no...> - 2006年11月24日 23:18:31
And if so, how? For example, is there a way to make it so that if a
user clicks on the figure's title (or the legend, or an axis, etc.),
then a wx.TextCtrl can be made to come up so that the user can edit the
title?
DG
PS: I believe some time back I was told that, presently, this is the
best place to post wxmpl questions, since, so far, there isn't a
separate wxmpl mailing list. If this has changed, please let me know. 
Thanks again! 
From: Darren D. <dd...@co...> - 2006年11月24日 22:16:01
On Friday 24 November 2006 3:46 pm, David TREMOUILLES wrote:
> Well... deleting the first is not a solution for me
> My app use pan/zoom tool for manual adjustment of the plot.
> if I put the line you proposed at the end of my code, the x upper labels
> are not
> dynamically updated anymore and could be that one end bellow the "scaling
> factor" "x1e4" of the y labels...
>
> Change the formatter of the yaxis to OldScalarFormatter do the trick but I
> would prefer to use the default formatter.
> Would it be possible to move the "x1e4" to the left to avoid the
> overlapping?
>
> By the way I've just discover kind of bug: the scaling factor of the x top
> axis is displayed on the x bottom axis 
The patch at the end of this post *should* render the scaling factor above the 
xaxis labels on the top axis. It should, but it doesn't. Instead, it renders 
the scaling factor overlapping the tick labels on the top axis. I don't 
understand this behavior, considering the scaling factor is properly rendered 
if the bottom axis is the one that is labeled.
As for overlapping with twinx and twiny, I don't know how best to proceed 
here. The offset_text's parent axis would have to inspect its own ticklabels 
as well as the ticklabels of the OTHER axis, and based on their extent, find 
a new location for the offset_text. This is starting to get in the realm of 
requiring a layout manager in order to implement properly.
I'm preparing for a professional meeting next week (anyone else going to MRS 
in Boston?) and don't have time to continue working on this. Perhaps the 
patch is enough to get someone else pointed in the right direction.
Darren
Index: lib/matplotlib/axis.py
===================================================================
--- lib/matplotlib/axis.py (revision 2898)
+++ lib/matplotlib/axis.py (working copy)
@@ -868,7 +868,7 @@
 offsetText.set_transform( blend_xy_sep_transform( 
self.axes.transAxes,
 identity_transform() ))
 self._set_artist_props(offsetText)
- self.offset_text_position='bottom'
+## self.offset_text_position='bottom'
 return offsetText
 def get_label_position(self):
@@ -923,13 +923,28 @@
 boxes of all the ticklabels
 """
 x,y = self.offsetText.get_position()
- if not len(bboxes):
- bottom = self.axes.bbox.ymin()
+ position = self.get_ticks_position()
+ if position == 'top':
+ if not len(bboxes):
+ top = self.axes.bbox.ymax()
+ else:
+ bbox = bbox_all(bboxes)
+ top = bbox.ymax()
+ self.offsetText.set_position((x, 
top+self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0))
 else:
- bbox = bbox_all(bboxes)
- bottom = bbox.ymin()
- self.offsetText.set_position((x, 
bottom-self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0))
+ if not len(bboxes):
+ bottom = self.axes.bbox.ymin()
+ else:
+ bbox = bbox_all(bboxes)
+ bottom = bbox.ymin()
+ self.offsetText.set_position((x, 
bottom-self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0))
+ def set_offset_position(self, position):
+ assert position == 'top' or position == 'bottom'
+
+ if position == 'top': self.offsetText.set_va('bottom')
+ else: self.offsetText.set_va('top')
+
 def set_ticks_position(self, position):
 """
 Set the ticks position (top, bottom, both or default)
@@ -946,24 +961,28 @@
 ticks.extend( self.minorTicks )
 if position == 'top':
+ self.set_offset_position('top')
 for t in ticks:
 t.tick1On = False
 t.tick2On = True
 t.label1On = False
 t.label2On = True
 elif position == 'bottom':
+ self.set_offset_position('bottom')
 for t in ticks:
 t.tick1On = True
 t.tick2On = False
 t.label1On = True
 t.label2On = False
 elif position == 'default':
+ self.set_offset_position('bottom')
 for t in ticks:
 t.tick1On = True
 t.tick2On = True
 t.label1On = True
 t.label2On = False
 else:
+ self.set_offset_position('bottom')
 for t in ticks:
 t.tick1On = True
 t.tick2On = True
@@ -1042,7 +1061,7 @@
 offsetText.set_transform(blend_xy_sep_transform(self.axes.transAxes,
 
identity_transform()) )
 self._set_artist_props(offsetText)
- self.offset_text_position='left'
+## self.offset_text_position='left'
 return offsetText
 def get_label_position(self):
From: David T. <dav...@gm...> - 2006年11月24日 20:56:44
Note: same problem applied for sharex...
2006年11月24日, David TREMOUILLES <dav...@gm...>:
>
> Well... deleting the first is not a solution for me
> My app use pan/zoom tool for manual adjustment of the plot.
> if I put the line you proposed at the end of my code, the x upper labels
> are not
> dynamically updated anymore and could be that one end bellow the "scaling
> factor" "x1e4" of the y labels...
>
> Change the formatter of the yaxis to OldScalarFormatter do the trick but I
> would prefer to use the default formatter.
> Would it be possible to move the "x1e4" to the left to avoid the
> overlapping?
>
> By the way I've just discover kind of bug: the scaling factor of the x top
> axis is displayed on the x bottom axis (???) (see bottom right of the new
> example).
> I join a new example reproducing both problems.
>
>
> 2006年11月24日, Pierre GM < pgm...@gm...>:
> >
> >
> > > How could I avoid this overlapping?
> >
> > What about deleting your first tick on ax2, with
> > >>> ax2.set_xticks(ax2.get_xticks()[1:])
> > at the end of your code ?
> >
>
>
>
From: David T. <dav...@gm...> - 2006年11月24日 20:46:38
Attachments: image.png two_scale2_y.py
Well... deleting the first is not a solution for me
My app use pan/zoom tool for manual adjustment of the plot.
if I put the line you proposed at the end of my code, the x upper labels are
not
dynamically updated anymore and could be that one end bellow the "scaling
factor" "x1e4" of the y labels...
Change the formatter of the yaxis to OldScalarFormatter do the trick but I
would prefer to use the default formatter.
Would it be possible to move the "x1e4" to the left to avoid the
overlapping?
By the way I've just discover kind of bug: the scaling factor of the x top
axis is displayed on the x bottom axis (???) (see bottom right of the new
example).
I join a new example reproducing both problems.
2006年11月24日, Pierre GM < pgm...@gm...>:
>
>
> > How could I avoid this overlapping?
>
> What about deleting your first tick on ax2, with
> >>> ax2.set_xticks(ax2.get_xticks()[1:])
> at the end of your code ?
>
From: Darren D. <dd...@co...> - 2006年11月24日 20:43:39
On Friday 24 November 2006 3:34 pm, Pierre GM wrote:
> On Friday 24 November 2006 15:14, Darren Dale wrote:
> > Or, you can change the formatter of your yaxis to OldScalarFormatter,
> > which renders the scientific notation in each tick label, rather than at
> > the top of the axis.
>
> Thinking about it: is there a way to grab this scientific notation ? The
> idea would be to get the corresponding object as a string, and update the
> ylabel with it.
Yes, the scientific notation is a matplotlib text object, which you can grab 
like this:
plot([0,1e10])
a=gca()
t=a.yaxis.get_offset_text()
and then you can get the string:
s=t.get_text()
Darren
From: Angus M. <am...@gm...> - 2006年11月24日 20:36:48
On 25/11/06, Martin Richter <law...@gm...> wrote:
> Hello everyone,
>
> although I thought this topic had been discussed earlier I wasn't able to find
> it in the archives. So please forgive me if I'm repeating something. Here the
> question I'm not able to answer on my own:
We really shoud wiki more of these email discussions as they come
along. It's so much easier to search there, since things are in some
sort of logical arrangement.
> Is there a possibility to disconnect an event when someone wants to use the
> zoom-to-rectangle mechanism so that the code which originally would be
> executed on the event isn't actually executed as long as the zooming is
> activated? To have an example to talk about:
>
> ############
> from pylab import *
>
> def click(event):
> """If the left mouse button is pressed: draw a little square. """
> if event.button==1 and event.inaxes:
> x,y = event.xdata,event.ydata
> plot([x],[y],'rs')
> draw()
>
> plot((arange(100)/99.0)**3)
> gca().set_autoscale_on(False)
> connect('button_press_event',click)
> show()
> ############
>
> If one runs this script and tries to use the zooming he will always add such a
> little red square to the plot. Can this be prevented somehow?
>
Yes, first you need to have a reference to your toolbar handy. It took
me a few minutes to work out how to do this with pylab, since I
usually use it in a wxPython frame where the toolbar is explicity
defined, but apparently in pylab you can use :
tb = get_current_fig_manager().toolbar
Then check the mode attribute of the toolbar in your click script:
if tb.mode = "":
 do_stuff
else
 ignore
So your script becomes:
##############
from pylab import *
def click(event):
 """If the left mouse button is pressed: draw a little square. """
 tb = get_current_fig_manager().toolbar
 if event.button==1 and event.inaxes and tb.mode == '':
 x,y = event.xdata,event.ydata
 plot([x],[y],'rs')
 draw()
plot((arange(100)/99.0)**3)
gca().set_autoscale_on(False)
connect('button_press_event',click)
show()
##############
I hope that helps,
Angus.
-- 
AJC McMorland, PhD Student
Physiology, University of Auckland
3 messages has been excluded from this view by a project administrator.

Showing results of 312

1 2 3 .. 13 > >> (Page 1 of 13)
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 によって変換されたページ (->オリジナル) /