Re: [Matplotlib-users] Qt4 Designer Example

2015-04-15 Thread Chris O'Halloran
On 16 April 2015 at 09:51, Benjamin Root ben.r...@ou.edu wrote:

 A little birdie has told me that someone else is writing a new
 comprehensive matplotlib book (I think it would replace Sandros' book).
 Last I heard from the birdie, he was most of the way done with the
 manuscript. Based on my experience with the edit/review process, I would
 guess 2-3 more months to see it finished and published.


Oh cool. I'll look out for this. Will it be advertised on this list?
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] Matplotlib and Numfocus Fiscal Sponsorship Agreement (FSA)

2015-01-21 Thread Chris Barker
+1 -- sounds great!



On Tue, Jan 20, 2015 at 7:48 AM, Michael Droettboom md...@stsci.edu wrote:









 * Matplotlib is a widely used, well regarded, and powerful visualization
 library that has dominated the Python visualization stack for over a
 decade. However, to maintain that position, matplotlib must continue to
 evolve. Complementary or alternative libraries are appearing at an
 increasing rate, including browser-based plotting and GPU acceleration. To
 maintain its leadership position for the next decade, Matplotlib must
 interface with these alternatives while simultaneously expanding its
 capabilities and becoming easier to use and learn. Matplotlib’s large
 existing user base (greater than 50,000) means that new developments need
 to be carefully balanced with maintaining existing interfaces.  With the
 large user and code base comes a significant maintenance and user-support
 burden.  These responsibilities currently account for a majority of the
 core-developer time spent on matplotlib and has resulted in both the code
 base and community being in a healthier state than ever before. Even 6
 years ago there was no automated testing to speak of and the number of
 contributors continues to soar on github. However, this effort is, for the
 most part, done on a volunteer basis in the nights and weekends of the core
 developers.  To go beyond this maintenance level—to make step-change
 improvements for the benefit of matplotlib’s users—will require funding for
 full-time developers. Inspired and encouraged by the example of IPython, we
 would like to begin the process of fundraising. Managing funding on the
 needed scale is a complex and time-consuming process.  Thankfully,
 NumFOCUS, a 501(c)3 charity organisation co-founded by John Hunter, offers
 a fiscal sponsorship agreement to minimize the administrative and legal
 burden on open source projects. We would like to enlist NumFOCUS as our
 agents in all legal and financial matters, including banking, accepting
 donations as a non-profit, payroll, and access to legal counsel.  As part
 of the agreement, NumFOCUS would charge a percentage of all funds raised to
 cover their costs.  The full text of the agreement is attached. To comply
 with the legal and accounting requirements of a non-profit, matplotlib
 needs to form an administrative body to interact with NumFOCUS and direct
 the disbursement of any funds.  The proposed initial members of the body,
 are myself (Mike Droettboom), Eric Firing, Phil Elson, and Thomas Caswell,
 with Thomas acting as the point of contact with NumFOCUS. In practice,
 signing an FSA will have very little impact on the matplotlib project
 itself - it will still be BSD-licensed and community-driven as it has
 always been, and the only motivation for doing this is to give us an
 opportunity to apply for funding to do more work on matplotlib. We'd like
 to canvas the community's opinion on the matter, but to put a concrete
 timeline on the discussion, we would like to propose signing an FSA with
 NumFOCUS in 3 weeks (Feb 10th 2015) unless there is a major community
 discomfort with us doing so. Cheers, Michael Droettboom *

 --
 Michael Droettboom
 Science Software Branch
 Space Telescope Science Institute
 http://www.droettboom.com



 --
 New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
 GigeNET is offering a free month of service with a new server in Ashburn.
 Choose from 2 high performing configs, both with 100TB of bandwidth.
 Higher redundancy.Lower latency.Increased capacity.Completely compliant.
 http://p.sf.net/sfu/gigenet
 ___
 Matplotlib-devel mailing list
 matplotlib-de...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel




-- 

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

chris.bar...@noaa.gov
--
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best way to browse images

2014-10-14 Thread Chris Beaumont
I've found that, for big images, the *first* draw is very slow, due to the
intensity scaling of the image, which happens at full resolution. Panning
and zooming afterwards is fast because the intensity scaling is cached, but
changing the data array or updating the norm kwarg is slow again. I made
ModestImage (https://github.com/ChrisBeaumont/mpl-modest-image) to deal
with this -- it dynamically downsamples images to screen resolution. This
makes the first draw after updating the data or norm much faster, while
slowing down subsequent redraws. Perhaps this could help you out?

cheers,
chris

On Tue, Oct 14, 2014 at 12:08 PM, Benjamin Root ben.r...@ou.edu wrote:

 Only if there are multiple figures (plt.draw() operates on the current
 active figure, while fig.draw() explicitly operates upon that figure).
 Another possibility is that the bottleneck truly is the IO. Depending on
 exactly how fits work, it might be lazily loading data for you, so the test
 without the display of the images might not actually be loading any data
 into memory.

 Ben Root

 On Tue, Oct 14, 2014 at 11:22 AM, Slavin, Jonathan 
 jsla...@cfa.harvard.edu wrote:

 Hmm.  I just saw that you suggest fig.draw().  Is there a difference with
 plt.draw()?

 Jon

 On Tue, Oct 14, 2014 at 11:20 AM, Slavin, Jonathan 
 jsla...@cfa.harvard.edu wrote:

 Hi Ben,

 Sorry, in my little example, I left out a few things.  I do update first
 after the first call.  And I do call draw() after other calls.  So here is
 a more accurate representation of what I do:

 first = True
 fig = plt.figure()
 for file in files:
 hdu = fits.open(file)
 image = hdu[0].data
 hdu.close()
 if first:
 ax = fig,add_subplot(1,1,1)
 im = ax.imshow(image)
 plt.show()
 first = False
 else:
 im.set_data(image)
 plt.draw()
 ans = raw_input('continue?')
 if ans == 'n':
 break

 Jon


 On Tue, Oct 14, 2014 at 10:42 AM, Benjamin Root ben.r...@ou.edu wrote:

 Also, you aren't updating first after the first call, so it is
 constantly making new axes and recalling imshow().

 Ben Root

 On Tue, Oct 14, 2014 at 10:41 AM, Benjamin Root ben.r...@ou.edu
 wrote:

 What is happening is that you are not telling the image to redraw, so
 you are only seeing it refresh for other reasons. Try adding a fig.draw()
 call prior to the raw_input() call.

 Cheers!
 Ben Root

 On Tue, Oct 14, 2014 at 10:03 AM, Slavin, Jonathan 
 jsla...@cfa.harvard.edu wrote:

 Hi all,

 In my work lately I have often wanted to browse through a series of
 images.  This means displaying the image(s), looking at it/them and then
 continuing.  I have coded this in a few different ways, but it is 
 generally
 pretty slow -- which is to say that the image display takes more than a
 couple seconds (~4) after I tell it to continue to the next image.  I
 tested the loop without image display and it was a factor of ~80 times
 faster than it was with image display, so it's doesn't have anything to 
 do
 with reading the images from disk.  My latest approach is basically:
 first = True
 fig = plt.figure()
 for file in imagefiles:
 # read in image data (fits files)
 if first:
 ax = fig.add_suplot(1,1,1)
 im = ax.imshow(image)
 else:
 im.set_data(image)
 ans = raw_input('continue?')
 if ans == 'n':
 break

 Is there a more efficient way to do this?

 Regards,
 Jon

 --
 
 Jonathan D. Slavin Harvard-Smithsonian CfA
 jsla...@cfa.harvard.edu   60 Garden Street, MS 83
 phone: (617) 496-7981   Cambridge, MA 02138-1516
 fax: (617) 496-7577USA
 



 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push
 notifications.
 Take corrective actions from your mobile device.
 http://p.sf.net/sfu/Zoho
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users






 --
 
 Jonathan D. Slavin Harvard-Smithsonian CfA
 jsla...@cfa.harvard.edu   60 Garden Street, MS 83
 phone: (617) 496-7981   Cambridge, MA 02138-1516
 fax: (617) 496-7577USA
 




 --
 
 Jonathan D. Slavin Harvard-Smithsonian CfA
 jsla...@cfa.harvard.edu   60 Garden Street, MS 83
 phone: (617) 496-7981   Cambridge, MA 02138-1516
 fax: (617) 496-7577USA

Re: [Matplotlib-users] 'save file' GUI dialog

2014-06-20 Thread Chris Beaumont
Hey Tom,

It looks like the only backend-agnostic file save function is save_figure()
(a toolbar method), which conflates choosing a filename and doing the
actual saving. The backend-specific code to choose a filename via a dialog
isn't uniform:

Qt4:
matplotlib.backends.backend_qt4._getSaveFileName

MacOS
matplotlib.backends.backend_osx._macosx.choose_save_file

Wx:
A bunch of code in matplotlib.backends.backend_wx.save_figure

TkAgg:
Tkinter.FileDialog

GtkAgg:
get_filechooser().get_filename_from_user()

It looks like, at a minimum, you would have to write your own wrapper code
to make a backend-agnostic interface for choosing a filename. Of course, if
you did that, it would also be nice to refactor that into MPL itself... :)

chris


On Fri, Jun 20, 2014 at 8:22 AM, Thomas Robitaille 
thomas.robitai...@gmail.com wrote:

 Hi everyone,

 I'm developing a simple GUI tool in Matplotlib that relies on the
 event framework to handle buttons/sliders. I am trying to avoid using
 a GUI toolkit directly to ensure maximum compatibility for users.

 One thing I would like is to be able to have a 'save' button that will
 open up a standard 'save file' dialog window (but not necessarily the
 plot itself). Matplotlib already has 'save file' GUI dialogs for the
 different backends, so I was wondering whether there is an easy and
 abstract way of asking matplotlib to open a 'save file' dialog and
 capturing the output? Or is this all handled separately in the
 different backends?

 Thanks!
 Tom


 --
 HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
 Find What Matters Most in Your Big Data with HPCC Systems
 Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
 Leverages Graph Analysis for Fast Processing  Easy Data Exploration
 http://p.sf.net/sfu/hpccsystems
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 --
 *
 Chris Beaumont
 Senior Software Engineer
 Harvard Center for Astrophysics
 60 Garden Street, MS 42
 Cambridge, MA 02138
 chrisbeaumont.org
 *

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting large images

2013-08-27 Thread Chris Beaumont
I've been burned by this before as well. MPL stores some intermediate data
products (for example, scaled RGB copies) at full resolution, even though
the final rendered image is downsampled depending on screen resolution.

I've used some hacky tricks to get around this, which mostly involve
downsampling the image on the fly based on screen resolution. One such
effort is at https://github.com/ChrisBeaumont/mpl-modest-image.

If you are loading your arrays from disk, you can also use memory-mapped
arrays -- this prevents you from loading all the data into RAM, and further
cuts down on the footprint.

cheers,
chris


On Tue, Aug 27, 2013 at 6:49 AM, Štěpán Turek stepan.tu...@seznam.czwrote:


 You could look at whether or not you actually need 64-bit precision. Often
 times, 8-bit precision per color channel is justifiable, even in grayscale.
 My advice is to play with the dtype of your array or, as you mentioned,
 resample.


 thanks, this helped me significantly,  uint8 precision is enough.



 Also, is it needed to keep all images? It sounds to me like your
 application will become very resource hungry if you're going to be
 displaying several of these 2D images over each other (and if you don't use
 transparency, you won't get any benefit at all from plotting them together).


 Yes, I need them all .

 To avoid it I am thinking about merging them into one image and then plot
 it.


 Stepan



 --
 Introducing Performance Central, a new site from SourceForge and
 AppDynamics. Performance Central is your source for news, insights,
 analysis and resources for efficient Application Performance Management.
 Visit us today!
 http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] I have a Mac!

2013-08-23 Thread Chris Barker - NOAA Federal
On Fri, Aug 23, 2013 at 8:14 AM, Matt Terry matt.te...@gmail.com wrote:
 I'm banging away at installing MPL on top of python.org's python.

This is why binary installers are good idea!

 the libfreetype/freetype issue.

yeah, that's kind of uglyand where is doesn't just work for me...

 1) install libpng[1] and freetype[2] from source

libpng and freetype are different, though install from source may be
the way to go:

libpng is there, but is not properly installed, I'm not sure it's got
the header for the same version as the lib, and libpng-config is
either not there or not for the right version or somethign ugly. It
look, form messages at build time, that someone has hacked some code
into the MPL build that figures all that out, but for other stuff I'm
doing, I just punt and build libpng -- that's pretty straighforward,
at least. But teh solution in the MPL code now seems to work.

 2) install XQuartz[3] and twiddle /opt/X11, /usr/X11 (per Russell's
 directions[4]) so MPL finds XQuartz's libpng/freetype

I _think_ that OS-X now ships with X11, which has freetype (though
installed weirdly once again...) we certainly should NOT expect people
to install anything big to build MPL, and binaries should not depend
on anything not shipped by Apple by default.

According to Russell, you do need to install something, so I think that's out.

 4) create the MPL binary installer and use that

That's what most people should do -- but one of us needs to build it.

 Option 1 seems simple-est, but installing freetype requires more than
 ./configure  make  sudo make install.

darn. But hopefully we can figure it out.

 Option 4: This would require some input from whoever (Gohlke?, Owen?) makes
 the binary installers.

I think Russell has been doing it for MPL lately.

My thoughts:

We want to support two user-bases:

1) folks that don't mind a little command line work, and probably need
other scientific libs, etc anyway, an want an MPL that runs on their
machine:
   - these folks should use homebrew or macports to build the
dependencies (or even hand-compile them). Ideally we have setup.py
that will find those libs, and test to see that the builds work once
in a while.

2) folks that just want to use it and/or want a binary they can
re-distribute via py2app, etc.
  - for these folks, we need to provide binaries. These binaries should:
   1) Match the python.org python builds. (probably only the Intel ones now...)
   2) statically link the non-sytem libs

This has been done for a while, off and on, most recently by Russell, AFAIK.

