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

Showing 17 results of 17

From: Eric F. <ef...@ha...> - 2008年05月28日 19:35:16
Christopher Barker wrote:
> Tommy Grav wrote:
>>> I
>>> don't know that it has ever all been consolidated into one easy-to- 
>>> find, easy-to-use set of instructions that will work for just about anyone.
> 
> no, it hasn't.
And one of the reasons may be that it is very complicated in practice, 
with all the possible variations of OSX versions, Xcode versions, 
processor architectures, and styles of build for python itself and 
various libraries. It seems to require learning a whole new jargon.
> 
> However, I think:
> 
> $ easy-install matplotlib
> 
> should work, at least with the python.org python2.5
> 
>>> Maybe someone can provide, or has provided, a universal binary of 
>>> 0.91.2 built against numpy 1.1?
> 
> does it need to be "built against" numpy at all? I didn't think it was a 
> build-time dependency -- that is, any MPL 0.91.2 should do, and you can 
> drop a new numpy into it. I don't know if there is one yet, though...
_backend_gdk.c and nxutils.c both call into the numpy C API; maybe some 
c++ code does also. It is not entirely clear to me whether 1.1 is 
sufficiently binary-compatible that this is safe.
> There are essentially two options:
> 
> 1) built it just for yourself -- I think the instructions John H. posted 
> are pretty easy to follow.
That's the way they look, but having watched someone try it, I can 
testify that looks are deceptive. I would say that with 95% 
probability, if Tommy tried to follow John's instructions, he would not 
succeed.
Eric
From: Christopher B. <Chr...@no...> - 2008年05月28日 18:59:49
Tommy Grav wrote:
>> I
>> don't know that it has ever all been consolidated into one easy-to- 
>> find, easy-to-use set of instructions that will work for just about anyone.
no, it hasn't.
However, I think:
$ easy-install matplotlib
should work, at least with the python.org python2.5
>> Maybe someone can provide, or has provided, a universal binary of 
>> 0.91.2 built against numpy 1.1?
does it need to be "built against" numpy at all? I didn't think it was a 
build-time dependency -- that is, any MPL 0.91.2 should do, and you can 
drop a new numpy into it. I don't know if there is one yet, though...
> I seemed to remember that I had similar problems with 0.91.1, but used
> the super-scipy package to install it. Of course that package is now 
> only for intel macs :(
There was talk of making it Universal, but I don't know what came of that.
There are essentially two options:
1) built it just for yourself -- I think the instructions John H. posted 
are pretty easy to follow.
2) Built so that it is re-distributable, as part of a py2app *.app, for 
instance. In this case, you need to find or build the dependencies as 
Universal static libs, then make sure that those are linked when you 
build. You should also probably use the python.org build of python, 
rather than Apple's one. I don't know that there are easy instructions 
for this anywhere, but Russel Owen did post some somewhere a while back.
2b) built against the Universal Frameworks found here:
http://www.kyngchaos.com/wiki/software:frameworks
(I think FreeType and UnixImageIO should do it).
That will give you a Universal build that you can use with py2app, but 
if anyone else wants to use that build, they'll need to install those 
frameworks too.
-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: Tommy G. <gr...@if...> - 2008年05月28日 18:39:54
On May 28, 2008, at 2:27 PM, John Hunter wrote:
> On Wed, May 28, 2008 at 1:21 PM, Eric Firing <ef...@ha...> 
> wrote:
>
>> Maybe someone can provide, or has provided, a universal binary of 
>> 0.91.2
>> built against numpy 1.1?
>
> Does it need to be built against numpy 1.1? I thought the 1.1 release
> was binary compatible.
> If it is, this egg should work:
>
> http://downloads.sourceforge.net/matplotlib/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg?use_mirror=internap
>
> JDH
The problem with the egg is that it installs it in /Library/Python/2.5/ 
site-packages. This is only valid
for the standard apple python version. But with
easy_install -d /Library/Frameworks/Python.framework/Versions/Current/ 
lib/python2.5/site-packages matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg
I was able to get 0.91.2 on my system :)
Thanks
 Tommy
