Re: [Matplotlib-users] animated plot with autoscaling

2008-04-25 Thread Matthias Michler
Hello Glenn

Do you refer to a special example?
Maybe the following helps you.
--
from pylab import *

ion()
ax = subplot(111)
# ... some plotting
ax.relim()  # reset intern limits of the current axes
ax.autoscale_view()   # reset axes limits

ioff()
show()
--

Good luck,
Matthias

On Friday 25 April 2008 08:01:24 G Jones wrote:
 I would like to extend the animated plot paradigm to an application
 where I need to autoscale the vertical axis each time the plot is
 updated. Any suggestions as to how to do so? I assume I need to tell
 the axis to autoscale, then draw the axis' artist. However, I am not
 sure how to do these things, I'm having trouble finding the
 appropriate methods in the matplotlib class documentation.
 Thanks,
 Glenn

 -
 This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
 Don't miss this year's exciting event. There's still time to save $100.
 Use priority code J8TL2D2.
 http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/java
one ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] animated plot with autoscaling

2008-04-25 Thread G Jones
Hello,
Thank you for the suggestion. However, I am refering to the
canvas.restore_region, draw_artist, blit, gui_repaint sort of
animation.
Glenn

On Thu, Apr 24, 2008 at 11:13 PM, Matthias Michler
[EMAIL PROTECTED] wrote:
 Hello Glenn

  Do you refer to a special example?
  Maybe the following helps you.
  
 --
  from pylab import *

  ion()
  ax = subplot(111)
  # ... some plotting
  ax.relim()  # reset intern limits of the current axes
  ax.autoscale_view()   # reset axes limits

  ioff()
  show()
  
 --

  Good luck,
  Matthias



  On Friday 25 April 2008 08:01:24 G Jones wrote:
   I would like to extend the animated plot paradigm to an application
   where I need to autoscale the vertical axis each time the plot is
   updated. Any suggestions as to how to do so? I assume I need to tell
   the axis to autoscale, then draw the axis' artist. However, I am not
   sure how to do these things, I'm having trouble finding the
   appropriate methods in the matplotlib class documentation.
   Thanks,
   Glenn
  
   -
   This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
   Don't miss this year's exciting event. There's still time to save $100.
   Use priority code J8TL2D2.
   http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/java
  one ___
   Matplotlib-users mailing list
   Matplotlib-users@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/matplotlib-users



  -
  This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
  Don't miss this year's exciting event. There's still time to save $100.
  Use priority code J8TL2D2.
  
 http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 'plot' broken on latest svn

2008-04-25 Thread Antonio Gonzalez
Eric Firing wrote:
 John Hunter wrote:
 On Wed, Apr 23, 2008 at 6:45 AM, Antonio Gonzalez [EMAIL PROTECTED] wrote:
 Hello,

  I've just updated to the latest svn (5063) and now I cannot create a
  simple plot. If I just try (in ipython -pylab):

  plot(rand(10))

  I get:

  type 'exceptions.AttributeError': 'module' object has no attribute
  'masked_invalid'
 matplotlib svn requires numpy svn.  Try upgrading your numpy and I
 think this bug will go away.
 
 I put in a temporary workaround, but what we need is a numpy version 
 check when mpl is imported.  I can put something in based on parsing 
 numpy.__version__; is there a better or more standard way to do this?
 
 Eric

Thanks for the replies. I'm now using numpy svn and all works well.
May I suggest, then -- maybe a warning should indeed arise at build 
time? Currently, mpl svn recognises non-svn numpy as an acceptable 
'required dependency' during the building process (as reported at the 
beginning of the 'python setup.py build' output).

Antonio

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] font always the same in PNG

2008-04-25 Thread Michael Droettboom
There are at least a couple of fishy things here.  It doesn't seem to 
find the Vera fonts that matplotlib installs in mpl-data.  Did you 
remove them, or perhaps the Ubuntu or Debian packagers removed them?  
Then at least the default font would be correct (and not cmr10.ttf, 
which is a very bad choice since it uses a TeX encoding).

As for why it is not picking up FreeSans like you request, my best guess 
is that the default properties to not align correctly with it.  This is 
a major shortcoming of the font looking mechanism in 0.90 that was 
addressed in 0.91.  There is a possible workaround that is somewhat 
painful.  If you run the following command in a shell, you should see 
all of the details about the given font:

  fc-match -v FreeSans