But this is not a problem unique to MPL. All sorts of python packages
need this, and only some of the package maintainers do it (well).
Also, a bunch of packages require the same dependencies (i.e. PIL and
MPL both need png and freetype)

So, rather than re-inventing the wheel over and over again, It would
be great to have a central repository where we can develop build
scripts, etc that share an infrustructure for building these binaries.

I've started one:

https://github.com/MacPython/mac-builds

there is not much there, only a couple things I'm working on at the
moment (netCDF4, which is of interest to scipy folks, and py_gd, which
is my own simple drawing lib, that no one else uses (yet?)

If anyone wants to join the project let me know -- if I know you from
your work with this community, I'll gladly add you.

I'm using the gattai build system:
(https://sourceforge.net/projects/gattai/). I decided to do that, as I
was sick of re-writing essentially the same build scripts, and I kept
adding features to mine that would have resulted in re-implementing
gattai anyway. I've been hacking at gattai, and its author is quite
open to moving it forward.

That being said, there is no reason that we need to use the same build
system -- we could easily have custom build scripts for a project, and
still have it share the dependencies.

I was planning on getting it all further along before announcing the
project and looking for help, but since is came up...

-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

chris.bar...@noaa.gov

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Intersecting polygons

2013-08-23 Thread Chris Beaumont
Thanks for the tips -- I wish there was a way to do this within MPL, but it
sounds like I'll have to live with external hackery.


  PS. Try to convince the Dark Powers of the journal you send your work,
  that they modernize their processing and accept PDF.
 +1


I know, right?

chris
--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Intersecting polygons

2013-08-22 Thread Chris Beaumont
Hi,

I have a semitransparent plot that I rather like:

[image: Inline image 1]
I'd like to publish something like this in a journal which requires EPS
figures. Unfortunately, EPS doesn't support transparency.

How hard would it be to coax matplotlib (or another tool) to convert this
semi-transparent figure into a non-semitransparent figure that looks the
same? It would consist of more polygons, each of which has a constant RGB
value in the transparent figure.

I don't want to rasterize the lines, because I like zooming absurdly far
into plots, and having them stay crisp.

Cheers,
Chris
image.png--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Intersecting polygons

2013-08-22 Thread Chris Beaumont
Thanks for these tips. It looks like some programs (like illustrator, and
pdf2ps) are semi-smart about handling transparency when converting to ps.
Both have their quirks (illustrator seems to mess up the bounding box,
pdf2ps makes the text look worse/fuzzy).

Is this the recommended/best strategy?

Thanks,
chris


On Thu, Aug 22, 2013 at 8:04 PM, Jerzy Karczmarczuk 
jerzy.karczmarc...@unicaen.fr wrote:

 Chris Beaumont :
 
  I have a semitransparent plot that I rather like:
 ...
  I'd like to publish something like this in a journal which requires
  EPS figures. Unfortunately, EPS doesn't support transparency.
 
  How hard would it be to coax matplotlib (or another tool) to convert
  this semi-transparent figure into a non-semitransparent figure that
  looks the same?

 I won't claim that this is an ultimate solution, but what I did a few
 times was to
 1. Choose the svg backend, savefig the picture as svg.
 2. Open in Inkscape and export as .eps.

 The result was satisfactory.

 Jerzy Karczmarczuk



 --
 Introducing Performance Central, a new site from SourceForge and
 AppDynamics. Performance Central is your source for news, insights,
 analysis and resources for efficient Application Performance Management.
 Visit us today!
 http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] Calling to those embedding matplotlib in applications

2013-08-12 Thread Chris Barker - NOAA Federal
On Mon, Aug 12, 2013 at 7:01 AM, Michael Droettboom md...@stsci.edu wrote:
  I propose to fix this by turning on interactive only when
 running at an interactive console.

I embed MPL more than other uses, and this sounds like a fine solution to me/

Thanks,

-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

chris.bar...@noaa.gov

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] linear regression with dates as x axis

2012-06-13 Thread Chris Withers
Hi all,

I have some time series of disk usage that I'd like to do a linear 
regression on an plot on a nice graph with Mb used on the y-axis and 
date on the x axis.

I tried to use pylab.polyfit(dates, usage) where:

dates = [datetime(x, y, z), datetime(a, b, c), ...]
usage = [12123234, 2234235235, ...]

...but polyfit doesn't like the dates.

How should I do this?

Any example of a nice plot and linear regression using matplotlib?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
 - http://www.simplistix.co.uk

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Focus in OSX

2012-04-11 Thread Chris Laumann
I get the exact same behavior from both Enthought supplied python and Apple 
supplied python. I haven't tried any other pythons, but it isn't limited to the 
Apple one.

C

On Apr 11, 2012, at 1:58 PM, Elliot Saba wrote:

 I'm using homebrew python, which is built from source, and the latest 
 matplotlib gotten from git://github.com/matplotlib/matplotlib.git.  (I 
 rebuilt it ~2 minutes ago)
 
 Perhaps there's some kind of environment difference?
 -E
 
 On Wed, Apr 11, 2012 at 5:12 AM, Zachary Pincus zachary.pin...@yale.edu 
 wrote:
  1. Keyboard input always goes to the terminal. Shortcuts don't work in the 
  standard plot windows and my custom widgets no longer catch 
  key_press_events  (I'm not sure when this functionality broke exactly as I 
  haven't used those widgets much recently but it worked when I developed 'em 
  a year or two ago.)
 
  2. There's no icon in the cmd-tab task switcher corresponding to the figure 
  windows. Swapping to the terminal running ipython (or the qtconsole for 
  ipython qtconsole) does not raise the windows.
 
  3. Using mission control, the figures appear grouped as if they belong to 
  an application of their own. However, when you click on them to swap to 
  them and bring them forward from behind other windows, they raise and then 
  immediately disappear again. I think that mission control is raising the 
  specific window you select from the collection of figures, but then OSX is 
  somehow immediately re-raising the previously selected app, which hides the 
  figures again.
 
 Hmm, I don't really see these issues, using a dev matplotlib, OS X 10.7.3, 
 and a python.org python 2.7. Interesting. (This is with the 'MacOSX' backend, 
 mind. Also note that on March 5 there was a patch to that backend to fix a 
 few issues, so if your matplotlib checkout is before that, perhaps that's the 
 problem?)
 
 Anyhow, when I start python (or ipython), and then do import 
 matplotlib.pyplot as plt, nothing happens, but then plt.figure(), for 
 example, causes a new dock icon to appear -- a python rocket-ship thing -- 
 that acts as an app that owns the figure windows. I can use this app to 
 switch to / raise the windows from the dock or the cmd-tab switcher, and 
 things work correctly via mission control as well.
 
 The keyboard shortcuts are a bit flaky ('s' never seems to work, but I can 
 e.g. toggle gridlines with 'g' or log-axes with 'l'), but the key-presses 
 definitely don't go to the terminal.
 
 I wonder what the difference is? Perhaps the apple-supplied python is a bit 
 broken in this regard?
 
 Zach
 --
 Better than sec? Nothing is better than sec when it comes to
 monitoring Big Data applications. Try Boundary one-second
 resolution app monitoring today. Free.
 http://p.sf.net/sfu/Boundary-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 --
 Better than sec? Nothing is better than sec when it comes to
 monitoring Big Data applications. Try Boundary one-second 
 resolution app monitoring today. Free.
 http://p.sf.net/sfu/Boundary-dev2dev___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Focus in OSX

2012-04-10 Thread Chris Laumann
Hi all-

I've been running into this issue for the last few months and at first thought 
it was Enthought specific but now have confirmed it on a clean (virtualenv) 
install of Fonnesbeck's superpack using built in Apple python and a dev 
matplotlib on Lion.

With the OSX backend, figures clearly have focus issues:

1. Keyboard input always goes to the terminal. Shortcuts don't work in the 
standard plot windows and my custom widgets no longer catch key_press_events  
(I'm not sure when this functionality broke exactly as I haven't used those 
widgets much recently but it worked when I developed 'em a year or two ago.)

2. There's no icon in the cmd-tab task switcher corresponding to the figure 
windows. Swapping to the terminal running ipython (or the qtconsole for ipython 
qtconsole) does not raise the windows.

3. Using mission control, the figures appear grouped as if they belong to an 
application of their own. However, when you click on them to swap to them and 
bring them forward from behind other windows, they raise and then immediately 
disappear again. I think that mission control is raising the specific window 
you select from the collection of figures, but then OSX is somehow immediately 
re-raising the previously selected app, which hides the figures again.

Just to check its not IPython's fault, I also checked running a bare python, 
import all from pylab and showed a (blocking) figure -- exact same behavior.

Is this a known bug? It's quite annoying not to be able to switch focus to a 
plot window.

Best, Chris
--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
I was trying to test the patch mike put in to fix the single pixel
plotting issue, but just realized that this was a Mac version.  Can I
use it on a linux box? How?

Thanks,
Chris

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
Thanks John.  Since I already have a running copy of mpl, I skipped to
the git clone step, but get this error:

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

I'm a complete noob on git, so please bear with me.

- Chris

On Wed, Feb 8, 2012 at 9:31 AM, John Hunter jdh2...@gmail.com wrote:


 On Wed, Feb 8, 2012 at 11:06 AM, Chris plut...@gmail.com wrote:

 I was trying to test the patch mike put in to fix the single pixel
 plotting issue, but just realized that this was a Mac version.  Can I
 use it on a linux box? How?


 These instructions are for an ubuntu based system -- if you are on a
 different version of linux you may need different commands to install git
 and the mpl build dependencies

 # install git to checkout the mpl src code
 sudo apt-get install git

 # install the pre-reqs to build matplotlib from source
 sudo apt-get build-dep python-matplotlib

 # get the latest released branch of matplotlib
 git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

 # cd into the matplotlib directory and create a branch off of the release
 branch to test
 cd matplotlib.git
 git checkout -b mdboom-pixel_marker v1.1.x

 # pull in Michael's changes
 git pull https://github.com/mdboom/matplotlib.git pixel_marker

 # build the matplotlib source code
 python setup.py build

 # install it
 sudo python setup.py install

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
This time the error is:

fatal: Not a git repository (or any of the parent directories): .git

I guess that I have not be able to establish a local git tree since the command

git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

did not go through.

- Chris

On Wed, Feb 8, 2012 at 9:48 AM, John Hunter jdh2...@gmail.com wrote:


 On Wed, Feb 8, 2012 at 11:39 AM, Chris plut...@gmail.com wrote:

 Thanks John.  Since I already have a running copy of mpl, I skipped to
 the git clone step, but get this error:

 Permission denied (publickey).
 fatal: The remote end hung up unexpectedly

 I'm a complete noob on git, so please bear with me.



 I think I should have pointed you to the read only address.  Try this:


  git pull git://github.com/mdboom/matplotlib.git pixel_marker

 JDH


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
New error at `git checkout -b mdboom-pixel_marker v1.1.x':

fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'v1.1.x' which can not be resolved as commit?

- Chris

On Wed, Feb 8, 2012 at 10:13 AM, John Hunter jdh2...@gmail.com wrote:


 On Wed, Feb 8, 2012 at 12:06 PM, Tony Yu tsy...@gmail.com wrote:

 git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git

 did not go through.

 - Chris


 I don't think you want the .git at the very end of the clone command.
 That just tells get where (i.e. new directory) to put the repo.


 I don't think that is the problem.  I just add the .git extension because
 the default is to check out a directory called matplotlib which if it is
 located in the path you are running or testing from, will confuse the
 import.  So I just add some extension so python won't confuse the mpl src
 dir (matplotlib.git) with the mpl package (matplotlib).

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use the github version on a linux box

2012-02-08 Thread Chris
Thanks Tony and JDH, problem resolved and now I can try to compile.

- Chris

On Wed, Feb 8, 2012 at 10:41 AM, Tony Yu tsy...@gmail.com wrote:


 On Wed, Feb 8, 2012 at 1:20 PM, Chris plut...@gmail.com wrote:

 New error at `git checkout -b mdboom-pixel_marker v1.1.x':

 fatal: git checkout: updating paths is incompatible with switching
 branches.
 Did you intend to checkout 'v1.1.x' which can not be resolved as commit?

 - Chris


 That looks like something I've done before without issue. Maybe you're on an
 older version of git. In any case, you can break this up into two steps

 # change to maintenance branch
 git checkout v1.1.x

 # create new branch based on current checkout
 git checkout -b mdboom-pixel_marker


 Then continue as John instructed.

 -Tony





 On Wed, Feb 8, 2012 at 10:13 AM, John Hunter jdh2...@gmail.com wrote:
 
 
  On Wed, Feb 8, 2012 at 12:06 PM, Tony Yu tsy...@gmail.com wrote:
 
  git clone g...@github.com:matplotlib/matplotlib.git matplotlib.git
 
  did not go through.
 
  - Chris
 
 
  I don't think you want the .git at the very end of the clone command.
  That just tells get where (i.e. new directory) to put the repo.
 
 
  I don't think that is the problem.  I just add the .git extension
  because
  the default is to check out a directory called matplotlib which if it
  is
  located in the path you are running or testing from, will confuse the
  import.  So I just add some extension so python won't confuse the mpl
  src
  dir (matplotlib.git) with the mpl package (matplotlib).



--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Why pixel marker size is 4 pixels?

2012-02-06 Thread Chris
JJ,

Thanks for the clarification.  Now I understand why EPS outputs of
pixel plot from mpl is a few times bigger than those from SuperMongo.
I guess that mpl uses the square implementation for pixel so that it
would use the same method to handle all marker types.  I will file an
issue report on git.  Meanwhile, is there any easy workaround?

Jonathan,

Tom Robitaille's module does help reducing file size of postscript,
but by rasterize a scalable plot.  It doesn't really help my problem
since the markers are still drawn with the same method as other
plotting methods.

Bests,
Chris


On Mon, Feb 6, 2012 at 4:28 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote:
 Thanks. Now I understand the situation.

 As far as I can see, marker=, is implemented as a rectangle path
 with width/height of 1 pixel, so this result in 2x2 pixel filled
 square.
 I tried to change the size of the rectangle, etc, to get a single
 pixel filled square, but did not get a satisfactory result.
 I think we need an Agg expert. I hope Mike or others take a look.

 Chris,
 if you do not get a response from others in this mailing list, I
 recommend you to open a new issue in our github page.

 Regards,

 -JJ



On Mon, Feb 6, 2012 at 6:19 AM, Jonathan Slavin jsla...@cfa.harvard.edu wrote:
 Chris,

 You might want to try a module written by Tom Robitaille (aka astrofrog)
 called rasterized_scatter.  Look for it on github.

 Jon

 On Mon, 2012-02-06 at 21:28 +0900, Jae-Joon Lee wrote:
 Thanks. Now I understand the situation.

 As far as I can see, marker=, is implemented as a rectangle path
 with width/height of 1 pixel, so this result in 2x2 pixel filled
 square.
 I tried to change the size of the rectangle, etc, to get a single
 pixel filled square, but did not get a satisfactory result.
 I think we need an Agg expert. I hope Mike or others take a look.

 Chris,
 if you do not get a response from others in this mailing list, I
 recommend you to open a new issue in our github page.

 Regards,

 -JJ


 On Mon, Feb 6, 2012 at 1:53 AM, Chris plut...@gmail.com wrote:
  Thanks JJ.
 
  The problem seems not to be a size issue --  markersize has no effect
  when use marker=, (pixel).  I have also tried to turn off aa, and it
  doesn't help either.  I also tried different backends.  The PNG output
  from Agg and Cairo is slightly different: Agg's point has 4 solid
  pixel, while Cairo's has 4 pixel with random shade.
 
  Postscript output has the same problem.  The pixel in an EPS file
  generated by mpl is significantly bigger than that from another
  drawing program I used.
 
  The problem occurs in all my plotting scripts, e.g., this basic one:
 
  [CODE]
  import numpy as np
 
  x=np.arange(100)
  y=np.random.randn(100)
 
  ioff()
  fig=gcf()
  fig.clf()
 
  ax=fig.add_axes(0.15,0.1,0.8, 0.85)
  ax.plot(x,y,k,)
 
  ion()
  fig.canvas.draw()
  [/CODE]
 
  Here is how I identify the problem:
  1. use the above script to plot on screen
  2. savefig(plot.png)
  3. open plot.png in GIMP and check the pixel size.
 
  I also attached the two PNG files generated with Agg and Cairo backends.
 
 
  On Sun, Feb 5, 2012 at 6:45 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote:
  How are you plotting your points.
 
  If you use *plot*, there is a *markersize* parameter.
  If you use *scatter*, the third argument controls the marker size.
 
  But you may actually complaining about other issues, e.g.,
  antialiasing, etc. So, if above are not your answer, please post a
  complete example and describe your problem in more detail.
 
  Regards,
 
  -JJ
 
 
  On Sat, Feb 4, 2012 at 2:15 PM, Chris plut...@gmail.com wrote:
  I noticed this a few years back, but left it aside because most of the
  time I can live with it.  Recently I need to make a few plots
  containing a few million points, and 4 pixels for a point is a
  disaster.  So my question is why the pixel marker size is set at 4
  pixels?  And is there anyway to change it to a single pixel?
 
  Thanks,
  Chris


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Why pixel marker size is 4 pixels?

2012-02-05 Thread Chris
Thanks JJ.

The problem seems not to be a size issue --  markersize has no effect
when use marker=, (pixel).  I have also tried to turn off aa, and it
doesn't help either.  I also tried different backends.  The PNG output
from Agg and Cairo is slightly different: Agg's point has 4 solid
pixel, while Cairo's has 4 pixel with random shade.

Postscript output has the same problem.  The pixel in an EPS file
generated by mpl is significantly bigger than that from another
drawing program I used.

The problem occurs in all my plotting scripts, e.g., this basic one:

[CODE]
import numpy as np

x=np.arange(100)
y=np.random.randn(100)

ioff()
fig=gcf()
fig.clf()

ax=fig.add_axes(0.15,0.1,0.8, 0.85)
ax.plot(x,y,k,)

ion()
fig.canvas.draw()
[/CODE]

Here is how I identify the problem:
1. use the above script to plot on screen
2. savefig(plot.png)
3. open plot.png in GIMP and check the pixel size.

I also attached the two PNG files generated with Agg and Cairo backends.


On Sun, Feb 5, 2012 at 6:45 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote:
 How are you plotting your points.

 If you use *plot*, there is a *markersize* parameter.
 If you use *scatter*, the third argument controls the marker size.

 But you may actually complaining about other issues, e.g.,
 antialiasing, etc. So, if above are not your answer, please post a
 complete example and describe your problem in more detail.

 Regards,

 -JJ


 On Sat, Feb 4, 2012 at 2:15 PM, Chris plut...@gmail.com wrote:
 I noticed this a few years back, but left it aside because most of the
 time I can live with it.  Recently I need to make a few plots
 containing a few million points, and 4 pixels for a point is a
 disaster.  So my question is why the pixel marker size is set at 4
 pixels?  And is there anyway to change it to a single pixel?

 Thanks,
 Chris

 --
 Try before you buy = See our experts in action!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-dev2
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
attachment: plot.agg.pngattachment: plot.cairo.png--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Why pixel marker size is 4 pixels?

2012-02-03 Thread Chris
I noticed this a few years back, but left it aside because most of the
time I can live with it.  Recently I need to make a few plots
containing a few million points, and 4 pixels for a point is a
disaster.  So my question is why the pixel marker size is set at 4
pixels?  And is there anyway to change it to a single pixel?

Thanks,
Chris

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [SciPy-User] getting started with arrays and matplotlib

2011-08-20 Thread Chris Withers
On 07/08/2011 22:29, David Warde-Farley wrote:
 Secondly, once I've populated this, any good examples of how to turn it
 into a bar chart? (the simple bar chart would be number of sales on the
 y-axis, weeks before the event on the x-axis, however, what I'd then
 like to do is split each bar into chunks for each venue's sales, if that
 makes sense?)

 This might give you an example of what you need:

 http://matplotlib.sourceforge.net/examples/pylab_examples/bar_stacked.html

 but you'd be better off asking on matplotlib-users.

Thanks, that was a good start.

One question: How can I automatically get a list of colours for each 
bar? I don't know how many bars I'm going to have so I can't manually 
pick them...

This feels like a common enough problem that I'm guessing there's a 
solution somewhere in matplotlib?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
 - http://www.simplistix.co.uk

--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] animations in macosx/wxagg

2011-06-30 Thread Chris Higgins
Hi,

I want to visualise a live data-stream by a number of plots (3d,
line drawings, scatter plots etc). I've been using the simpler
animation techniques (using gobject.idle_add and wx.EVT_IDLE to
redraw updates).

Some plots have static backgrounds that may benefit from the blit
techniques and I have been trying to get this approach to work in
GTKAgg and WXAgg. GTKAgg on linux seems to be coming along fine.
WXAgg on linux or macos, I'm not getting very far with.

So can anyone help with a few questions?

- can the native macos backend be used for animation? What's the
equivalent of gobject.idle_add or gobject.timeout_add? Anything
special needed for the blitting approach to work?

- What needs to be done to get WXAgg blitting? I have code like this:
...
matplotlib.use('WXAgg')
...
def update():
...
# restore, blit etc
wx.WakeUpIdle()

...
wx.EVT_IDLE(wx.GetApp(), update)
...

On Linux this draws the first screen and pauses. If I move the mouse
around I see the updates. As soon as I stop, so do the updates. What
am I missing? (BTW I get the same behaviour from animation_blit_wx.py
from the examples page). This is 1.0.1 on Linux, although I'm still
using 0.99.1 as well.

thanks for any help,

cheers, chris





-- 
Chris Higgins, Omnisense Ltd, 3rd Floor, St. Andrews House,
59 St Andrews Street, Cambridge, CB2 3BZ
Office: +44 (0) 1223 651394
Mobile: +44 (0) 780 490 8562
Skype: chiggins99
http://www.omnisense.co.uk

Omnisense Ltd is a company registered in England and Wales. Registered number: 
6779286.
Registered office: St. Andrews House, 59 St Andrews Street, Cambridge, CB2 3BZ

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Feature request: automatic scaling of subplots, margins, etc

2011-05-06 Thread Chris Rodgers
Since I just posted an almost-identical question, it's no surprise
that I agree this would be a useful feature.
Reason #1) I create hundreds of quick throwaway figures every day,
often in an automated way, and don't have time to fine-tune them.
Reason #2) a newbie to matplotlib might be turned off by one ugly
figure, when in fact matplotlib is capable of producing beautiful
figures.

The previous suggestion I received was to create a convenience wrapper
for the subplot function with some idiot-proof defaults. Can you
propose a set of rcParams that satisfies this criterion? This one
fixes the specific issue you raise:
matplotlib.rcParams['figure.subplot.hspace'] = .5

Although it will rear its ugly head again once the number of subplots
reaches 5 or 6. Personally I rarely use more than 4x4, and if I did I
would certainly increase the figsize.

I find that setting all text sizes to be as small as possible also
helps. My most commonly encountered issue is overlapping x-tick
labels, because most of my plots have samples on the x-axis and
therefore hundreds of thousands of points.

The real solution of course is to calculate exactly where every piece
of text actually is, detect overlaps, and adjust. That is certainly
beyond my ability or inclination to implement. In the mean time, it
would be nice to have a simple idiot-proof flag that blindly fixes
some common problems.

On Fri, May 6, 2011 at 1:20 AM, Daniel Mader
danielstefanma...@googlemail.com wrote:
 Hi,

 almost every time I create a somewhat more complex figure I have to
 fight with the not too smart positioning of the plots and the size of
 margins around the axes. From many postings here I have learned that
 this is the absolute intention, i.e. it is broken by design unless the
 programmer takes care about this.

 I have to admin that I do not really get this idea. I am aware that
 the defaults will not change anytime soon and so I'd like to ask for
 an idiot-proof mode: this could be enabled by an rcParam and take
 care of proper dimensions, scale axis labels, titles, margins etc so
 that they don't cover.

 Here's an example for a matplotlib script which is a simple as it can
 get and demonstrates the broken layout which a user gets by default.

 import scipy
 import pylab

 x = scipy.linspace(-50,50, 100)
 y1 = scipy.rand(100)
 y2 = scipy.sin(x)
 y3 = y1 + y2

 fig = pylab.figure()
 ax1 = fig.add_subplot(311)
 ax2 = fig.add_subplot(312)
 ax3 = fig.add_subplot(313)

 ax1.plot(x, y1)
 ax2.plot(x, y2)
 ax3.plot(x, y3)

 ax1.set_title('some title')
 ax2.set_title('some title')
 ax3.set_title('some title')

 pylab.show()

 Of course, one can adjust the figsize but the results are still far
 from being adorable. The spacing around the sublplots increases for no
 apparent reason while the spacing between the subplot remains the same
 so that everything looks cramped...


 Thank you many times in advance,
 best regards,

 Daniel

 --
 WhatsUp Gold - Download Free Network Management Software
 The most intuitive, comprehensive, and cost-effective network
 management toolset available today.  Delivers lowest initial
 acquisition cost and overall TCO of any competing solution.
 http://p.sf.net/sfu/whatsupgold-sd
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Subplot x-tick labels overlap with each other and with titles

2011-05-06 Thread Chris Rodgers
Hi

Whenever I create figures with at least 3x3 subplots, the x-tick
labels overlap with each other and they also overlap with the title of
the adjacent subplot, rendering the entire figure illegible. I know
that I can fine-tune the plot to look exactly the way I want with
wspace and hspace for instance, but I don't understand why this is
the default behavior. I wonder if I have a system font issue, such
that matplotlib thinks the fonts are smaller than they really are.

My questions:
1) Is this the intended behavior of matplotlib, or is there something
wrong with my installation?
2) Assuming I don't have an installation issue, is there a very
general parameter I can change so that the overlap doesn't occur,
rather than manually adjusting every figure?


Minimal code to reproduce the problem:

import numpy as np
import matplotlib.pyplot as plt
plt.figure()
plt.subplot(331)
plt.subplot(334)
plt.plot(np.arange(1))
plt.title('Title')
plt.show()


I'm attaching the output figure, although I'm not sure if the list
accepts attachments. The x-tick labels on subplot 334 overlap each
other, and the title of subplot 334 overlaps with the x-tick labels in
subplot 331.


System:
Ubuntu 10.04 x64
All packages are the stable versions from Synaptic, including ipython,
python, numpy, matplotlib 0.99.1.1
I've also tried the Enthought distribution with matplotlib 1.0.1 and
the results are the same
I've tried both Wx and Tk backends and the results are the same
I've tried `matplotlib.rcParams['xtick.labelsize'] = 'x-small'`, and
this does make the labels smaller, but for sufficiently large numbers
the overlap still occurs.

Thanks for any help!
Chris
attachment: output.png--
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Subplot x-tick labels overlap with each other and with titles

2011-05-05 Thread Chris Rodgers
Hi

Whenever I create figures with at least 3x3 subplots, the x-tick
labels overlap with each other and they also overlap with the title of
the adjacent subplot, rendering the entire figure illegible. I know
that I can fine-tune the plot to look exactly the way I want with
wspace and hspace for instance, but I don't understand why this is
the default behavior. I wonder if I have a system font issue, such
that matplotlib thinks the fonts are smaller than they really are.

My questions:
1) Is this the intended behavior of matplotlib, or is there something
wrong with my installation?
2) Assuming I don't have an installation issue, is there a very
general parameter I can change so that the overlap doesn't occur,
rather than manually adjusting every figure?


Minimal code to reproduce the problem:

import numpy as np
import matplotlib.pyplot as plt
plt.figure()
plt.subplot(331)
plt.subplot(334)
plt.plot(np.arange(1))
plt.title('Title')
plt.show()