From: Michael D. <md...@st...> - 2008年05月28日 18:35:15
Which version of matplotlib are you using? Can you provide the set of 
compiler options you ultimately arrived at? Also, can you provide the 
build output?
Cheers,
Mike
Steve Smith wrote:
> Hi all,
> I've been running into this one and tried compiling it a number of 
> ways. Unfortunately the way it's fitting into our infrastructure, it's 
> gotta be 64-bit. Here's the script:
>
> #!/usr/bin/python/bin/python
> from pylab import *
>
> plot([1,2,3,4])
> savefig('secondfig')
> show()
>
> I comment out the the "savefig" line and all works just fine.
>
> The truss output I have is:
>
> resolvepath("/usr/sfw/lib/libfreetype.so.6", 
> "/usr/sfw/lib/libfreetype.so.6", 1023) = 29
> open("/usr/sfw/lib/libfreetype.so.6", O_RDONLY) = 8
> mmap(0xFFFFFFFF76500000, 32768, PROT_READ|PROT_EXEC, 
> MAP_PRIVATE|MAP_FIXED, 8, 0) = 0xFFFFFFFF76500000
> close(8) = 0
> stat("/opt/SUNWspro/lib/rw7/v9/libfreetype.so.6", 0xFFFFFFFF7FFF7A30) 
> Err#2 ENOENT
> stat("/opt/SUNWspro/lib/sparcvis2/64/libfreetype.so.6", 
> 0xFFFFFFFF7FFF7A30) Err#2 ENOENT
> stat("/opt/SUNWspro/lib/v9/libfreetype.so.6", 0xFFFFFFFF7FFF7A30) Err#2 
> ENOENT
> stat("/usr/ccs/lib/sparcv9/libfreetype.so.6", 0xFFFFFFFF7FFF7A30) Err#2 
> ENOENT
> stat("/lib/sparcv9/libfreetype.so.6", 0xFFFFFFFF7FFF7A30) Err#2 ENOENT
> stat("/usr/lib/sparcv9/libfreetype.so.6", 0xFFFFFFFF7FFF7A30) Err#2 ENOENT
> mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, 
> MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFFFFFFFF74700000
> munmap(0xFFFFFFFF76500000, 32768) = 0
> lseek(7, 0, SEEK_CUR) = 0
> close(7) = 0
> lseek(6, 0, SEEK_CUR) = 0
> close(6) = 0
> brk(0x101116C00) = 0
> brk(0x10111AC00) = 0
> brk(0x10111AC00) = 0
> brk(0x10111EC00) = 0
>
>
> Any ideas what my problem could be? I'm happy to provide any additional 
> info as requested. Thanks
>
> -Steve
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Tommy G. <gr...@if...> - 2008年05月28日 18:29:32
On May 28, 2008, at 2:21 PM, Eric Firing wrote:
> Building on the Mac seems to be a nightmare. There are various emails
> and howto writeups (including one of John's) floating around, but I
> don't know that it has ever all been consolidated into one easy-to- 
> find,
> easy-to-use set of instructions that will work for just about anyone.
>
> Maybe someone can provide, or has provided, a universal binary of 
> 0.91.2
> built against numpy 1.1?
I seemed to remember that I had similar problems with 0.91.1, but used
the super-scipy package to install it. Of course that package is now 
only
for intel macs :(
Hopefully someone else can shed some light on the issue. I will play 
around
in the mean time and maybe I will stumble upon something :)
Cheers
 Tommy
From: John H. <jd...@gm...> - 2008年05月28日 18:27:25
On Wed, May 28, 2008 at 1:21 PM, Eric Firing <ef...@ha...> wrote:
> Maybe someone can provide, or has provided, a universal binary of 0.91.2
> built against numpy 1.1?
Does it need to be built against numpy 1.1? I thought the 1.1 release
was binary compatible.
If it is, this egg should work:
http://downloads.sourceforge.net/matplotlib/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg?use_mirror=internap
JDH
From: Eric F. <ef...@ha...> - 2008年05月28日 18:21:45
Tommy Grav wrote:
> On May 28, 2008, at 1:54 PM, Eric Firing wrote:
> 
>> Tommy,
>>
>> That's right. If you upgrade numpy you need to upgrade mpl to 
>> 0.91.2 or later.
>>
>> Eric
> 
> I am trying to build matplotlib from svn, but run into this error:
> ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libJPEG.dylib, 
> file is not of required architecture for architecture i386
> collect2: ld returned 1 exit status
> lipo: can't open input file: /var/folders/+9/+9BDgtoTFv4AaU0pWhEE4+++ 
> +TI/-Tmp-//ccUnfmnm.out (No such file or directory)
> error: command 'g++' failed with exit status 1
> [skathi:~/Downloads/matplotlib-0.91.2] tgrav%
> 
> I am on a PPC running mac os x 10.5.2. How can I configure g++ to drop 
> the -arch i386 flag,
> or is there something else wrong here?
Building on the Mac seems to be a nightmare. There are various emails 
and howto writeups (including one of John's) floating around, but I 
don't know that it has ever all been consolidated into one easy-to-find, 
easy-to-use set of instructions that will work for just about anyone.
Maybe someone can provide, or has provided, a universal binary of 0.91.2 
 built against numpy 1.1?
Eric
From: Tommy G. <gr...@if...> - 2008年05月28日 18:10:38
On May 28, 2008, at 1:54 PM, Eric Firing wrote:
> Tommy,
>
> That's right. If you upgrade numpy you need to upgrade mpl to 
> 0.91.2 or later.
>
> Eric
I am trying to build matplotlib from svn, but run into this error:
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.macosx-10.3- 
fat-2.5/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/ 
lib.macosx-10.3-fat-2.5/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk - 
bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/ 
ft2font.o build/temp.macosx-10.3-fat-2.5/src/mplutils.o build/ 
temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3- 
fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-fat-2.5/CXX/ 
IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/CXX/ 
cxxextensions.o -L/usr/local/lib -L/usr/local/lib -L/usr/lib -L/usr/ 
X11R6/lib -lfreetype -lz -lstdc++ -lm -o build/lib.macosx-10.3-fat-2.5/ 
matplotlib/ft2font.so -Wl,-framework,CoreServices,- 
framework,ApplicationServices
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libJPEG.dylib, 
file is not of required architecture for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/+9/+9BDgtoTFv4AaU0pWhEE4+++ 
+TI/-Tmp-//ccUnfmnm.out (No such file or directory)
error: command 'g++' failed with exit status 1
[skathi:~/Downloads/matplotlib-0.91.2] tgrav%
I am on a PPC running mac os x 10.5.2. How can I configure g++ to drop 
the -arch i386 flag,
or is there something else wrong here?
Cheers
 Tommy
From: Eric F. <ef...@ha...> - 2008年05月28日 17:54:34
Tommy,
That's right. If you upgrade numpy you need to upgrade mpl to 0.91.2 or 
later.
Eric
Tommy Grav wrote:
> [skathi:~/Work/myCode/pyS3M] tgrav% python
> ActivePython 2.5.1.1 (ActiveState Software Inc.) based on
> Python 2.5.1 (r251:54863, May 1 2007, 17:40:00)
> [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import numpy
> >>> numpy.__version__
> '1.1.0'
> >>> import pylab
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/pylab.py", line 1, in <module>
> from matplotlib.pylab import *
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/matplotlib/pylab.py", line 206, in <module>
> from matplotlib.numerix import npyma as ma
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/matplotlib/numerix/__init__.py", line 166, in 
> <module>
> __import__('ma', g, l)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/matplotlib/numerix/ma/__init__.py", line 16, 
> in <module>
> from numpy.core.ma import *
> ImportError: No module named ma
> >>> import matplotlib
> >>> matplotlib.__version__
> '0.91.1'
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jd...@gm...> - 2008年05月28日 17:51:27
On Wed, May 28, 2008 at 12:37 PM, Tommy Grav <gr...@if...> wrote:
> [skathi:~/Work/myCode/pyS3M] tgrav% python
> ActivePython 2.5.1.1 (ActiveState Software Inc.) based on
> Python 2.5.1 (r251:54863, May 1 2007, 17:40:00)
> [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import numpy
> >>> numpy.__version__
> '1.1.0'> >>> import matplotlib
> >>> matplotlib.__version__
> '0.91.1'
The latest release of matplotlib (0.91.2) should work with the latest
release of numpy (1.1.0). Please test that configuration.
Thanks,
JDH
From: Tommy G. <gr...@if...> - 2008年05月28日 17:39:52
[skathi:~/Work/myCode/pyS3M] tgrav% python
ActivePython 2.5.1.1 (ActiveState Software Inc.) based on
Python 2.5.1 (r251:54863, May 1 2007, 17:40:00)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy
 >>> numpy.__version__
'1.1.0'
 >>> import pylab
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/pylab.py", line 1, in <module>
 from matplotlib.pylab import *
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/pylab.py", line 206, in <module>
 from matplotlib.numerix import npyma as ma
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/numerix/__init__.py", line 166, in 
<module>
 __import__('ma', g, l)
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/numerix/ma/__init__.py", line 16, 
in <module>
 from numpy.core.ma import *
ImportError: No module named ma
 >>> import matplotlib
 >>> matplotlib.__version__
'0.91.1'
From: John H. <jd...@gm...> - 2008年05月28日 15:26:37
On Wed, May 28, 2008 at 10:17 AM, Margherita Vittone wiersma
<vi...@fn...> wrote:
> thank for your reply; i made a typo when i cut and paste my example which was
> longer and i just trimmed it down to email it. So even with the correct formatter defined,
> on the plot i only see 00:00:00 for the time portion of the label
Well that is a different problem. In your original post you wrote "I
don't see the time portion of it, just the date" so I misunderstood
your problem. With 00:00:00, you are seing the time portion of the
*tick locations*. As I wrote in a previous post, you are seeing the
format strings for the locations of the ticks, not the data points.
The default tick locator tries to put the ticks on even days. If you
want the ticks to be on the data points, you need to do:
 ax.set_xticks(dates)
to put ticks explicitly where you want them.
JDH
From: Margherita V. w. <vi...@fn...> - 2008年05月28日 15:18:00
Hello,
thank for your reply; i made a typo when i cut and paste my example which was
longer and i just trimmed it down to email it. So even with the correct formatter defined,
on the plot i only see 00:00:00 for the time portion of the label; i am wondering
if it could related to the version of matplotlib i am using:
matplotlib-0.87.7-py2.5
thanks again
Margherita
From: John H. <jd...@gm...> - 2008年05月28日 14:47:46
On Wed, May 28, 2008 at 7:10 AM, New2Python <new...@li...> wrote:
> One issue that I find now is that the removed marker is not redrawn as
> removed, in other words, all the original markers remain drawn whether or
> not the datapoints exist in the array. How can I remove the marker I don't
> want anymore withought doing a clf() call because I can have over 300,000
> datapoints and the redraw will take ages
You will need to do some extra work here. I would have a "picking
mode" which is enabled by a key-stroke or button press, and when the
mode is enabled, you can copy the background using the
copy_background/restore region/blit techniques discussed at
http://www.scipy.org/Cookbook/Matplotlib/Animations. Then you can
mark your vertices and just draw the vertex marker line over the
background. Alternatively, you can use the clipped line approach I
pointed you to in my prior post to only plot the vertices in the
viewport. You will have to do a little bookkeeping to translate the
marked vertices in the viewport to the ones in the original dataset.
Unfortunately, I don't have time to write the complete example right now...
JDH
From: John H. <jd...@gm...> - 2008年05月28日 14:40:35
On Tue, May 27, 2008 at 6:29 AM, Johann Cohen-Tanugi
<co...@sl...> wrote:
> hello,
> when histogramming a distribution in log scale, I have some empty bins,
> which drives the y axis to 1e-100 as a lower limit, completely squashing
> the histogram....
I made changes to svn trunk so that zero area rectangles no longer
influence the autoscaling. So this example scales correctly:
 import numpy as np
 import matplotlib.pyplot as plt
 x = np.random.rand(100)
 fig = plt.figure()
 ax = fig.add_subplot(111)
 n, bins, patches = ax.hist(x, 50, log=True)
 plt.show()
Thanks for the suggestion,
JDH
From: New2Python <new...@li...> - 2008年05月28日 12:10:33
Thanks for that, the canvas.draw() function redraws the graph. I had to add
the "autoscale_on=False" to the add_subplot() to stop the graph from
autoscaling. 
 
One issue that I find now is that the removed marker is not redrawn as
removed, in other words, all the original markers remain drawn whether or
not the datapoints exist in the array. How can I remove the marker I don't
want anymore withought doing a clf() call because I can have over 300,000
datapoints and the redraw will take ages
 
Thanks for the link to the clipping code, that will come in handy. Much
appreciated
John Hunter-4 wrote:
> 
> On Mon, May 26, 2008 at 10:08 AM, John Hunter <jd...@gm...> wrote:
>> On Mon, May 26, 2008 at 7:01 AM, New2Python <new...@li...>
>> wrote:
>>
>>> I hope someone can give me a simple solution to my problem. I have a
>>> line
>>> plotted and I need to be able to mark selected data points on the line.
>>> I am
>>
>> If you are frequently changing the zoom level, as it looks like you
>> are, the copy background/restore region/blit idiom is probably not the
>> right one for you, since the background is assumed fixed. You can
>> simply force a draw at any time by doing fig.canvas.draw() w/o having
>> to zoom out or resize to trigger a draw. So after doing the
>> self.marker.set_data call, I would do fig.canvas.draw
> 
> I thought this would be a generally useful thing to do (maintain a
> list of toggleable selected vertices) so I added some support. Here is
> some example code to highlight the selected markers:
> 
> """
> The matplotlib.lines.VertexSelector maintains a list of selected line
> vertices using the line picker property. If an unselected vertex is
> clicked, it is selected, and if a selected vertex is clicked, it is
> unselectedit.
> 
> Classes which inherit from the VertexSelector should override the
> process_selected method to do something with the selected vertex. This
> example just highlights them with red markers. If you don't have
> access to svn, I can send you a free-standing example.
> 
> 
> """
> The matplotlib.lines.VertexSelector maintains a list of selected line
> vertices using the line picker property. If an unselected vertex is
> clicked, it is selected, and if a selected vertex is clicked, it is
> unselectedit.
> 
> Classes which inherit from the VertexSelector should override the
> process_selected method to do something with the selected vertex. This
> example just highlights them with red markers.
> 
> """
> 
> import numpy as np
> import matplotlib.pyplot as plt
> import matplotlib.lines as lines
> 
> class HighlightSelected(lines.VertexSelector):
> """
> Highlight the selected vertices with a marker plot
> """
> def __init__(self, line, fmt='ro', **kwargs):
> """
> highlight the selected vertices of line with a marker plot.
> The plot format string are given by fmt and the kwargs are
> additional
> line properties
> """
> lines.VertexSelector.__init__(self, line)
> self.markers, = self.axes.plot([], [], fmt, **kwargs)
> 
> def process_selected(self, ind, xs, ys):
> """
> ind are the indices of the selected vertices. xs and ys are
> the coordinates of the selected vertices.
> """
> self.markers.set_data(xs, ys)
> self.canvas.draw()
> 
> fig = plt.figure()
> ax = fig.add_subplot(111)
> x, y = np.random.rand(2, 30)
> line, = ax.plot(x, y, 'bs-', picker=5)
> 
> selector = HighlightSelected(line)
> plt.show()
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/Plotting-single-marker-point-at-zoomed-level-tp17470649p17511209.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Johann Cohen-T. <co...@sl...> - 2008年05月28日 06:59:34
Reposting as it seems to have fallen through the cracks...
sorry in advance if it was not the case,
Johann
hello,
when histogramming a distribution in log scale, I have some empty bins, 
which drives the y axis to 1e-100 as a lower limit, completely squashing 
the histogram.... Bug or feature?
Johann
PS To be specific :
In [22]: entries, bins, patches = 
pl.hist(np.array(list1),bins=50,normed=1,log=True)
In [23]: entries
Out[23]:
array([ 1.18347753e+00, 4.10926113e-01, 2.53989507e-01,
 1.84039145e-01, 1.27510992e-01, 9.21486321e-02,
 7.45965117e-02, 5.08495253e-02, 4.23315845e-02,
 3.43298825e-02, 2.78768971e-02, 1.83264787e-02,
 1.62615233e-02, 1.23897320e-02, 1.26478515e-02,
 7.74358253e-03, 4.38803010e-03, 5.93674661e-03,
 3.61367185e-03, 4.38803010e-03, 2.58119418e-03,
 1.29059709e-03, 7.74358253e-04, 1.03247767e-03,
 1.54871651e-03, 2.32307476e-03, 5.16238835e-04,
 2.58119418e-04, 1.03247767e-03, 2.58119418e-04,
 5.16238835e-04, 0.00000000e+00, 2.58119418e-04,
 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
 2.58119418e-04, 2.58119418e-04, 2.58119418e-04,
 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
 0.00000000e+00, 2.58119418e-04])
In [24]: bins
Out[24]:
array([ 3.36150086e-09, 3.87417583e-01, 7.74835162e-01,
 1.16225274e+00, 1.54967032e+00, 1.93708790e+00,
 2.32450548e+00, 2.71192306e+00, 3.09934064e+00,
 3.48675822e+00, 3.87417580e+00, 4.26159338e+00,
 4.64901096e+00, 5.03642854e+00, 5.42384612e+00,
 5.81126370e+00, 6.19868128e+00, 6.58609885e+00,
 6.97351643e+00, 7.36093401e+00, 7.74835159e+00,
 8.13576917e+00, 8.52318675e+00, 8.91060433e+00,
 9.29802191e+00, 9.68543949e+00, 1.00728571e+01,
 1.04602746e+01, 1.08476922e+01, 1.12351098e+01,
 1.16225274e+01, 1.20099450e+01, 1.23973625e+01,
 1.27847801e+01, 1.31721977e+01, 1.35596153e+01,
 1.39470329e+01, 1.43344504e+01, 1.47218680e+01,
 1.51092856e+01, 1.54967032e+01, 1.58841208e+01,
 1.62715383e+01, 1.66589559e+01, 1.70463735e+01,
 1.74337911e+01, 1.78212087e+01, 1.82086262e+01,
 1.85960438e+01, 1.89834614e+01, 1.93708790e+01])
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Showing 17 results of 17

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 によって変換されたページ (->オリジナル) /