Pattern has 27 elts (size 32)
family: Bitstream Vera Sans(s)
familylang: en(s)
style: Roman(s)
stylelang: en(s)
slant: 0(i)(s)
weight: 80(i)(s)
width: 100(i)(s)
size: 12(f)(s)
pixelsize: 12.5(f)(s)
foundry: bitstream(s)
hintstyle: 1(i)(w)
hinting: FcTrue(w)
verticallayout: FcFalse(s)
autohint: FcFalse(s)
globaladvance: FcTrue(s)
file: /home/mdroe/.fonts/Vera.ttf(s)

etc...

(I don't have FreeSans, so the above is for the next best match on my 
machine, Vera Sans).

Now, if you specify the font as specifically as possible, you may get it 
to grab your font:

rc('font',**{'family':'sans-serif','sans-serif':['FreeSans'],'weight':80, 
'style':'Roman'})


(The above will need to be replaced with values for FreeSans, of course).

Let me know if that helps.

Cheers,
Mike

Paul Smith wrote:
 Michael Droettboom [EMAIL PROTECTED] writes:

   
 Paul Smith wrote:
 
 Hi Michael,

 I put in the rc line you suggested below into fonts_demo.py but didn't see 
   
 it 
   
 print any extra info (but did confirm in ipython that rcParams showed 
 verbose.level had changed to annoying). It just quietly finished 
   
 otherwise. 
   
 Did I miss something here? 
   
   
 Does it work if you put this into your matplotlibrc?

   verbose.level: debug-annoying

 (Note it's debug-annoying, not simply annoying)
 
 I've linked the output of fonts_demo.py to;
 https://www.box.net/shared/static/o693hq3soo.png
   
   
 Hmm.  That font is definitely not Vera Sans.  Something really odd is 
 going on here.
 I can appreciate that goal -- and AFAIK it does work for other users on 
 
 Ubuntu 7.10 so there is probably just
   
 some configuration problem here that we can hopefully get to the bottom of.

 Do you have any customizations in your matplotlibrc?

 Cheers,
 Mike

 


 Mike,

 I've not made any other changes to matplotlibrc. In fact I only just now have 
 copied the one in /etc to my $HOME/.matplotlib directory. It still seemed to 
 pick up the /etc version as you'll see below, I guess coz I was sudo'd as 
 root? :) anyway...
 Interesting the font search path seems to only include mpl-data fonts, but it 
 does seem to know about the ones in /usr/share/fonts/truetype/freefont. Then 
 fails to use one, so we're always back to cmr10. The output below was for my 
 test plot but it's pretty much the same (longer) story for fonts_demo.py  I 
 tried copying all the freetype fonts into mpl-data/font and everything came 
 out FreeSansOblique. Still failed to find the correct font, but used 
 something 
 a little closer. What do you make of it?
 I'll be away for a while but I'll check the list if I can.

 Cheers,
 Paul

 debug-annoying dump from my test plot program
 
 loaded rc file /etc/matplotlibrc
 matplotlib version 0.90.1
 verbose.level debug-annoying
 interactive is False
 units is True
 platform is linux2
 loaded modules: 
 ['_bisect', 'distutils', 'random', 'datetime', 'matplotlib.tempfile', 
 'distutil
 s.sysconfig', 'encodings.encodings', 'pytz.cStringIO', 'struct', 'tempfile', 
 'p
 ytz.os', 'zipimport', 'string', 'encodings.utf_8', 'matplotlib.__future__', 
 'py
 tz.tzinfo', 'pytz.datetime', 'distutils.re', 'bisect', 'signal', 
 'matplotlib.py
 tz', 'pytz.tzfile', 'cStringIO', 'locale', 'encodings', 'dateutil', 
 'matplotlib
 .warnings', 'pytz.pytz', 'matplotlib.sys', 're', 'math', 'fcntl', 'UserDict', 
 '
 distutils.os', 'matplotlib', 'codecs', 'md5', '_locale', 'matplotlib.os', 
 'thre
 ad', 'itertools', 'distutils.sys', 'os', '__future__', '_sre', '__builtin__', 
 '
 matplotlib.re', 'operator', 'distutils.string', 'matplotlib.datetime', 
 'posixpa
 th', 'errno', 'binascii', 'sre_constants', 'matplotlib.md5', 'types', 
 'pytz.sys
 ', '_codecs', 'pytz', 'copy', '_struct', '_types', 'matplotlib.dateutil', 
 'hash
 lib', 'posix', 'encodings.aliases', 'exceptions', 'sre_parse', 'pytz.bisect', 
 '
 distutils.distutils', 'copy_reg', 'sre_compile', '_hashlib', '_random', 
 'pytz.s
 truct', 'site', '__main__', 'shutil', 'strop', 'encodings.codecs', 'gettext', 
 '
 pytz.sets', 'stat', 

Re: [Matplotlib-users] Strange Plotting Behavior When Extremely Zoomed

2008-04-25 Thread Michael Droettboom
I'm not able to reproduce this bug.  What version of matplotlib are you 
using and which backend?

Cheers,
Mike

Sunzen Wang wrote:
 Hi,

 As title, When extremely zooming in by 'Zoom to Rectangle' navigation 
 button, there will  strange plot. A script is attached and two strange 
 plots are attached. The problem can be easily reproduced  by selecting 
 a tiny(Please refer to xaxis on attached strange plots for a sense) 
 rectangle area which contains a vertexes.
 Does anyone notice the problem and has something to say about it? Is 
 there some limitation in zoom operation?  

 Thank you for your opinion and guidance.

 Regards
 -- 
 sunzen
 freedom  enjoyment

 

 

 

 -
 This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
 Don't miss this year's exciting event. There's still time to save $100. 
 Use priority code J8TL2D2. 
 http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
 

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 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


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 'plot' broken on latest svn

2008-04-25 Thread John Hunter
On Fri, Apr 25, 2008 at 6:26 AM, Antonio Gonzalez [EMAIL PROTECTED] wrote:

  Thanks for the replies. I'm now using numpy svn and all works well.
  May I suggest, then -- maybe a warning should indeed arise at build
  time? Currently, mpl svn recognises non-svn numpy as an acceptable
  'required dependency' during the building process (as reported at the
  beginning of the 'python setup.py build' output).

Done in r5074.  I don't have an older numpy lying around to test my
changes, but I think I got it right.  In check_for_numpy:

major, minor1, minor2 = map(int, numpy.__version__.split('.')[:3])
if major1 or (major==1 and minor11):
print_status(numpy version, no)
print_message(You must install numpy 1.1 or later to build
matplotlib.)

return False


JDH

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 'plot' broken on latest svn

2008-04-25 Thread Eric Firing
Antonio Gonzalez wrote:
 Eric Firing wrote:
 John Hunter wrote:
 On Wed, Apr 23, 2008 at 6:45 AM, Antonio Gonzalez [EMAIL PROTECTED] wrote:
 Hello,

  I've just updated to the latest svn (5063) and now I cannot create a
  simple plot. If I just try (in ipython -pylab):

  plot(rand(10))

  I get:

  type 'exceptions.AttributeError': 'module' object has no attribute
  'masked_invalid'
 matplotlib svn requires numpy svn.  Try upgrading your numpy and I
 think this bug will go away.
 I put in a temporary workaround, but what we need is a numpy version 
 check when mpl is imported.  I can put something in based on parsing 
 numpy.__version__; is there a better or more standard way to do this?

 Eric
 
 Thanks for the replies. I'm now using numpy svn and all works well.
 May I suggest, then -- maybe a warning should indeed arise at build 
 time? Currently, mpl svn recognises non-svn numpy as an acceptable 
 'required dependency' during the building process (as reported at the 
 beginning of the 'python setup.py build' output).

Antonio,

Good idea. John beat me to it by a little less than an hour, so it is 
done now.  I added the python 2.4 requirement.

Eric

 
 Antonio

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] ImportError: cannot import name rcParams