I'm attaching the output figure, although I'm not sure if the list
accepts attachments. The x-tick labels on subplot 334 overlap each
other, and the title of subplot 334 overlaps with the x-tick labels in
subplot 331.


System:
Ubuntu 10.04 x64
All packages are the stable versions from Synaptic, including ipython,
python, numpy, matplotlib 0.99.1.1
I've also tried the Enthought distribution with matplotlib 1.0.1 and
the results are the same
I've tried both Wx and Tk backends and the results are the same
I've tried `matplotlib.rcParams['xtick.labelsize'] = 'x-small'`, and
this does make the labels smaller, but for sufficiently large numbers
the overlap still occurs.

Thanks for any help!
Chris
attachment: output.png--
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] MacOSX backend hangs

2011-04-08 Thread Chris Fonnesbeck
I'm running a recent build from source (last week) on OSX 10.6.6 and the Python 
2.6.1 that ships with the OS. When I use the macosx backend, any plot that I 
generate results in a window that hangs. The Python dock icon bounces for 
awhile, then when it stops, the spinning beach ball appears and I am unable to 
interact with the window. I can, however, add plots to the window and update 
its contents with show(). This behaviour does not occur with other backends 
(e.g. TkAgg). I have tried switching interactive mode off in matplotlibrc, but 
this does not fix the problem.

Thanks in advance for any ideas.



--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Access to contents of bins of a matplotlib histogram

2011-03-25 Thread Chris Edwards
Hi,

I would like to access values in the bins of a matplotlib histogram. The 
following example script is an attempt to do this. Clearly pdf contains 
floating point numbers, but I am unable to access them.

Help with this problem would be much appreciated.

Chris

--
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)

mu, sigma = 100, 15
x = mu + sigma * np.random.randn(20)

#Generate the histogram of the data. Example from Matplotlib documentation

n, bins, patches = plt.hist(x, 50, normed=True, facecolor='g', alpha=0.75)
plt.xlabel('Smarts')
plt.ylabel('Probability')
plt.title('Histogram of IQ')
plt.text(60, .025, r'$\mu=100,\ \sigma=15$')
plt.axis([40, 160, 0, 0.03])
plt.grid(True)

#From Matplotlib documentation.
#normed: If True, the first element of the return tuple will be the counts 
normalized
#to form a probability density, i.e., n/(len(x)*dbin). In a probability density,
#the integral of the histogram should be 1; you can verify that with a 
trapezoidal
#integration of the probability density function.

pdf, bins, patches = ax.hist(x, 50, normed=True, facecolor='g', alpha=0.75)

#print pdf shows pdf contains the value in each bin of the normed histogram

print pdf = , pdf

print  Integration of PDF = , np.sum(pdf * np.diff(bins))

#How to access values in pdf? Various tries made but none successful. Example 
attempt shown

count=0
for line in open(pdf,'r+'):
x=pdf.readline()
z=('%.10f' % float(x))
count=count+1
print count = , count


--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Can't produce plots using Matplotlib

2011-02-22 Thread Chris Edwards
Recently I downloaded and installed Python(x,y) Version 2.6.5.6 running under 
Windows7 and now can't produce the plots that my programs produced under an 
earlier version of Python(x,y). The programs seem to run correctly and produce 
the same numerical results but I can't find the graphical output (if it exists).
I presume that the problem isn caused by either an incorrect use of Matplotlib, 
an installation issue or my simply misunderstanding the use of Spyder.
I would greatly appreciate some guidance on how to solve this problem.
--
Index, Search  Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] axis order in matplotlib?

2011-02-22 Thread Chris Paola
Can anyone help me understand this: the code below produces a plot in 
which the x and y axis labels are reversed relative to the direction in 
which z varies on the plot, although the gradient arrows are correctly 
oriented. Is there something I've missed in understanding the sense of 
the x and y directions in mgrid, imshow, and gradient?


x,y axes seem to be reversed

import numpy as np

from matplotlib.pylab import *

dx = .25; dy = .25

xlen = 2.0; ylen = 2.0

x,y = np.mgrid[-xlen:xlen:dx, -ylen:ylen:dy] #also works with ogrid

z = x

hold(True)

imshow(z, origin='lower', extent=[-xlen,xlen,-ylen,ylen])

colorbar()

[u,v] = np.gradient(z)

u /= dx; v /= dy

QP = quiver(x,y,u,v,pivot='middle',color=[0.5,0.5,0.5])

quiverkey(QP, 0.85, 1.05, 1.0, '1 unit', labelpos='N')

xlabel('x')

ylabel('y')

title('slope')

show()





--
Index, Search  Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sensible tick labels for log scale?

2011-01-13 Thread Chris Fonnesbeck
On Jan 12, 2011, at 10:33 PM, Paul Ivanov wrote:
 In [50]: plt.loglog(1,1)
 Out[50]: [matplotlib.lines.Line2D object at 0x108dde4c]
 
 In [51]: ax = plt.gca()
 
 In [52]: loc = ax.xaxis.get_major_locator()
 
 In [53]: loc.numticks
 Out[53]: 15
 
 In [54]: loc.numticks = 10

Also, this approach does not seem to work in general for me. As an example:

In [49]: loglog([1.341, 0.1034, 0.6076, 1.4278, 0.0374], 
   :  [0.37, 0.12, 0.22, 0.4, 0.08], 'o')

In [50]: loc = ax.xaxis.get_minor_locator()

In [51]: loc.numticks=10

In [52]: loc.numticks=5


This does nothing to change the number of minor ticks, and I tried the same 
thing for get_major_locator(), with the same result. The plot does not change 
at all.

Thanks,
cf

--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] closing figure inside a callback seg faults

2010-10-15 Thread Chris Barker
On 10/15/10 5:16 PM, Paul Ivanov wrote:
 I want to do something like this:

import matplotlib.pyplot as plt
def onclick(event):
if event.button==1:
   plt.close()
fig = plt.gcf()
cid = fig.canvas.mpl_connect('button_press_event', onclick)
plt.show()

 I've tried several variations on this theme, but all of them cause
 crashes. Am I missing something?

 I'm using 1.0.0 with WXAgg

 thanks,

I don't know if MPL events do anything like this, but since you are 
using wx, you could probably use wx.CallAfter() (or wx.CallLater(), call 
one of those in your callback,a nd tehn have the function called close 
the figure.

-Chris


--
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Sigmoid Curve Fitting

2010-09-20 Thread Chris Spencer
Hi,

Does Matplotlib/Numpy/Scipy contain the ability to fit a sigmoid curve
to a set of data points?

Regards,
Chris

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Sigmoid Curve Fitting

2010-09-20 Thread Chris Spencer
Thank you. I'll try investigating Scipy further. I've already tried
applying some least-squares code for Numpy
(http://pingswept.org/2009/01/24/least-squares-polynomial-fitting-in-python/)
to my sigmoid data, but it only seems to fit parabolas.

I had already encountered zunzun.com while Googling the problem. I'm
not sure what to make of it, although it seems to be an online
curve-fitting service. Unfortunately, my usage requires the ability to
run the process locally.

Regards,
Chris

On Mon, Sep 20, 2010 at 6:35 PM, Gökhan Sever gokhanse...@gmail.com wrote:
 On Mon, Sep 20, 2010 at 3:36 PM, Chris Spencer chriss...@gmail.com wrote:

 Hi,

 Does Matplotlib/Numpy/Scipy contain the ability to fit a sigmoid curve
 to a set of data points?

 You could also experiment at zunzun.com. Choose 2D sigmoidal from the 2D
 function scroll list.
 --
 Gökhan


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib figure serialization

2010-03-24 Thread Chris Barker
Michael Droettboom wrote:
 What is the advantage of JSON (is this specific case) over Python source 
 code?  matplotlib is designed around it and it's more flexible.  Unless 
 you're planning on automatically manipulating the JSON, I don't see why 
 you wouldn't just use Python source.

Indeed. There have been a few threads about this topic, and I think the 
consensus is that the way to auto-generate figures is with python.

I don't think that there is any technical reason that one couldn't 
create a serialized version of an MPL figure in XML, or JSON, (or, for 
that matter, a python data structure), but it would be a fair bit of 
effort to write the code, and I don't think you'd get any real advantage 
over just using scripts -- you need a python script to create a figure 
in the first place, why not serialize that?

-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

chris.bar...@noaa.gov

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Contour Plotting of Varied Data on a Shape

2010-03-11 Thread Chris Barker
Ian Thomas wrote:
 To summarise, you recommend the following units of functionality:
 
 1) Triangulation class to wrap existing delaunay code.

The idea here is that it would provide a class that holds the result of 
the triangulation. Yes, it would use the existing delaunay code by 
default, and hopefully optionally use the not-as-good-a-license code the 
Robert Kern put in SciPy. In the future, I hope we can find a robust and 
well-licensed code -- I may be able to release some in-house code of 
ours for that some day.

 2) Separate the storage of and creation of contour sets so that you
 can create your own.
 3) tricontour and tricontourf functions to contour a Triangulation.
 4) Python utility plotting functions for a Triangulation (triplot,
 tripcolor, etc).
 5) Simple wrappers for 3 and 4 so you can just pass in the points and
 the Triangulation is created for you behind the scenes.

yup -- that all sounds great!

 I am happy to make a start with this;

wonderful!

 no doubt it will take me a while.  I should point out that I don't intend
  to tinker with the
 delaunay code, so we'll still left with those pathological cases
 that it doesn't work with.  Maybe this can be revisited when I'm done.

hopefully, there still doesn't appear to be a really good delaunay code 
with a flexible license out there -- pity.

 Do you want it all in one go, or one unit of functionality at a time
 (my preference)?

I don't see any reason to add it piecemeal, as long as the pieces are 
useful by themselves.

 Let's see!  I'll hold off starting until there have been some votes
 for it from other people.

hmm -- I wonder if a post to matplotlib-devel is in order. Most of those 
folks are on this list, to, but may not be following this thread.

By the way, it sounds like your contouring code is in C++ -- is that 
important? I don't expect it should be that computationally expensive, 
though maybe hard to vectorize -- C++ does make portability harder, 
though there's a bunch in MPL already.  If I was starting from scratch, 
I'd use Cython, if pure Python didn't cut it.

-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

chris.bar...@noaa.gov

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Contour Plotting of Varied Data on a Shape

2010-03-11 Thread Chris Barker
Robert Kern wrote:
 the triangulation. Yes, it would use the existing delaunay code by
 default, and hopefully optionally use the not-as-good-a-license code the
 Robert Kern put in SciPy.
 
 I did what now?

I thought you'd put a wrapper of a delaunay code that is GPL'd or 
something (not BSD compatible anyway) into a scikit or something? 
optional -- so it doesn't screw up licensing for those that don't want it.

Anyway, the point is, for any code that might be put into MPL, we want a 
properly licensed compatible default, but ideally with the option of 
easily plug in in other, better, delaunay code that may not be license 
compatible.

Now that I've written this, I really should go and look and see if I 
remember correctly:

I've found this:

http://scikits.appspot.com/delaunay

Though I see no reference to license in there, so I presume it's under 
the same license as scipy.

So I guess I was thinking of the natgrid toolkit, which I guess is not 
Robert's work, and is a substitute for nn interpolation, not triangulation.

Sorry for writing too quickly.

While I've got your attention, though -- I suspect you have looked for 
license compatible delaunay code and the stuff in the scikits package is 
as good as it gets?

Thanks,
   -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

chris.bar...@noaa.gov

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] embedding a plot function in existing wxapp GUI, problem replotting

2010-03-09 Thread Chris Barker
Pribadi, Krishna wrote:
 Based on what I’ve been reading regarding MPL, it seems that the 
 matplotlib show() function causes another instance of a GUI loop to 
 remain suspended.

right --don't use show(), in fact, don't use pylab for the most part:

http://www.scipy.org/Cookbook/Matplotlib/EmbeddingInWx

and see the embedding_in_wx examples as well.

I personally like wxMPL:

http://agni.phys.iit.edu/~kmcivor/wxmpl/

-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

chris.bar...@noaa.gov


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Contour Plotting of Varied Data on a Shape

2010-03-09 Thread Chris Barker
Ian Thomas wrote:
 I submitted some code to matplotlib-users last September to perform
 contouring of triangular grids.  The posts and code can be found at:
 
 http://sourceforge.net/mailarchive/forum.php?thread_name=4AB3B95B.3090903%40noaa.govforum_name=matplotlib-users
 
 Like I wrote at the time, if it is useful to enough people I'm happy
 to improve the code provided it can be incorporated into mpl as I have
 no interest in maintaining it as a standalone project.

I think it would be great to have in MPL.

What code are you using for the triangulation? Does it do constrained 
delauney?

-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

chris.bar...@noaa.gov

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Setting Relative Heights For Figure Rows

2010-01-11 Thread Chris Spencer
I wanted to display my figure legend below my figure in the second
row, so I used subplot(211) to create two rows.

However, this creates two rows of equal height, so my graph is crammed
into half the figure height in the first row, while my tiny legend
barely fills up any of the second row. How do you specify relative
heights of each row? For example, I'd like to specify the first row
takes 80% of the figure height, while the second takes 20%. I've
searched the docs, but I can't find anything. Is this possible?

Regards,
Chris

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Building matplotlib 0.99.1.1: cannot find -ltk8.5

2009-09-28 Thread Chris
Hi,

I'm having trouble building matplotlib 0.99.1.1 (transcript below). 

I'm using copies of Python (2.5.1) and Tcl/Tk (8.5.5) that I have
built myself, and that are apparently working fine. Previously, I was
using this exact procedure to build 0.91.4 without any problems.

Any suggestions would be greatly appreciated - thanks!

Chris

$ cd matplotlib-0.99.1.1
$ env PREFIX=/a/b/ LD_LIBRARY_PATH=/a/b/lib  /a/b/bin/python setup.py build

BUILDING MATPLOTLIB
matplotlib: 0.99.1.1
python: 2.5.1 (r251:54863, Feb  5 2009, 13:11:08)  [GCC
4.1.2 20071124 (Red Hat 4.1.2-42)]
  platform: linux2

REQUIRED DEPENDENCIES
 numpy: 1.2.1
 freetype2: 9.10.3

OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.10
   Tkinter: Tkinter: 50704, Tk: 8.5, Tcl: 8.5
  Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to import gtk in your build/install environment
   Mac OS X native: no
Qt: no
   Qt4: no
 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
  datetime: present, version unknown
  dateutil: matplotlib will provide
  pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
dvipng: 1.5
   ghostscript: 8.15.2
 latex: 3.141592
   pdftops: 3.00

[Edit setup.cfg to suppress the above messages]

pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.projections',
'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_too\
lkits.axes_grid', 'matplotlib.sphinxext', 'matplotlib.numerix',
'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matp\
lotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array',
'matplotlib.numerix.fft', 'matplotlib.delaunay', 'pytz\
', 'dateutil', 'dateutil/zoneinfo']
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -
build/lib.linux-i686-2.5/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -
build/lib.linux-i686-2.5/matplotlib/mpl-data
running build_ext
building 'matplotlib.backends._tkagg' extension
g++ -pthread -shared build/temp.linux-i686-2.5/src/agg_py_transforms.o
build/temp.linux-i686-2.5/src/_tkagg.o build/temp.\
linux-i686-2.5/CXX/cxx_extensions.o build/temp.linux-i686-2.5/CXX/cxxsupport.o
build/temp.linux-i686-2.5/CXX/IndirectPyth\
onInterface.o build/temp.linux-i686-2.5/CXX/cxxextensions.o -L/usr/lib
-L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/lib6\
4 -L/usr/local/lib -L/usr/lib -L/usr/lib64 -ltk8.5 -ltcl8.5 -lstdc++ -lm
-lfreetype -lz -lstdc++ -lm -o build/lib.linux-i\
686-2.5/matplotlib/backends/_tkagg.so
/usr/bin/ld: cannot find -ltk8.5
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1
make: *** [matplotlib] Error 1