2008-04-25 Thread Rich Fought
Hi,

I'm getting the following error when trying to create a plot with
matplotlib.  I am using matplotlib-0.91.2 on CentOS 4 with python 2.3.
We are running it with mod_python and Apache in a web service
configuration.

File
/usr/lib/python2.3/site-packages/matplotlib-0.91.2_r0-py2.3-linux-i686.egg/matplotlib/dates.py,
 line 88, in ?
import matplotlib.ticker as ticker

  File 
/usr/lib/python2.3/site-packages/matplotlib-0.91.2_r0-py2.3-linux-i686.egg/matplotlib/ticker.py,
 line 116, in ?
from matplotlib import verbose, rcParams

ImportError: cannot import name rcParams

This error has only appeared since we started using Apache 2.2 instead
of 2.0.  I can do the import just fine from the command line in a python
2.3 shell.  Any ideas?

Thanks,
Rich


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ImportError: cannot import name rcParams

2008-04-25 Thread John Hunter
On Fri, Apr 25, 2008 at 11:51 AM, Rich Fought [EMAIL PROTECTED] wrote:

  This error has only appeared since we started using Apache 2.2 instead
  of 2.0.  I can do the import just fine from the command line in a python
  2.3 shell.  Any ideas?

My guess is that somewhere on your system you have an old matplotlib
installed that had the namespace package declared, and this is fouling
up your import.