$ ls /a/b/lib/*tk*
lib/libtk8.5.so  lib/libtkstub8.5.a  lib/tkConfig.sh
...



--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Piecewise Cubic Hermite Interpolating Polynomial in python

2009-08-29 Thread Chris Michalski
Thanks for the inputs...  perhaps it will provide the impetus for  
future postings as well...

chris

On Aug 29, 2009, at 11:49 AM, John Hunter wrote:

 On Sat, Aug 29, 2009 at 1:12 PM, Eric Firingefir...@hawaii.edu  
 wrote:

 This looks interesting.  I successfully ran your program by using  
 copy
 and paste to get it into a file, but for the future I certainly
 recommend that you attach such a file directly--file attachments
 generally work very well these days, but bad things can happen to  
 code
 included as inline text.

I haven't contributed to matplotlib or numpy even though I've used  
them for some years now, so I wasn't sure about the etiquette of  
file attachments.

The other thing I recommend is do not use the pylab namespace for any

 of the numerics.  pylab is getting all the numerical functions from
 numpy, so if you

  import numpy as np

 and then refer to any numerical functions you need as np.somefunc.

Point well taken.  Since pylab exposes most of the numpy calls I use,  
I typically include pylab instead for nump.

 Finally, for the functions to be suitable for inclusion in a
 production package like numpy or matplotlib.mlab, you should not use
 any print statements in the function, but rather a combination of
 warnings.warn or exceptions or if it for matplotlib, use the
 verbose.report infrastructure.  That way users can configure how much
 verbosity they want, where the output should be directed, etc.

Point also well taken.  I figured out when there were problems, but  
even after 7 years of writing large Python package, I haven't found  
the best way to handle exceptions.  Usually I purposely cause a  
crash so I don't miss the fact that the code had ill formed data.

 After a cleanup, you may want to check with numpy or scipy to see of
 it could find a home there.  There was a discussion at scipy on the
 need to improve scipy.interpolate and this seems to go part of the way
 toward that objective.  So I would start there.

I'll send it along to the scipy people.  I figured since I figured out  
a relatively simple solution to a problem that is often encountered,  
it might find use even in its primitive form.  I'll add the URLs to  
the WIkipedia references as well.

 JDH


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] help needed in plotting curved elements

2009-08-23 Thread Chris Barker
Sameer Regmi wrote:
 We are working on plotting mesh (in 
 hermes2d: http://hpfem.math.unr.edu/projects/hermes2d-new/)

 In the hermes2d examples curves are defined as [4, 7, 45] where 4,7 
 are vertices indices, and 45 is center angle.

 1) matplot.path porvides a way to plot curve with three points
 http://matplotlib.sourceforge.net/api/path_api.html#module-matplotlib.path

This is a Bezier spline -- it can not exactly form a piece of a circle 
(though it can get pretty close). You can probably find the math 
somewhere for how to approximate a circle, but...

 2) matplot.patch.arc provides a way to plot an arc
  
 http://matplotlib.sourceforge.net/api/artist_api.html#module-matplotlib.patches
 
  but it needs
  - center of circle
  - start angle
  - end angle
  - radius of circle
we have to calculate all these with data available to us

Since this actually plots s circle, I think it's a better bet. It should
be pretty straightforward coordinate geometry to find those parameters 
from the ones you have -- and you  only have to write that once!

This page (or others like it) might help you get started:

http://www.codecogs.com/reference/maths/analytical_geometry/the_coordinate_geometry_of_a_circle.php

HTH,

-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

chris.bar...@noaa.gov

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Stopping Legend From Overlapping the Graph

2009-06-28 Thread Chris Spencer
Awesome, thanks. That works perfectly.

Chris

On Sun, Jun 28, 2009 at 12:16 AM, Jae-Joon Leelee.j.j...@gmail.com wrote:
 sorry.
 As guillaume has mentioned, you need to install mpl from svn.

 Here is some workaround you can try. I guess it would work with 0.98.5.3.
 Basically, you create a separate axes for a legend.

 ax1 = axes([0.1, 0.2,0.8, 0.7])
 p1, = ax1.plot([1,2,3])
 p2, = ax1.plot([3,2,1])

 ax2 = axes([0.1, 0.1, 0.8, 0.01], frameon=False)
 ax2.xaxis.set_visible(False)
 ax2.yaxis.set_visible(False)
 l = ax2.legend([p1, p2], [Legend1, Legend2], mode=expand, ncol=2,
   borderaxespad=0.)


 -JJ



 On Sat, Jun 27, 2009 at 6:00 PM, Chris Spencerchriss...@gmail.com wrote:
 Thanks. Is that some sort of blending edge feature? I just installed
 0.98.5.3, but the sample code gives me the error:

 TypeError: __init__() got an unexpected keyword argument 'bbox_to_anchor'

 On Thu, Jun 25, 2009 at 10:20 PM, Jae-Joon Leelee.j.j...@gmail.com wrote:
 The linked page below shows how you put the legend above the graph.

 http://matplotlib.sourceforge.net/users/plotting/legend.html#legend-location

 You can put it below the axes by adjusting the bbox_to_anchor parameter.
 Try something like
  bbox_to_anchor=(0., -0.1, 1., -0.1), loc=1

 Make sure to adjust the suplot parameter (or axes location) to make
 enough room for the legend.

 -JJ



 On Thu, Jun 25, 2009 at 9:22 PM, Chris Spencerchriss...@gmail.com wrote:
 How do you show the legend below the graph, so it doesn't overlap at
 all with the graph? The docs for the legend() loc parameter only
 seem to specify where *on* the graph you want it to show, which is
 driving me nuts because even using best, it usually hides some of my
 data.

 I want to see *all* of my graph, as well as the legend. Is there any
 way to do this with pylab?

 Any help is appreciated.

 Chris

 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users





--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Stopping Legend From Overlapping the Graph

2009-06-27 Thread Chris Spencer
Thanks. Is that some sort of blending edge feature? I just installed
0.98.5.3, but the sample code gives me the error:

TypeError: __init__() got an unexpected keyword argument 'bbox_to_anchor'

On Thu, Jun 25, 2009 at 10:20 PM, Jae-Joon Leelee.j.j...@gmail.com wrote:
 The linked page below shows how you put the legend above the graph.

 http://matplotlib.sourceforge.net/users/plotting/legend.html#legend-location

 You can put it below the axes by adjusting the bbox_to_anchor parameter.
 Try something like
  bbox_to_anchor=(0., -0.1, 1., -0.1), loc=1

 Make sure to adjust the suplot parameter (or axes location) to make
 enough room for the legend.

 -JJ



 On Thu, Jun 25, 2009 at 9:22 PM, Chris Spencerchriss...@gmail.com wrote:
 How do you show the legend below the graph, so it doesn't overlap at
 all with the graph? The docs for the legend() loc parameter only
 seem to specify where *on* the graph you want it to show, which is
 driving me nuts because even using best, it usually hides some of my
 data.

 I want to see *all* of my graph, as well as the legend. Is there any
 way to do this with pylab?

 Any help is appreciated.

 Chris

 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Stopping Legend From Overlapping the Graph

2009-06-25 Thread Chris Spencer
How do you show the legend below the graph, so it doesn't overlap at
all with the graph? The docs for the legend() loc parameter only
seem to specify where *on* the graph you want it to show, which is
driving me nuts because even using best, it usually hides some of my
data.

I want to see *all* of my graph, as well as the legend. Is there any
way to do this with pylab?

Any help is appreciated.

Chris

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Tutorial on working with Excel files in Python (without COM and cross platform!) at EuroPython 2009

2009-06-18 Thread Chris Withers
Hi All,

Too many people in the Python community *still* think the only way to 
work with Excel files in Python is using COM on Windows.

To try and correct this, I'm giving a tutorial at this year's EuroPython 
conference in Birmingham, UK on Monday, 29th June that will cover 
working with Excel files in Python using the pure-python libraries xlrd, 
xlwt and xlutils.

I'll be looking to cover:

- Reading Excel Files

   Including extracting all the data types, formatting and working with
   large files.

- Writing Excel Files

   Including formatting, many of the useful frilly extras and writing
   large excel files.

- Modifying and Filtering Excel Files

   A run through of taking existing Excel files and modifying them in
   various ways.

- Workshop for your problems

   I'm hoping anyone who attends will get a lot out of this! If you're
   planning on attending and have a particular problem you'd like to work
   on in this part of the tutorial, please drop me an email and I'll try
   and make sure I come prepared!

All you need for the tutorial is a working knowledge of Excel and
Python, with a laptop as an added benefit, and to be at EuroPython this 
year:

http://www.europython.eu/

I look forward to seeing you all there!

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk



--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] What would you like to see in a book about Matplotlib?

2009-02-02 Thread Chris Walker
On Sun, Feb 01, 2009 at 11:59:06PM +0100, Sandro Tosi wrote:
 Hi Chris,
 thanks for your reply, helpful as usual :)
 
 On Fri, Jan 30, 2009 at 18:59, Chris Walker
 chr...@chiark.greenend.org.uk wrote:
Firstly, good luck with the book.
 
 cheers :)
 
  The sort of book I'd buy would explain how to use the combination of
  matplotlib/ipython/scipy/numpy to analyse data.
 
 Sadly, that would not the book I'll write :( The editor wanted to
 target another audience for the book: experienced python developers,
 with no knowledge of matplotlib; so an introductionary book, that will
 show even how to integrate mpl on GTK/WX application and on the web.
 
 I pushed to have something about science, and a chapter will be about
 that, but I need your (all) inputs, because my science days are long
 back in the past ;)

Sure - though anyone wanting to use matplotlib is likely to be
acquiring, manipulating and then plotting data. 

 
  - what are the (basic) things that, when you were beginning to use
  matplotlib, you wanted to see grouped up but couldn't find?
  - what would you like to see in a book about matplotlib?
 
  Start off by reading data from a file, plotting it and fitting a
  function to that data.
 
 That sounds something that could land in the science chapter.

Indeed.

 
  Plotting with related scales
  
 
  Sometimes it is useful to plot related scales on x1 and x2 axes. I've
  come across this several times in different contexts. In its simplest
  form, there is a linear relationship between the axes. In a mechanical 
  test, you might want extension on the x1 axis and strain on the x2 axis 
  (for example).
 
  Sometimes there is not a linear relationship. For example you might
  want to plot frequency (or photon energy) on x1 and wavelength on x2.
 
  An even more complex example is a Hall-Petch plot:
 
  (Yield Stress) = k/sqrt(Grain Size)
 
  So plotting 1/Sqrt(Grain Size) on the X1 axis gives a linear
  plot, but it would be useful to plot the grain size on the X2 scale.
 
 Err, I think I lost you ;)

Figure 3b/3c at
http://dcwww.camd.dtu.dk/~schiotz/papers/risoesymp/html/node3.html
is an example - note that the y2 scale is not linear. 

 
 What you want is 2 plots on the same figure? so not 2 Ys for the same
 X 

2 scales on the same figure, yes.

 (let's say X is time, and Y1 is stock price variation, and Y2 is the
 percentage change), you want X1-Y1 (let's say on the bottom-left) and
 X2-Y2 (on the upper-right): did I get you?

Exactly. http://en.wikipedia.org/wiki/File:Body_mass_index_chart.svg
is the sort of thing I had in mind. 


 
  ipython and emacs
  -
 
  Suppose I want to write a script to analyse some data (perhaps I want
  a record of what I've done, or perhaps I'd like to perform the same
  analysis on several data sets). I'd probably do so in emacs - but it
  is useful to do some experimentation in ipython - tab completion is
  particularly useful. I feel there must be a good way to do my
  experimentation in ipython and save the important bits in emacs - but
  I've not sat down and worked out an efficient way of doing this.
 
 I think the preferred way to do so it using ipython, and for now I
 plan only to show it on the book.

Whether or not this make it into the book, I'm interested in how
people do this. Surely you don't write your application using just
ipython do you?

 
  Data aqcuisition and experimental control:
  -
 
  Writing a simple application to acquire data - ideally from multiple
  sources and plot the data as it is acquired. In my case I wanted to
  combine mechanical with electrical tests. A couple of interesting
  articles by G Varoquaux are listed at
  http://wiki.debian.org/DebianScience/DataAcquisition
 
  This is perhaps beyond the scope of the book, but it has come up on
  the mailing lists a couple of times. The ideal application would have
  a gui for simple use, but a command line (probably ipython) for more
  more complex use - perhaps performing a series of tests under
  different conditions.
 
 I thought about an example for this already! :) 

Excellent. 

 I thought to develop a
 sample application for GTK/WX that display some system value (like cpu
 usage or so, in this way everyone can run the example) plotting the
 information as it comes (for 30 secs, for example).

One of the things I liked about Gael's article was its discussion of
threading - separating the gui from the calculations from the data
acquisition.


 
  Some discussion of plotting non gridded 2d data should also be in
  there.
 
 for example?

Something like:
http://matplotlib.sourceforge.net/examples/pylab_examples/griddata_demo.html

It is something I have encountered several times.  

Another example I had in mind is:

http://www.sci.muni.cz/~mikulik/gallery.html#GaAlAsFishAtPM 
http://www.sci.muni.cz/~mikulik/gnuplot.html

I've taken similar measurements in the past - and one often takes

Re: [Matplotlib-users] [matplotlib-devel] What would you like to see in a book about Matplotlib?

2009-01-30 Thread Chris Walker
Note: Posted to matplotlib-devel and debian-science. 

Sandro, 
   Firstly, good luck with the book. 

The sort of book I'd buy would explain how to use the combination of
matplotlib/ipython/scipy/numpy to analyse data. 

 - what are you using matplotlib for?


I want to use matplotlib/ipython/numpy/scipy for analysis of
experimental data - plotting and fitting models to it. Also perhaps
simulation of the data. 

I have also wanted to use matplotlib to plot data as it was acquired -
see below.

I've not really used matplotlib in anger - but am likely to do so in
the future (and it would have been useful during my PhD had it been
around then).

 - what are the things you like the most of matplotlib, that you want
 to give emphasis to? And why?

Quality plots. The ability to add TeX labels. 

I've been keeping an eye on matplotlib for several years - it looks
good. I really must spend some time exploring it. 

 - what are the (basic) things that, when you were beginning to use
 matplotlib, you wanted to see grouped up but couldn't find?
 - what would you like to see in a book about matplotlib?

Start off by reading data from a file, plotting it and fitting a
function to that data.

Often, several scans are in the same data file. An elegant solution to
reading data something like this example would be useful.

# Scan: 1
# Time: 18:00
# Temperature: 21
# t data
1 12
2 33
3 14
4 40
5 60

# Scan: 2
# Time: 18:02
# Temperature: 30
# t data
1 22
2 33
3 44
4 55

And so on. 


Fitting a function to several data sets - with some of the parameters
fitted to both sets of data and some not would be useful.



 - what are some those advanced feature that made you yell WOW!! ?
 - what are the things you'd like to explore of matplotlib and never
 had time to do?

Plotting with related scales


Sometimes it is useful to plot related scales on x1 and x2 axes. I've
come across this several times in different contexts. In its simplest
form, there is a linear relationship between the axes. In a mechanical test, 
you might want extension on the x1 axis and strain on the x2 axis (for 
example). 

Sometimes there is not a linear relationship. For example you might
want to plot frequency (or photon energy) on x1 and wavelength on x2.

An even more complex example is a Hall-Petch plot:

(Yield Stress) = k/sqrt(Grain Size)

So plotting 1/Sqrt(Grain Size) on the X1 axis gives a linear
plot, but it would be useful to plot the grain size on the X2 scale. 


ipython and emacs
-

Suppose I want to write a script to analyse some data (perhaps I want
a record of what I've done, or perhaps I'd like to perform the same
analysis on several data sets). I'd probably do so in emacs - but it
is useful to do some experimentation in ipython - tab completion is
particularly useful. I feel there must be a good way to do my
experimentation in ipython and save the important bits in emacs - but
I've not sat down and worked out an efficient way of doing this.


Data aqcuisition and experimental control:
-

Writing a simple application to acquire data - ideally from multiple
sources and plot the data as it is acquired. In my case I wanted to
combine mechanical with electrical tests. A couple of interesting
articles by G Varoquaux are listed at
http://wiki.debian.org/DebianScience/DataAcquisition

This is perhaps beyond the scope of the book, but it has come up on
the mailing lists a couple of times. The ideal application would have
a gui for simple use, but a command line (probably ipython) for more
more complex use - perhaps performing a series of tests under
different conditions.


Some discussion of plotting non gridded 2d data should also be in
there.

 
 Your suggestions are really appreciated :) And wish me good luck!

I don't think it is the thrust of your book, but another book I was
looking for is A cookbook of Numerical simulations of classic
physics/engineering problems. For use by physicists/engineers who
don't want to rewrite things from scratch.

Good luck. 

Chris

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Tutorial on working with Excel files in Python(without COM and cross platform!) at PyConUS 2009

2009-01-27 Thread Chris Withers
Derek Hohls wrote:
 I hope I speak for others when I say: for those of us who cannot
 be at PyCon, please consider making tutorials etc available for 
 download afterwards.  We'd love to be able to spread the good
 word about these excellent libraries.

Keep an eye out on the PyConUS website after the conference, I believe 
they'll make the tutorials available there...

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Tutorial on working with Excel files in Python (without COM and cross platform!) at PyConUS 2009

2009-01-22 Thread Chris Withers
Hi All,

Too many people in the Python community think the only way to work with
Excel files in Python is using COM on Windows.

To try and correct this, I'm giving a tutorial at this year's PyCon in 
Chicago on Wednesday, 25th March that will cover working with Excel 
files in Python using the pure-python libraries xlrd, xlwt and xlutils.

I'll be looking to cover:

- Reading Excel Files

   Including formatting, unicode dates and formulae.

- Writing Excel Files

   Including formatting with easyxf and things like freeze pains, print
   areas, etc

- Filtering Excel Files

   A run through on the structure of xlutils.filter and some examples to
   show you how it works.

- Workshop for your problems

   I'm hoping anyone who attends will get a lot out of this! If you're
   planning on attending and have a particular problem you'd like to work
   on in this part of the tutorial, please drop me an email and I'll try
   and make sure I come prepared!

All you need for the tutorial is a working knowledge of Excel and 
Python, with a laptop as an added benefit, and to be at PyCon this year:

http://us.pycon.org

I look forward to seeing you all there!

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plot() cuts off long tick labels

2009-01-15 Thread Chris Fonnesbeck
Is there any way of preventing tick label names from being cut off by
the plot canvas? Seems to happen every time:

http://a3.s3.p.quickshareit.com/files/validationb0e66.png

Thanks in advance.

-- 
Chris Fonnesbeck
Department of Mathematics and Statistics
PO Box 56, University of Otago
Dunedin, New Zealand

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plot() cuts off long tick labels

2009-01-15 Thread Chris Fonnesbeck
Is there any way of preventing tick label names from being cut off by
the plot canvas? Seems to happen every time:

http://a3.s3.p.quickshareit.com/files/validationb0e66.png

Thanks in advance.

-- 
Chris Fonnesbeck
Department of Mathematics and Statistics
PO Box 56, University of Otago
Dunedin, New Zealand

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] rotating plots

2009-01-13 Thread Chris Fonnesbeck
I am trying to produce a plot of data within a discrete number of
categories, such as data in a dict:

{'a':[0.3, 0.5], 'b':[0.9], 'c':[0.2, 0.4, 0.2]}

Except, rather than have the categories along the x-axis, and the
values on the y-axis, I need them the other way around. I know in the
boxplot() function, you can use the vert argument to tilt the plot
on its size (ie swap the axes), but is there an equivalent function
for other plots.

I guess what I'm looking for is a sideways boxplot, except plotting
the individual points, rather than the boxplot per se -- there are
only a small number of elements for each category, so a boxplot is not
appropriate.

Thanks in advance,
-- 
Chris Fonnesbeck
Department of Mathematics and Statistics
PO Box 56, University of Otago
Dunedin, New Zealand

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Saved PDFs default to 4/3 aspect ratio even if do subplots_adjust?

2008-10-27 Thread chris
On Mon, Oct 27, 2008 at 10:59:40AM -0400, Michael Droettboom wrote:
 The size of the figure can be adjusted using

 figure(figsize=(width, height))

 subplots_adjust merely adjusts the margins between multiple subplots
 within the same figure.

Thanks.  subplots_adjust(left=.., bottom=...) seems to have an effect on a
single plot too.  It lets you add extra room for axis labels.

It *must* mess up the
aspect ratio of the plot since the axis labels are now stealing extra space
right?

Chris

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] question about figsize keyword of figure(..)

2008-10-27 Thread chris
I'm confused about what

matplotlib.pyplot.figure(figsize = (a,b))  *means*

It appears that the figure gets *bigger* as I make a and b *smaller* !??!


Chris

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Why is wrapper module called pylab ?

2008-10-26 Thread chris
On Sun, Oct 26, 2008 at 11:51:48AM -0400, Charlie Moad wrote:
 The matplotlib.pyplot is favored over the pylab module now.

Thanks!  I find your comment very interesting.  As I have negligible experience
with Matlab, I'd love to use matplotlib.pyplot.

The problem is all the docs use pylab right?  Where find matplotlib.pyplot
examples?

Chris

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Why is wrapper module called pylab ?

2008-10-25 Thread chris

So is matplotlib the name of the low level plotting engine?

And, pylab is the user-friendly wrapper?

Would it be ok to call the whole system Pylab instead of Matplotlib then?


Chris

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] zorder seems to cause problems when embed python in latex files

2008-10-14 Thread chris
On Tue, Oct 14, 2008 at 03:00:05PM -0400, Michael Droettboom wrote:
 With the file you sent, I can see the messed up footer in xpdf, but not
 in acroread.  There are a number of times that I have seen xpdf not
 completely support the PDF spec, and this may be one of them.

I installed acroread and I was also able to view everything fine with it
whereas xpdf and evince showed the bug.


 Creating my own files, however, I'm not able to reproduce this here.

Hmmm.  This would imply that your versions somehow do something that makes xpdf
happy.

 When I compile your test.tex, I get an error, even though it seems to
 have loaded the python.sty file.  Not sure why (see attached log).

Looks like it doesn't know what \begin{python} means.  Did you put python.sty
in the same directory as text.tex?

 When I generate the plots offline, and then hack test.tex to simply
 include the files, everything works fine, and I don't see a problem with
 the footers with either xpdf or acroread.

I see the problem with xpdf when I simply include the plots which means that
python.sty was just a red herring.  python.sty isn't the problem.

 There was a recent bug discovered in matplotlib where PDF files weren't
 always getting flushed completely.  I don't *think* that's the cause of
 this, but if you could reproduce what I did (generate the plots
 independently of TeX and then load them), and that works for you, that
 might point to something like that.

xpdf still croaks for me.  Perhaps using the bleeding edge of matplotlib would
fix?  I'm using Ubuntu 8.04 which has python-matplotlib version
0.91.2-0ubuntu1.

 There was also a bug a few months back where xpdf didn't like the way
 matplotlib handled reusing the same graphic multiple times (which is
 used for markers).  That may be why you're seeing the footer bug and I'm
 not -- you didn't mention which version of matplotlib you're running, so
 it's hard to say.

 Here's my versions of all the various moving pieces:
 pdfTeX (Web2C 7.4.5) 3.14159-1.10b
 kpathsea version 3.4.5
 Copyright (C) 1997-2003 Han The Thanh.
 Beamer 3.00
 python 2.5.2
 matplotlib SVN (today)
 Acroread 8.1.1
 xpdf 3.00

Here is what I got:

Beamer 3.07-1
python 2.5.2
matplotlib  0.91.2-0ubuntu1
Acroread 8.1.2_SU1
xpdf 3.02-1.3ubuntu1

Ironically, all my stuff is newer than yours except for matplotlib.  Sounds
like bleeding edge of matplotlib must be tried next.

 That python.sty stuff looks really cool, by the way.  I haven't come
 across it before.

Glad I could help!

cs

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] zorder seems to cause problems when embed python in latex files

2008-10-13 Thread chris
LaTeX can accept embedded Python code with a python.sty file.

This is handy to dynamically generate plots with Matplotlib for a LaTeX slide
presentation.

I successfully embedded lots of matplotlib plot code into my slides
and then had problems with zorder.

For some reason zorder seems to mess up the footer of my Beamer/LaTeX slides.
(For some reason zorder setting make the footer shrink in size.)

Is there any weirdness or side effects about zorder I should be aware of that
would explain this?

Chris

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plot chops off big Latex axis labels

2008-10-11 Thread chris
The plot PDFs that matplotlib makes by default seem to be too tiny to contain
my biggest axis labels and my poor Latex stuff is chopped in half.

How fix?

cs

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Can't seem to plot 2 horizontal lines on same plot

2008-10-07 Thread chris
I don't know what dumb thing I'm going but I can't seem to plot
2 horizontal lines on the same plot!!!


Why does this snippet give a *BLANK* plot when I run it?

(Either line separately seems to be ok!?!?)

import pylab
x1 = pylab.arange(-10, 10, 0.01)
x2 = pylab.arange(  0, 10, 0.01)
f1 = [0 for e in x1]
f2 = [1 for e in x2]
pylab.show(pylab.plot(x1, f1, x2, f2))


Chris

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Can't seem to plot 2 horizontal lines on same plot

2008-10-07 Thread chris
On Tue, Oct 07, 2008 at 12:54:49PM +0200, Johann Rohwer wrote:
 The autoscaling feature sets the y limits to [0,1] which means that
 your lines are falling on the bottom and top x-axis which hides them.
 Rescaling the y-axis will make the lines visible, e.g.

 pylab.ylim(-1,2)

Thank you very much.  That did it.

cs

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Can't seem to plot 2 horizontal lines on same plot

2008-10-07 Thread chris
On Tue, Oct 07, 2008 at 08:19:39AM -0400, Michael Droettboom wrote:
 Did you not get an exception when you ran your example?

 The following works for me:

 import pylab
 x1 = pylab.arange(-10, 10, 0.01)
 x2 = pylab.arange(  0, 10, 0.01)
 f1 = [0 for e in x1]
 f2 = [1 for e in x2]
 pylab.plot(x1, f1, x2, f2)
 pylab.show()

The lines aren't visible when I do it.  No exceptions given.

cs

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] OS X (Intel Mac) installation woes

2008-08-18 Thread Chris Fonnesbeck
Nathaniel Virgo [EMAIL PROTECTED] writes:

 
 Hi allI'm having trouble installing on OS X.  The short story is it looks 
like something file is trying to build something for a ppc architecture when 
I'm on an Intel mac.Here's the long story:First I downloaded the 
matplotlib-0.99.3-py2.5-macosx-10.3.egg file 
but it complained that I didn't have numpy 1.1 as the version that comes with 
OS X is 1.0.1.  

Hi Nathaniel,

I have an installer script that gives you recent builds of numpy, scipy and
 matplotlib, all installed from egg archives. It works well with MacPython, so 
you might want to try it:

http://macinscience.com

cf


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] multivariate scatter plots?

2008-08-18 Thread Chris Fonnesbeck
I'm trying to track down a function/recipe for generating a multivariate 
scatter plot. I'm thinking of something similar to what you get in R if
you call plot on a multivariate data frame:

http://mt11.quickshareit.com/share/rplotb1a70.pdf

Is there anything obvious here? It seems like something that would get a
lot of use, for exploring large datasets, etc.

Thanks,
cf


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Installation woes: phantom Numpy version?

2008-08-07 Thread Chris Barker
 On Wed, Aug 6, 2008 at 5:02 PM, Richard Lawrence [EMAIL PROTECTED] wrote:

 My setup is:
 Mac Pro PPC G5, OS X 10.5.4
 Python 2.5.1 (Apple build)
 Numpy 1.2.0.dev5615 -- ran svn update and rebuilt this morning

 REQUIRED DEPENDENCIES
 ~* numpy 1.1 or later is required; you have
 ~* 1.0.5.dev4673

Apple distributed a version of numpy with the system python, and set up 
sys.path so that their stuff would be found before site-packages, so you 
may be getting Apple's version of numpy rather than the one you built 
and installed. (I'm not running 10.5, so I can't supply details)

There are ways to work around this -- a little googling should help you 
figure it out, but I recommend that you avoid the whole problem (and 
others) by installing python.org's build of 2.5.2, and go from there -- 
the binaries on the numpy site are built for that version.

-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 Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Adding labels to plots does not work

2008-05-19 Thread Chris
In a recent SVN build of matplotlib on OSX 10.5, I have created a boxplot
then tried to add labels to the axes afterwards. However, though the xlabel
and ylabel commands run without error, no labels are added to the plots.

In [45]: boxplot(transpose(transpose(relative_risk.trace())[:-2]))

In [46]: xlabel=(Option)

In [47]: ylabel=(Risk Reduction)




-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] MPL, py2exe and fonts

2008-05-07 Thread Chris Barker
Michael Droettboom wrote:
 Chris Barker wrote:
 I'm successfully getting all the MPL data files into spy2exe with:

 DATA_FILES = matplotlib.get_py2exe_datafiles()

 The problem is that that dumps a LOT of stuff, and I don't need most 
 of it.

 The default text font is Vera.ttf.  (If you want to support bold and 
 italic etc, you'll also need VeraBd.tff, VeraBI.ttf and VeraIt.ttf).

I removed all other fonts, and it works fine, thanks!

 Alternatively, you can change the default fonts in the matplotlibrc to 
 ones that are included with Windows (e.g. Arial) -- 

I took a look in matplotlibrc, and saw what looks like a html-ish 
cascade of fonts to look for, and Arial was in there. So I tried 
removing all the fonts, and behold, the system fonts were used. So now 
all I have in the mpl-data dir is matplotlibrc.

Then I thought, I haven't changed any defaults in matplotlibrc, either, 
so I pulled that out. Now it runs fine, but when I close, I get an error 
box:

see the logfile: 

and indeed there is a

pH.exe.log file, and in there is:

C:\Documents and Settings\chris.barker\My 
Documents\HAZMAT\SmallTools\phCalculator\trunk\dist\pH.exe\matplotlib\__init__.py:520:
 
UserWarning: Could not find matplotlibrc; using defaults
C:\Documents and Settings\chris.barker\My 
Documents\HAZMAT\SmallTools\phCalculator\trunk\dist\pH.exe\matplotlib\__init__.py:566:
 
UserWarning: could not find rc file; returning defaults


Is there a way to supress those warnings and not write the logfile? I've 
never really liked matplotlibrc -- it's kind of nice not to have it at 
all, and it doesn't seem to be required. Maybe this is a wx issue -- how 
to bury that warning.

So then I tried removing mpl-data, but the app wouldn't run, I got an 
error, and the logfile says:

Traceback (most recent call last):
   File pH.py, line 8, in module
   File zipextimporter.pyo, line 82, in load_module
   File Lib\Gui.pyo, line 15, in module
   File wxaddons\__init__.pyo, line 180, in import_hook
   File zipextimporter.pyo, line 82, in load_module
   File matplotlib\__init__.pyo, line 639, in module
   File matplotlib\__init__.pyo, line 562, in rc_params
   File matplotlib\__init__.pyo, line 517, in matplotlib_fname
   File matplotlib\__init__.pyo, line 207, in wrapper
   File matplotlib\__init__.pyo, line 447, in _get_data_path_cached
   File matplotlib\__init__.pyo, line 443, in _get_data_path
RuntimeError: Could not find the matplotlib data files

since I'm not, in fact needing any of the files in mpl-data, it might be 
nice if this error could be moved to when it's actually needed. I do 
notice that there is already a if getattr(sys,'frozen',None) stanza, 
so maybe we could tweak something there.

This may all be a pain, and I suppose this approach would only work with 
the simplest of MPL apps (like mine), but it would be nice to clean up 
MPL so that it plays better with py2exe and the like.

-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] MPL, py2exe and fonts

2008-05-06 Thread Chris Barker
Hi all,

I'm successfully getting all the MPL data files into spy2exe with:

DATA_FILES = matplotlib.get_py2exe_datafiles()

The problem is that that dumps a LOT of stuff, and I don't need most of 
it. I've already added to my script a few lines that delete the images 
dir, but I'd like to trim down the fonts to just those I need.

I'm using the wxAgg back-end, with all default fonts -- does anyone know 
which those are?

MPL version: 0.91.2 on Windows (duh!)

by the way, is there any way to dump that data into the exe itself, 
rather than requiring it to be carried alongside?

This makes me really appreciate application bundles on the Mac!

-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] OSX build under universal python fails

2008-04-24 Thread Chris
I'm trying to get a built of Matplotlib built under Python.org Python 2.5.2, 
but get
the following build error, which did not occur under Leopard's 
python:

src/_image.cpp: In member function ‘Py::Object _image_module::
from_images (const Py::Tuple)’:
src/_image.cpp:848: error: insn does not satisfy its constraints:
(insn 2573 1070 2574 126 agg24/include/agg_color_rgba.h:268 (set 
(mem:QI (plus:SI (reg/f:SI 6 bp)
(const_int -280 [0xfee8])) [0 SR.2970+0 S1 A8])
(reg:QI 5 di)) 56 {*movqi_1} (nil)
(nil))
src/_image.cpp:848: internal compiler error: in 
reload_cse_simplify_operands,  at postreload.c:391
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://developer.apple.com/bugreporter for instructions.
error: command 'gcc' failed with exit status 1


Any idea as to what the problem may be?

Thanks in advance.


-
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] OSX build under universal python fails

2008-04-24 Thread Chris
Chris [EMAIL PROTECTED] writes:
  
  Based on recent emails, this looks like a problem attributed to the gcc 
  version, not the python version.  Suggested solutions are compile with 
  the -Os flag or use gcc 4.2.
  
  I think universal builds may have to 
 wait for another day, when gcc 4.2 is ready for prime time.
 

Actually, the -0s flag with gcc 4.0 seemed to work just fine. Thanks.








-
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] How do you static link to freetype when building eggs?

2008-04-23 Thread Chris
I've had an ongoing problem building eggs of matplotlib that are statically 
linked to freetype. I thought I had it nailed, but evidently I do not. Here 
is my script:

export CFLAGS=-arch i386 -I/Developer/src/libpng 
-I/Developer/src/freetype/include
export LDFLAGS=-arch i386 -L/Developer/src/libpng 
-L/Developer/src/freetype
rm -rf build
python setupegg.py bdist_egg

The build of freetype in /Developer/src/freetype does not even have 
dynamic libs built. The basedir dict in setupext.py contains the following 
entry 
for OSX:

'darwin' : []

However, when the resulting egg is installed by users, they still get the 
following error:

ImportError: dlopen(/Library/Python/2.5/site-packages/matplotlib-
0.98pre-py2.5-macosx-10.5-i386.egg/matplotlib/ft2font.so, 2): 
Library not loaded: /usr/local/lib/libfreetype.6.dylib Referenced from: 
/Library/Python/2.5/site-packages/matplotlib-0.98pre-py2.5-macosx-10.5-
i386.egg/matplotlib/ft2font.so Reason: image not found

I thought I had my bases covered -- if anyone has some insight here, please
let me know. maptlotlib is the only missing piece of the superpack of 
modules that I distribute for OSX.


-
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] matplotlib threadsafe?

2008-04-09 Thread Chris Withers
Eric Firing wrote:
 
 Out of interest, how does one tell MPL to start a new figure and 
 forget everything that's gone before?
 
 You can minimize the amount of package and module-level state 
 information by using the oo interface: see examples/agg_oo.py.

I tried this example, and it generates no output.
Is that to be expected?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
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] location of figure window

2008-04-09 Thread Chris Withers
Hey All,

Is there any way I can control the location that a tk figure window is 
shown on screen?

I can control the size fine with:
pylab.figure(figsize=(10,10))
...but this produces a figure that, while it's the right size, is 
rendered with the top left of the window in the middle of the screen.
If I can get it to be to-left, then it will all be visisble without me 
having to move it with a mouse ;-).

Any ideas?

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
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] C++ Assertion failure during savefig

2008-04-03 Thread Chris Squibb
Hey,

Up until recently I have been using mpl 0.90.1, and my application
worked fine.  Yesterday I upgraded to 0.91.2 and am now getting the
following traceback:

  File application.
py, line 667, in plot
radial_plot_figure.savefig(png_file, dpi=self.dpi)
  File C:\Python25\Lib\site-packages\matplotlib\figure.py, line 770,
in savefig
self.canvas.print_figure(*args, **kwargs)
  File C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py,
line 101, in print_figu
re
FigureCanvasAgg.print_figure(self, filename, *args, **kwargs)
  File C:\Python25\Lib\site-packages\matplotlib\backend_bases.py,
line 1202, in print_figure
self.figure.canvas.draw()
  File C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py,
line 65, in draw
self.gui_repaint()
  File C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py,
line 987, in gui_repaint
drawDC.DrawBitmap(self.bitmap, 0, 0)
  File C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py,
line 3387, in DrawBitmap
return _gdi_.DC_DrawBitmap(*args, **kwargs)
PyAssertionError: C++ assertion hdcDst  hdcSrc failed at
..\..\src\msw\dc.cpp(2559) in AlphaBlt(
): AlphaBlt(): invalid HDC


Does anyone have any suggestions to why this is happening?

Thanks.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plotting from a dictionary

2008-04-03 Thread Chris Withers
Hey All,

I have a dictionary that maps date to a count (in this case the number 
of false negatives from my spam filter) and I'm wondering how to best 
plot something that looks like, say:

from datetime import date
data = {
   date(2008,03,01):10,
   date(2008,03,02):15,
   date(2008,03,03):13,
}

I'm worried about getting the dates out in order such that I get a 
straight line plot, rather than the zigzag back-and-forth line I reckon 
I'd get if I did:

dates = []
count = []
for date,count in data.items:
   dates.append(date)
   count.append(count)

plot(dates,counts)

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [newbie] live plots of multiple lines

2008-03-28 Thread Chris Withers
Matthias Michler wrote:
 I'm not sure it is the easiest way, but it works for me:
 
 for label in ax.xaxis.get_majorticklabels():
 label.set_rotation(+90)

Yes, that's what I was using, just wondered if there was a better way...

 Also, how would I get this kind of updating with bar charts or errorbars?
 
 In the case of bar charts and errorbars it is quite difficult to reset the 
 data.  

Oh, I also meant to ask about scatter, can the data be easilly reset there?

For bar charts and errorbar plots, I agree ;-) How would I just blank 
the figure and replot?
(I have just been calling errorbar lots, but I'm guessing that if I add 
a legend, I'll have one entry for each time I called errorbar :-S)

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] wxagg back-end bug on windows?

2008-03-28 Thread Chris Barker
Hi all,

I'm having an odd issue with the wxAgg back-end:

windows XP
python 2.5.2 (from python.org)
wxPython 2.8.7.1 unicode (binary from wxPython.org)
MPL 0.91.2 (binary from MPl site)

when I run:
import matplotlib
matplotlib.use('wxagg')
import pylab

I get a popup dialog:

This application failed to start  because wxmsw26uh_vc.dll was not found

It looks like it is looking for a wxPython2.6 dll, which it doesn't 
find, because I'm running wxPython2.8

I'm guessing this binary was compiled against wxPython2.6, but I thought 
the current wxAgg back-end didn't try to use the accelerated module for 
wxPython2.8.

Any ideas?

By the way, there are a number of other small bugs cropping up in the 
pylab window with wxagg too -- but I'll look at those once I solve this.

Is no one else using MPL with wxPython2.8?

-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]

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] wxagg back-end bug on windows?

2008-03-28 Thread Chris Barker
Chris Barker wrote:
 Hi all,
 
 I'm having an odd issue with the wxAgg back-end:

Update:

If I remove:

matplotlib/backends/_wxagg.pyd

The problem goes away.

It looks like that pyd is getting loaded even though I'm running wxPython2.8

However, now I get a non-valid png when I do savefig


-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]

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [newbie] live plots of multiple lines

2008-03-27 Thread Chris Withers
Matthias Michler wrote:
 the above script leads
 to a different behaviour on my system.
 What is that behaviour and what version of matplotlib are you using?
 
 I think it is the expected behaviour. The number of xtick is aproximately 
 constant and some tick get sorted out, when the xlimits are increasing.
 I'm using matplotlib-svn r5024 on Debian etch.

Hmm, do you have a code snippet to demonstrate this?
Maybe I'm missing some vital step that causes the axis to re-calculate 
its ticks?

 sorry. I have no idea where this problems comes from. I have seen that using 
 idle and the latest release of matplotlib on and winxp, but I can't reproduce 
 it on my linux system.

*sigh* ;-)

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [newbie] live plots of multiple lines

2008-03-27 Thread Chris Withers
Matthias Michler wrote:
 I'm not sure that I understand you correctly. The code I refering is the one 
 which I attached some mails ago. The following works for me:

Ah, okay, to get the problem I was having, change your script as follows:

 -
 from pylab import *
  from datetime import datetime
 from time import sleep
 
 ion() # interactive mode 'on'
 figure()
 ax = subplot(111, autoscale_on=True)
 
 x, y = [datetime.now()], [0]
 line = plot(x, y, label=my_data)[0]  
 # get the line-object as the first 
 element 
 # of the tuple returned by plot
 legend()
 for i in arange(30):
 x.append(datetime.now())   # append new values
 y.append(i**2)
 line.set_data(x,y)# reset data
 ax.relim()# reset axes limits
 ax.autoscale_view()   # rescale axes
 draw()# redraw current figure
 sleep(0.3)# wait 0.3 seconds
 
 ioff()
 show()

So, basically make the x axis time instead of numbers.
I think the problem is actually that the daets are quite long in their 
format. If they were rotated through 90 degress it'd likely be fine.
How would I do this?

Also, how would I get this kind of updating with bar charts or errorbars?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [newbie] live plots of multiple lines

2008-03-26 Thread Chris Withers

Matthias Michler wrote:

My x-axis is time, and as new points are plotted, even though I'm
following the above recipe pretty closely, the x-tick spacing isn't
getting sorted out, so I end up with just a jumble as the tick labels
for the x-axis. Do you know why this might be?


I'm not sure I understand correctly, but if the number of xticks increases 
dramatically (nobody could see the individual ticks), 


Indeed, it looks like the Tick spacing is staying as it was when the 
first point was plotted, so when hundreds more points are plotted, I 
just get a jumble of labels on the x-axis.


the above script leads 
to a different behaviour on my system.


What is that behaviour and what version of matplotlib are you using?


Shame I get that horrible exception when I do close the plot window,
wish I knew how to make it stop :-S


I don't know which exception you refer to, but sometimes if gives problems if 
the interactive mode wasn't switched off (ioff()) before the scripts ends 
or show() is called.


If I run the attached script, and hit Ctrl-C in the DOS box running it, 
I get:


C:\python mpltest.py
Traceback (most recent call last):
  File mpltest.py, line 3, in module
show()
  File 
C:\Python25\Lib\site-packages\matplotlib\backends\backend_tkagg.py, li

e 76, in show
Tk.mainloop()
  File C:\Python25\lib\lib-tk\Tkinter.py, line 328, in mainloop
_default_root.tk.mainloop(n)
KeyboardInterrupt
Fatal Python error: PyEval_RestoreThread: NULL tstate

This application has requested the Runtime to terminate it in an unusual 
way.

Please contact the application's support team for more information.

I've had a similar error when I hit the red cross in the corner of the 
window with other scripts, although not this one :-S


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
from pylab import *
plot([1,2],[3,4])
show()
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] I really need help about installing matplotlib.

2008-03-25 Thread Chris Withers
lovegf86 wrote:
 What is the problem?
 Do I need to update numpy?
 Please help me, I am so desperate..

Install Python 2.5 from here:
http://python.org/ftp/python/2.5.2/python-2.5.2.msi

Install NumPy from here:
http://downloads.sourceforge.net/numpy/numpy-1.0.4.win32-p3-py2.5.exe

Install the windows binary for python 2.5 from here:
http://downloads.sourceforge.net/matplotlib/matplotlib-0.91.2.win32-py2.5.exe

Ignore the Enthought stuff ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error

2008-03-24 Thread Chris Withers
Hi Brook,

Brook Lin wrote:
 raise RuntimeError('%s' is not a writable dir; you must set
 %s/.matplotlib to be a writable dir.  You can also set environment variable
 MPLCONFIGDIR to any writable directory where you want matplotlib data stored
 %h)

This is the crucial bit.

Looks like you've set MPLCONFIGDIR to a read-only dir, or the 
.matplotlib in the current dir or .matplotlib in your home directory 
aren't writeable by the user running your python script. (I'm doing a 
bit of guesswork here...)

What is it that you're trying to do?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting dates on the Y axis?

2008-03-21 Thread Chris Withers
Kenneth Miller wrote:
   Is it possible to plot dates on the Y-axis? I'd like to have  
 dates on the y axis descending or ascending versus my values on the x  
 - axis. Is it possible to do this or simply switch the axis?

Not sure what you mean, have you just tried it with plot or plot_dates?

What problems are you experiencing?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting filled lines with missing data?

2008-03-21 Thread Chris Withers
Pierre GM wrote:
 Your data is indexed in time, right ? Your x-axis is a date object ? Then use 
 scikits.timeseries
 http://scipy.org/scipy/scikits/wiki/TimeSeries

I'm not sure what this is giving me.
The dates are all python datetimes in a list already.
The missing values started off as '', I turned those into nan and then 
created a ma with the nan's masked.

What more would TimeSeries give me?

 the link above. I must admit we didn't implement poly_between for timeseries. 
 Most likely, we'd have to implement it for regular masked arrays first, as 
 mentioned by Eric.

OK.

 What you could do is to fill your array with some kind of baseline, such as 
 0, 
 or your minimum data, or wtvr. That's just a quick trick and no fix.

Indeed, that's what I had to do.

I have to admit, I see some interesting things while scanning that wiki 
page, but nothing that would have helped me...

cheers,

Chris (who might well be missing something...)

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting dates on the Y axis?

2008-03-21 Thread Chris Withers
Kenneth Miller wrote:
 
 back in time. When i pass plot_dates timestamps for the y axis, and 
 integers for the x axis it simply displays the y-axis as floats.

did you try:

plot_dates(x,dates,ydate=True)

?

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [newbie] live plots of multiple lines

2008-03-21 Thread Chris Withers
Hey Matthias,

Matthias Michler wrote:
 maybe something like the following helps you:
 -
 from pylab import *
 from time import sleep
 
 ion() # interactive mode 'on'
 figure()
 ax = subplot(111, autoscale_on=True)
 
 x, y = [0], [0]
 line = plot(x, y, label=my_data)[0]  
 # get the line-object as the first 
 element 
 # of the tuple returned by plot
 legend()
 for i in arange(10):
 x.append(i)   # append new values
 y.append(i**2)
 line.set_data(x,y)# reset data
 ax.relim()# reset axes limits
 ax.autoscale_view()   # rescale axes
 draw()# redraw current figure
 sleep(0.5)# wait 0.5 seconds
 
 ioff()

This is perfect, except for one little thing...

My x-axis is time, and as new points are plotted, even though I'm 
following the above recipe pretty closely, the x-tick spacing isn't 
getting sorted out, so I end up with just a jumble as the tick labels 
for the x-axis. Do you know why this might be?

 I don't know how to make this somehow interactive concerning the data input. 
 but maybe you save the data to a file and read them every 15 or 20 minutes.

This isn't a problem, I just run in a while True loop and leave it 
running until I close the plot window.

Shame I get that horrible exception when I do close the plot window, 
wish I knew how to make it stop :-S

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting filled lines with missing data?

2008-03-20 Thread Chris Withers
Eric Firing wrote:
 Both with respect to documentation and functionality, what you are 
 encountering is the historical aspect of masked arrays as a tacked-on 
 part of python numeric packages, and of matplotlib.

*sigh* I feel lucky ;-)

 Support and 
 integration are improving, but still far from perfect. 

I wish I could help, but my knowledge is lacking...

 Now with respect to your particular case here, trying to plot a filled 
 line with gaps: poly_between has no notion of masked arrays at present. 
  If it did, how should it behave?  

Well, what I actually settled on was juat doing using:

my_masked_array.filled(0)

...to plot with.

 At the very least, additional 
 arguments are needed to specify what should happen for fill-type 
 plotting with missing values. 

Indeed, what I personally would have liked was a complete gap where the 
data is missing, but I guess that would have to return multiple 
polygons, and I don't know how that would work?

 provide them in mpl.  I would be happy to fix this gap in mpl's handling 
 of gappy data, 

...heh ;-)

 but I can't make it a priority use of my time right now.

No, I understand :-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting with missing data?

2008-03-20 Thread Chris Withers
Giorgio F. Gilestro wrote:
 
 import numpy as np
 a = ['','','',1.1,2.2]
 mask_a = [i == '' for i in a]
 b = np.ma.MaskedArray(a, mask=mask_a)

Not very efficient, though, is it?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-20 Thread Chris Withers
Michael Droettboom wrote:
 At least the Agg backend *looks* to be reasonably threadsafe -- there 
 are no obvious gotchas like global variables etc.  Note, though, that 
 multithreading may not gain much in the way of performance since the 
 global interpreter lock is never released around long-running C blocks.

It's not performance I'm looking for, it's making sure that MPL apps 
served from multi-threaded wsgi servers don't screw each others charts 
up ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-20 Thread Chris Withers
Eric Firing wrote:
 In general, I don't think mpl is threadsafe at all; it uses global 
 variables, such as all the rc parameters, that could easily be modified 
 by one thread while being used by another. 

Yep, I guessed as much, BFL it is then ;-)

 I think that great care 
 would be needed if one wanted to have multiple threads making plots. 
 Having one plotting thread and any number of threads doing other things, 
 however, should be OK.

Out of interest, how does one tell MPL to start a new figure and forget 
everything that's gone before?

 At the very least, I think we would have to take all the global state 
 information and put it in a class instance, so there could be multiple 
 plotting machines. 

Yes.

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] compiling from svn on windows

2008-03-20 Thread Chris Withers
Michael Droettboom wrote:
 That's cool'n'all, but when is svn going to make it into a Windows 
 binary release? ;-)
   
 I suspect your question is somewhat rhetorical, but...  it will probably 
 be a while ;) 

Why is that? Who cranks out the binary releases on Windows and what 
compiler do they use?

 I know a lot of people (myself included) have had success with MinGW.  

What's the official compiler used, though?

 It's a good learning experience, and there's lots on this list willing 
 to help.  If we can get more SVN Windows users on board, more crazy 
 Windows-only bugs will get found and squashed sooner... ;)

Well, tell me how to get the svn trunk and how to compile and I'll give 
it a go :-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] gradient fills for bar charts?

2008-03-19 Thread Chris Withers
Eric Firing wrote:
 Short of laboriously putting an image in each bar, no.

That's a shame :-(
So, no gradient filled patches in MPL?

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting with missing data?

2008-03-19 Thread Chris Withers
Pierre GM wrote:
 Could you send me an example of the kind of data you're using ?

It's basically performance and volume data for a high-volume website.
Unfortunately, the data is gappy in places due to data collection errors 
in the past...
(it's important the gaps are shown, rather than trying to interpolate 
them away, however)

 As it seems you're dealing with series indexed in time, you may want to try 
 scikits.timeseries, a package Matt Knox and myself implemented for that very 
 reason.

How would this help me here and where can I find out about it?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] making minor ticks into lines instead of ticks

2008-03-18 Thread Chris Withers
Eric Firing wrote:
 I can get the major ticks to show by doing grid(True), but how do I 
 get the same effect for minor ticks?
 
 Try
 
 grid(True, which='minor')

Thanks, that worked (well, it did what it was supposed to...) so it'd be 
nice if it was in the online docs as well as the docstring of the method;-)

However, this isn't quite what I want... I only want the grid for the 
y-axis (ie: horizontal lines in the grid, but no vertical), how would I 
do that?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting with missing data?

2008-03-18 Thread Chris Withers
Eric Firing wrote:
 Specifically, what I have is an array like so:

 ['','','',1.1,2.2]
 
 Try something like this:
 
 import numpy.ma as ma
 from pylab import *
 
 aa = [3.4, 2.5, '','','',1.1,2.2]
 def to_num(arg):
 if arg == '':
 return .0
 return arg
 
 aanum = array([to_num(arg) for arg in aa])
 aamasked = ma.masked_where(aanum==.0, aanum)
 plot(aamasked)
 show()

What I ended up doing was getting my array to look like:

from numpy import nan
aa = [3.4,2.5,nan,nan,nan,1.1,2.2]
values = numpy.array(aa)
values = numpy.ma.masked_equal(values,nan)

I only wish that masked_equal didn't blow up when aa contains datetime 
objects :-(

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] from pylab import nx?

2008-03-18 Thread Chris Withers
Hi All,

A few of the units demos include the lines:

from pylab import nx

...but this import errors for me.

Why is that?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] making minor ticks into lines instead of ticks

2008-03-18 Thread Chris Withers
Matthias Michler wrote:
 ax.yaxis.grid(which='minor')

This is what I was after, thankyou :-)

However, the lines show up on top of the lines plotted, not behind them 
as I'd expect.

I tried fiddling with the zorder of the plot and the grid but nothing 
had any effect. What am I doing wrong? How do I get the grid to show up 
behind the lines?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


  1   2   >