JDH

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How do you static link to freetype when building eggs?

2008-04-25 Thread Christopher Barker
John Hunter wrote:
  Instead of all of us going through the pain of figuring out how to build
  and link static libs for MPL, and PIL, and GDAL, and ???, why don't we
  just build against the nice Frameworks here:

  http://www.kyngchaos.com/wiki/software:frameworks

 I read your post and perhaps I am missing the obvious, but my basic
 question is: apple provides libpng and freetype with xcode which ships
 with their computers (an optional install from their cd) and these
 work fine with MPL, so why should we require an external dependency?

I'd love it if Apple provided this stuff.

Are they static libs? What versions do they ship them with -- I don't 
have OS-X 10.5, and I don't think I have them -- maybe I need to update 
XCode.

freetype comes with X11, which is optional (though installed by default 
on 10.5).

Also, I need libjpeg for PIL, but I guess that's not an OS-X issue.

Here's the goal:

Be able to easily build and distribute binaries of MPL (and other 
packages that require require similar libs). These binaries should:

   (1) Run on any OS-X 10.4+ system (10.3.9 would be nice too) with 
python.org's 2.5 framework build.

   (2) Allow packaging up with py2app, to get packages that will run on 
any 10.4+ system.

As far as I know, the only way to do that now is to statically link 
against universal builds of all the dependencies that Apple does not 
provide on a stock 10.4 system. The problem is that there doesn't seem 
to be any standard source of Universal binaries for any of these libs 
(and the extra build flags required haven't made it into the source of 
the host projects). Also, it seems a bit silly to have a whole bunch of 
different packages all working hard to bundle in the same libs.

I just built PIL against William's Frameworks, and it was oh so easy -- 
this after spending quite a few hours trying (and not finishing) getting 
the required libs built as Universal.

We can only use Apple's libs if:
   They provide static Universal versions
or
   The dynamic libs are there on All 10.4+ OS-X boxes.

Maybe we can use more Apple libs for 10.5 only builds.

William has some good comments on this in this thread on the pythonmac list:
  - http://mail.python.org/pipermail/pythonmac-sig/2008-April/019988.html

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How do you static link to freetype when building eggs?

2008-04-25 Thread Christopher Barker
John Hunter wrote:
 I may have spoken too quickly -- I forgot that on my system in order
 to get the mpl build to find the xcode libpng and freetype libs I had
 to install pkgconfig, as I described at

 so it is not exactly automatic.  But it does work, in my experience.

The issue here is not that it isn't automatic -- we could fix that -- 
it's that we can't count on X11 libs being there, particularly on 10.4 
systems.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] markeredgewidth and pdf

2008-04-25 Thread Christopher Brown
Hi List,

With mpl 0.91.2, the markeredgewidth property does not seem to have an 
effect when using the pdf backend (seems to always be 1, regardless of 
what I set it to, and it seems to be fine with other backends). Here is 
a minimal example:

from matplotlib import use
#use('pdf') # - Uncomment for pdf

import matplotlib.pyplot as plt
hf=plt.plot([1,2],[1,1],marker='o',mfc='white', ms=12, mew=4, ls=None)
plt.xlim(.5,2.5)
plt.savefig(c:\\test)

-- 
Chris

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users