Re: [Matplotlib-users] mplot3d stays?

2010-02-26 Thread Friedrich Romstedt
2010/2/26 Gael Varoquaux :
> What Eric was most probably talking about is the newer versions of
> Mayavi, that we tend to call 'mayavi2', even though we are now up to
> version 3, in particular the mlab interface:
>
> http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/mlab.html
>
> which is demoed in the examples:
> http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/examples.html
>
> I believe that Mayavi does take care of the task you are interested in.
> It has its limitation and annoyances, but a lot of people use it quite
> efficiently to do 3D plotting, for simple problems to very complex ones.

Wow, that's really impressive!  I admit that adding 3D plotting
capability to matplotlib would be like reinventing the wheel, and it
would be a quite rectangular-shaped wheel.

But, unfortunately, I need a physical rendering engine with light
sources and reflectance/transmittance simulation from real measured
data anyway, and the 3D rendering engine will be a byproduct.  But, I
think, it would be more easy to use Agg directly as the backend rather
than going via matplotlib, although it may be an option.

Friedrich

--
Download Intel® 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] arrows in contour lines?

2010-02-26 Thread Matthias Michler
On Thursday 25 February 2010 19:55:22 Nico Schlömer wrote:
> Hi all,
>
> I'd like to make a countour plot just like in
>
> http://matplotlib.sourceforge.net/examples/pylab_examples/contour_demo.html
>
> but instead of text at the contour lines I'd like to have arrows in
> the in the direction of the contour lines. Does anyone know if that's
> possible.
>
> Cheers,
> Nico

Hi Nico,

if you know the gradient of your data, I think an overlay with a 'quiver' 
might be useful, but I never tried this.
(http://matplotlib.sourceforge.net/examples/pylab_examples/quiver_demo.html)

Kind regards,
Matthias

--
Download Intel® 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] TeX and the PDF Backend

2010-02-26 Thread Freddie Witherden
Hi all,

While playing around with the TeX support in matplotlib (rc('text', 
usetex=True)) and the PDF backend I noticed an interesting phenomena whereby 
the summation symbol in my plot was rendered at a larger size than regular TeX 
would produce.

Taking the following example as my basis 
http://matplotlib.sourceforge.net/examples/pylab_examples/tex_demo.html I 
created a PDF and compared it, in Evince to a PDF with an equivalent math 
section created by LaTeX.

Overlaying the two PDFs results in the following: 
http://freddie.witherden.org/drop/matplotlibtex.png The bottom is the output 
from matplotlib while the top LaTeX. For some reason the summation symbol is 
larger in matplotlib than in LaTeX.

I have seemingly confirmed this with latex + dvipdfm and pdflatex.

Does anyone know what might be causing this? The document font sizes are the 
same and I tried to match the LaTeX file as closely as possible to the one used 
internally by matplotlib.

Polemically yours, Freddie.

--
Download Intel® 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 WM_CLASS of matplotlib figure windows

2010-02-26 Thread Ethan Coon
Hi all,

I'm using matplotlib-0.99.1 (with backend Qt4, I don't have Tk backends
installed to compare there) on a netbook with Ubuntu netbook remix,
which includes maximus, a window manager which maximizes screen usage on
little screens.  It chooses to maximize/not maximize new windows based
upon their WM_CLASS.  Since I don't want to maximize matplotlib figures,
I add the matplotlib window WM_CLASS to an exclude list.

A quick check shows that matplotlib (or at least the Qt4 backend)
doesn't set the WM_CLASS of its windows:

> xprop | grep WM_CLASS   # click on matplotlib figure
WM_CLASS(STRING) = " ", " "

I'm not that familiar with the innards of matplotlib, so I'm not sure if
this is something that is possible to set in user-space, or if this is
something missing from the backend.  Ideally this would be set to
something useful by matplotlib/the backend, but I'd settle for a quick
way of setting it manually.

Thanks for the advice!

Ethan




--
Download Intel® 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] root->mpl functions

2010-02-26 Thread Sebastien Binet
hi Jeff,

I was wondering if I could reap out your little root2matplot script.
I am planning to release a few helper functions as part of a tutorial I'll be 
giving here at Orsay (how to use python/numpy/ as an analysis foundation 
in Atlas), and it seems it would be quite interesting to help people switch to 
matplotlib and still interact with the rest of the HEP crowd...

cheers,
sebastien.

On Wednesday 24 February 2010 22:07:03 klukas wrote:
> Tom Leys wrote:
> > It looks like you are storing your source data in a python list.
> > Matplotlib runs much faster if you store your data using a numpy array
> > instead.
> > 
> > I'm no expert, but it certianly sped up my graph drawing.
> 
> I am trying something similar to what Mike was describing.  I have
> converted all of the stored data to numpy arrays rather than python lists,
> as per your suggestion.  But the plots I'm making don't have more than 50
> entries apiece, and I'm not seeing any appreciable speed-up.   It still
> takes ~15 seconds to produce each plot (using PDF backend to save to
> files).
> 
> Does anybody have other thoughts on what I might be able to try to bring
> the lag down to something more reasonable?
> 
> My use case is that I'm building a library to dump the content of
> histograms from ROOT (a data analysis package used in physics) into a
> convenient Hist object that has members to directly plot the data as a
> matplotlib errorbar or bar plot.  You can see the 100 lines I've written
> here:
> http://www.hep.wisc.edu/~jklukas/public/root2matplot.py
> 
> I've tried running a profiler like Mike did, but I'm afraid I'm not able to
> parse any useful information from it either.
> 
> I'd appreciate any advice from the community.
> 
> Thanks,
> Jeff
> 
> Output of profiler for producing one single plot:
> 
> 
> Wed Feb 24 15:01:20 2010timing
> 
>  6995086 function calls (6983887 primitive calls) in 22.301 CPU
> seconds
> 
>Ordered by: cumulative time
>List reduced from 1080 to 25 due to restriction <25>
> 
>ncalls  tottime  percall  cumtime  percall filename:lineno(function)
> 10.0040.004   22.301   22.301 ../overlayHists.py:367(main)
>  20/10.1390.007   21.669   21.669
> ../overlayHists.py:123(process_directory)
> 10.0010.001   21.529   21.529
> ../overlayHists.py:231(process_hist_matplotlib)
> 20.0000.000   21.384   10.692
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/pyplot.py:354(savefig) 20.0000.000   21.384  
> 10.692
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/figure.py:959(savefig) 20.0000.000   21.384  
> 10.692
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backend_bases.py:1372(print_figure) 20.0000.000  
> 21.373   10.687
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backends/backend_pdf.py:2012(print_pdf) 126/20.001   
> 0.000   12.3146.157
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/artist.py:44(draw_wrapper) 20.0000.000   12.314   
> 6.157
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/figure.py:729(draw) 20.0000.000   12.3106.155
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/axes.py:1632(draw) 40.0020.000   11.9402.985
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/axis.py:727(draw) 400.0050.000   11.9270.298
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/text.py:504(draw) 580.0230.000   10.3490.178
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/dviread.py:805(find_tex_file) 580.0080.0009.904
>0.171
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/subproces
> s.py:662(communicate) 150599.8990.0019.8990.001 {method
> 'read' of 'file' objects}
> 20.0000.0009.0514.526
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backends/backend_pdf.py:447(close) 20.0010.001   
> 9.0434.521
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backends/backend_pdf.py:520(writeFonts) 80.0080.001
>9.0411.130
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backends/backend_pdf.py:554(embedTeXFont) 80.000   
> 0.0008.6371.080
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/type1font.py:47(__init__) 3040.0010.0007.796   

[Matplotlib-users] Need help with a local install of matplotlib under Linux

2010-02-26 Thread LB
Hi,

I would like to make a local install of matplotlib under Linux, but I've got
2 problems :

1)  I didn't find how to setup the build to use the PGI C compiler.
I tried python setup buil --help-compiler but there seems to be no
preconfigured options for this compiler, and the default doesn't work (see
log2, below)
How should I configure this ?

2) I have a problem with the configuration of gtk dependencies.
Theses dependencies are also locally installed and the setup.py script
didn't find them (see log1 below)
But, the strange thing is that, if I modify the setup.py script and add
"import gtk" on the top of it, the configuration seems to run nicely (see
log2).
Indded, it seems that "import gtk" works in setup.py but doesn't in
setupext.py, which is very weird to me

Have you got any ideas on how to solve this ?

[ log1 ]
> python setup.py build

BUILDING MATPLOTLIB
matplotlib: 0.98.0
python: 2.5.2 |EPD Py25 4.1.30101| (r252:60911, Dec 19 2008,
17:15:55)  [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)]
  platform: linux2

REQUIRED DEPENDENCIES
 numpy: 1.1.1
 freetype2: 9.10.3

OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.10
   Tkinter: no
* Using default library and include directories for
* Tcl and Tk because a Tk window failed to open.
* You may need to define DISPLAY for Tk to work so
* that setup can determine where your libraries are
* located. Tkinter present, but header files are not
* found. You may need to install development
* packages.
  wxPython: 2.8.7.1
* WxAgg extension not required for wxPython >= 2.8
  Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Qt: no
   Qt4: no
 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
  datetime: present, version unknown
  dateutil: 1.4
  pytz: 2008c

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

EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
 configobj: 4.5.3
  enthought.traits: 3.0.3

[Edit setup.cfg to suppress the above messages]

[/log1]



[log2]
> python setup.py build

BUILDING MATPLOTLIB
matplotlib: 0.98.0
python: 2.5.2 |EPD Py25 4.1.30101| (r252:60911, Dec 19 2008,
17:15:55)  [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)]
  platform: linux2

REQUIRED DEPENDENCIES
 numpy: 1.1.1
 freetype2: 9.10.3

OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.10
   Tkinter: no
* Using default library and include directories for
* Tcl and Tk because a Tk window failed to open.
* You may need to define DISPLAY for Tk to work so
* that setup can determine where your libraries are
* located. Tkinter present, but header files are not
* found. You may need to install development
* packages.
  wxPython: 2.8.7.1
* WxAgg extension not required for wxPython >= 2.8
  Gtk+: gtk+: 2.10.14, glib: 2.22.4, pygtk: 2.10.6,
pygobject: 2.12.3
Qt: no
   Qt4: no
 Cairo: 1.4.0

OPTIONAL DATE/TIMEZONE DEPENDENCIES
  datetime: present, version unknown
  dateutil: 1.4
  pytz: 2008c

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

EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
 configobj: 4.5.3
  enthought.traits: 3.0.3

[Edit setup.cfg to suppress the above messages]

running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc ->
build/lib.linux-x86_64-2.5/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf ->
build/lib.linux-x86_64-2.5/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
pgcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
-fPIC -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
-I/OutilsGroupe/EPD/include/python2.5 -c src/ft2font.cpp -o
build/temp.linux-x8

Re: [Matplotlib-users] mplot3d stays?

2010-02-26 Thread Reinier Heeres
Dear all,

One of the great advantages of the current mplot3d design is that it
produces complete vector based graphics with the same look-and-feel as
your 2d plots. Integration with OpenGL will certainly change this, as
the rendering will always give you (as far as I know) a bitmap. I
think this is what matlab does, and I consider it a major weakness. I
therefore believe that the mplot3d approach is good for what it is
designed for (which means not being a complete 3d rendering engine).

The drawback, of course, is that you have to do more 3d stuff
yourself. There are some good reasons why some problems are *very*
hard to solve, but others are doable, such as z-ordering all the
polygons (and perhaps splitting them if that's required). Gouraud
shading is something else that should be possible. Getting dashed 3d
lines z-sorted in a good-looking way sounds very hard to me, but for
solid lines it should be ok.

As a comment to a previous post, by Gael if I'm not mistaken: mplot3d
internally has all info in 3d. In the end you have to go 2d somewhere,
and I personally think that we do this at the correct level.

Let me mention some more areas of improvement. Currently the Axis3D
code does some magic to draw the axes lines and ticks in the correct
location. It would be better to rewrite this class to use actual
Line3D instances to reduce duplicate code.

This brings me to my last remark, which is about the fact that Axes3D
currently inherits from Axes. The reason why this was is of course to
reduce code duplication. However, I can see why this can be very
confusing to the user since it is indeed not clear what is and what is
not supposed to work. I need to think a bit about the solution; indeed
it might be better to not inherit from Axes. But do not call that all
too soon, since Axes is still doing some work under the hood. On the
other hand, many of the functions probably don't really make sense.

I think restarting from scratch is almost never a good plan...

Cheers,
Reinier

PS: John, I would be interested in mentoring a gsoc student.

On Thu, Feb 25, 2010 at 7:26 PM, Eric Firing  wrote:
> John Hunter wrote:
> [...]
>>
>> It looks like we have enough 3D projects to justify a google summer of
>> code student. Would those of you with an interest in mplot3d and some
>> knowledge of the internals be interested in helping mentor a student?
>>
>
> http://www.mail-archive.com/matplotlib-de...@lists.sourceforge.net/msg01343.html
>
> Is it time for some re-thinking of the approach to 3-D?  I am a
> bystander, but I have the uneasy sense that trying to turn mplot3d into
> a first-class 3-D plotting tool may be a misapplication of effort.
> Might the effort be more productive if applied to mayavi, or built on
> mayavi, so that the 3-D engine is already taken care of?
>
> Eric
>
> --
> Download Intel® 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
>



-- 
Reinier Heeres
Tel: +31 6 10852639

--
Download Intel® 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] mplot3d stays?

2010-02-26 Thread Alan G Isaac
On 2/26/2010 3:04 AM, Friedrich Romstedt wrote:
> I need a physical rendering engine with light
> sources and reflectance/transmittance simulation

http://en.wikipedia.org/wiki/POV-Ray ?

Alan Isaac


--
Download Intel® 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] Need help with a local install of matplotlib under Linux

2010-02-26 Thread Michael Droettboom
LB wrote:
> Hi,
>
> I would like to make a local install of matplotlib under Linux, but 
> I've got 2 problems :
>
> 1)  I didn't find how to setup the build to use the PGI C compiler.
> I tried python setup buil --help-compiler but there seems to be no 
> preconfigured options for this compiler, and the default doesn't work 
> (see log2, below)
> How should I configure this ?
Python's distutils doesn't include support for the PGI compiler.  Does 
PGI offer a gcc commandline compatibility mode (like icc does?).  If 
not, you may need to look into providing a custom compiler class for PGI 
-- the distutils mailing list may be able to help you more than this one.
>
> 2) I have a problem with the configuration of gtk dependencies.
> Theses dependencies are also locally installed and the setup.py script 
> didn't find them (see log1 below)
> But, the strange thing is that, if I modify the setup.py script and 
> add "import gtk" on the top of it, the configuration seems to run 
> nicely (see log2).
> Indded, it seems that "import gtk" works in setup.py but doesn't in 
> setupext.py, which is very weird to me
>
> Have you got any ideas on how to solve this ?
That indeed is strange.  Are you doing anything special with your 
PYTHONPATH environment variable, using virtualenv (or similar) that 
might have an impact on your Python environment during compilation?

Mike
>
> [ log1 ]
> > python setup.py build
> 
> BUILDING MATPLOTLIB
> matplotlib: 0.98.0
> python: 2.5.2 |EPD Py25 4.1.30101| (r252:60911, Dec 19 
> 2008,
> 17:15:55)  [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)]
>   platform: linux2
>
> REQUIRED DEPENDENCIES
>  numpy: 1.1.1
>  freetype2: 9.10.3
>
> OPTIONAL BACKEND DEPENDENCIES
> libpng: 1.2.10
>Tkinter: no
> * Using default library and include 
> directories for
> * Tcl and Tk because a Tk window failed to open.
> * You may need to define DISPLAY for Tk to work so
> * that setup can determine where your 
> libraries are
> * located. Tkinter present, but header files 
> are not
> * found. You may need to install development
> * packages.
>   wxPython: 2.8.7.1
> * WxAgg extension not required for wxPython >= 2.8
>   Gtk+: no
> * Building for Gtk+ requires pygtk; you must 
> be able
> * to "import gtk" in your build/install 
> environment
> Qt: no
>Qt4: no
>  Cairo: no
>
> OPTIONAL DATE/TIMEZONE DEPENDENCIES
>   datetime: present, version unknown
>   dateutil: 1.4
>   pytz: 2008c
>
> OPTIONAL USETEX DEPENDENCIES
> dvipng: 1.5
>ghostscript: 8.15.2
>  latex: 3.141592
>
> EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
>  configobj: 4.5.3
>   enthought.traits: 3.0.3
>
> [Edit setup.cfg to suppress the above messages]
> 
> [/log1]
>
>
>
> [log2]
> > python setup.py build
> 
> BUILDING MATPLOTLIB
> matplotlib: 0.98.0
> python: 2.5.2 |EPD Py25 4.1.30101| (r252:60911, Dec 19 
> 2008,
> 17:15:55)  [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)]
>   platform: linux2
>
> REQUIRED DEPENDENCIES
>  numpy: 1.1.1
>  freetype2: 9.10.3
>
> OPTIONAL BACKEND DEPENDENCIES
> libpng: 1.2.10
>Tkinter: no
> * Using default library and include 
> directories for
> * Tcl and Tk because a Tk window failed to open.
> * You may need to define DISPLAY for Tk to work so
> * that setup can determine where your 
> libraries are
> * located. Tkinter present, but header files 
> are not
> * found. You may need to install development
> * packages.
>   wxPython: 2.8.7.1
> * WxAgg extension not required for wxPython >= 2.8
>   Gtk+: gtk+: 2.10.14, glib: 2.22.4, pygtk: 2.10.6,
> pygobject: 2.12.3
> Qt: no
>Qt4: no
>  Cairo: 1.4.0
>
> OPTIONAL DATE/TIMEZONE DEPENDENCIES
>   datetime: present, version unknown
>   dateutil: 1.4
>   pytz: 2008c
>
> OPTIONAL USETEX DEPENDENCIES
> dvipng: 1.5
>ghostscript: 8.15.2
> 

[Matplotlib-users] Pixel Offset Example Not Working

2010-02-26 Thread mikey
Hi there,

Just wondering if anyone knows how to do a pixel offset in matplotlib?

I've tried running the example in
http://www.scipy.org/Cookbook/Matplotlib/Transformations#line-58 but
it appears to have been trashed by changes to the api. The functions
in the no-offset_copy function version don't exist any more and their
replacements don't work the same way, and the offset_copy function is
not available. (At least I am assuming it is because of updates rather
then my copy of Matplotlib being out of date: 0.99.1.1) This is a very
useful function if you're doing discrete data plots like I am and you
want uniform clusters of points.

Thanks for your time.

Regards,


Mikey

--
Download Intel® 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] using the symbol font in TeX plots

2010-02-26 Thread Michael Droettboom
Thanks for the reminder.  Sorry this fell through the cracks.

The reason this worked for me and not for you is that I had set (and 
later forgotten) font.sans-serif to the following:

   font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida 
Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif

DejaVu Sans is the successor to Vera Sans that includes much larger 
Unicode coverage, including the Greek characters here.  Vera Sans (at 
least the version shipped with matplotlib) does not include these 
characters.

It's an open question whether we want to ship the larger DejaVu fonts 
with matplotlib (and annoy the distro packagers even further who already 
dislike some of matplotlib's redundancy).  A less disruptive change may 
be to change the rc defaults to put DejaVu in front of Vera, even though 
we don't ship DejaVu.  This will help the majority of Linux users on 
modern distros (where DejaVu is almost always installed by default, I 
suspect), and still have our own Vera as a fallback (albeit with a more 
limited character set).  Especially since DejaVu and Vera are basically 
the same font, and substituting one for the other would not change the 
appearance of plots, I think this a reasonably safe thing to do -- but 
I'd appreciate feedback in case I haven't thought through all the issues.

Mike

Gökhan Sever wrote:
>
>
> On Fri, Jan 29, 2010 at 7:43 AM, Michael Droettboom  > wrote:
>
> On 01/28/2010 08:08 PM, Gökhan Sever wrote:
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
>
> from pylab import *
>
> plot([1]*5)
> xlabel(u'μ = 50')
> ylabel(u'σ = 1.5')
>
> show()
>
> It works for me.  Can you provide a screenshot and the output from
> matplotlib with "verbose.level : debug-annoying" in your matplotlibrc?
>
> Mike
>
>
> Mike,
>
> Attached are the outputs. Which font do you activated in your 
> matplotlibrc? Currently non-active in mine.
>
>
> -- 
> Gökhan
> 
>

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Download Intel® 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] Pixel Offset Example Not Working

2010-02-26 Thread Michael Droettboom
offset_copy is still available, but unfortunately doesn't work with the 
cookbook example because of a bug that was inadvertently introduced into 
matplotlib.

The bug is that offset_copy should have been defined as:

   def offset_copy(trans, fig=None, x=0.0, y=0.0, units='inches'):

instead of:

   def offset_copy(trans, fig, x=0.0, y=0.0, units='inches'):

That is, the "fig" argument was originally optional, and in July 2008 I 
accidentally was made it "required".

This will be fixed in the next release of matplotlib -- in the meantime 
the workaround to get the Cookbook recipe to work is to call offset_copy 
like this:

return offset_copy(ax.transData, None, x=x, y=y, units='dots')


If that change doesn't fix the recipe for you, please send a full 
traceback of the error so we can diagnose the problem.  (FWIW -- I don't 
have edit privileges for the cookbook page, or I would go in and fix 
this...)

Cheers,
Mike

mikey wrote:
> Hi there,
>
> Just wondering if anyone knows how to do a pixel offset in matplotlib?
>
> I've tried running the example in
> http://www.scipy.org/Cookbook/Matplotlib/Transformations#line-58 but
> it appears to have been trashed by changes to the api. The functions
> in the no-offset_copy function version don't exist any more and their
> replacements don't work the same way, and the offset_copy function is
> not available. (At least I am assuming it is because of updates rather
> then my copy of Matplotlib being out of date: 0.99.1.1) This is a very
> useful function if you're doing discrete data plots like I am and you
> want uniform clusters of points.
>
> Thanks for your time.
>
> Regards,
>
>
> Mikey
>
> --
> Download Intel® 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
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Download Intel® 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] Pixel Offset Example Not Working

2010-02-26 Thread John Hunter
On Fri, Feb 26, 2010 at 9:47 AM, mikey  wrote:
> Hi there,
>
> Just wondering if anyone knows how to do a pixel offset in matplotlib?
>
> I've tried running the example in
> http://www.scipy.org/Cookbook/Matplotlib/Transformations#line-58 but

There is an "official" transformations tutorial now in the mpl docs
which is updated to the current API

http://matplotlib.sourceforge.net/users/transforms_tutorial.html

JDH

--
Download Intel® 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] mplot3d stays?

2010-02-26 Thread Jakub Nowacki
Dear all,

I don't know if creating full blown 3d library makes much sense. I think 
Reinier is right here that the current mplot3d creates quite satisfactory 
outcome with matplotlib look-and-feel we all like. In general, there are 3d 
libraries/packages out there (VTK, Mayavi2 etc.), which do most of the stuff 
one would need. The problem is many times using is not that trivial. Also, the 
installation process is usually much more complex, eg. setting up mayavi2 on 
snow leopard took me several days. 

I asked the question in the first place because in many cases I need rather 
simple 3d plotting tool, without al the massive rendering capabilities etc. 
Since I use matplotlib anyway, it would be nice to use the same tool and not be 
forced to install and learn something new just to plot not very complicated 
surface. Hence, I think the main goal here should be to have a relatively 
simple but usable plotting tool with matplotlib look-an-feel. 

BTW I didn't know that my simple question would generate such a discussion. :)

Best wishes,

Jakub
--
Download Intel® 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] Column graph with variable width

2010-02-26 Thread Wai Yip Tung
I managed to generated the chart I want by twisting the hist() function. I  
chart and source code can be found here:

http://tungwaiyip.info/blog/2010/02/26/visualization_using_variable_width_bar_chart

If you have any comment on my method it will be greatly appriciated.

Wai Yip


> I want to plat a column graph with variable width. The size of both axis
> have meaning. The Y-axis is the density. The X-axis is the size. Let's  
> say
> it is a graph of world population by country. Say China has 1 billion
> people occupying an area of 1 km2. And Japan has 0.1 billion people
> occupying an area 500 km2. So their density is 1 billion / 1 and 0.1
> billion / 500 respectively. The chart should show Japan's column twice as
> high as China but much narrower. And the area of each column reflects the
> population.
>
> My question is how do I plot a column graph with variable width? The
> closest I can find is in the histogram in the second example below
>
> http://matplotlib.sourceforge.net/examples/pylab_examples/histogram_demo_extended.html
>
> I'm quite new to matplotlib. Thanks for your help.
>
> Wai Yip
>
>
> --
> Download Intel® 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


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


--
Download Intel® 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] using the symbol font in TeX plots

2010-02-26 Thread Gökhan Sever
Thanks Mike. The Greek symbols become visible when I make the changes as you
suggested. DejaVu Sans has been installed in my system (Fedora 12). We might
put a note on the documentation stating to get wider Unicode coverage people
could install additional fonts --DejaVu Sans being one of them instead of
shipping the fonts with matplotlib.

With my working unicode example, now I have three ways to show u^-2 on
labels. See the code at:
http://code.google.com/p/ccnworks/source/browse/trunk/various/threemus.py

Not heavy Latex users like me might find unicode fonts much easier to create
their labels. Especially using units like #/cm^3.

There are so many nice looking symbols in the DejaVu Sans samples at
http://dejavu.sf.net/samples/DejaVuSans.pdf
Is it possible in matplotlib to use those symbols as replacement for regular
markers while plotting? I recall someone was asking about using Latex
symbols as markers, but not sure about the fate of his question.

Thanks

On Fri, Feb 26, 2010 at 10:13 AM, Michael Droettboom wrote:

> Thanks for the reminder.  Sorry this fell through the cracks.
>
> The reason this worked for me and not for you is that I had set (and later
> forgotten) font.sans-serif to the following:
>
>  font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida Grande,
> Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
>
> DejaVu Sans is the successor to Vera Sans that includes much larger Unicode
> coverage, including the Greek characters here.  Vera Sans (at least the
> version shipped with matplotlib) does not include these characters.
>
> It's an open question whether we want to ship the larger DejaVu fonts with
> matplotlib (and annoy the distro packagers even further who already dislike
> some of matplotlib's redundancy).  A less disruptive change may be to change
> the rc defaults to put DejaVu in front of Vera, even though we don't ship
> DejaVu.  This will help the majority of Linux users on modern distros (where
> DejaVu is almost always installed by default, I suspect), and still have our
> own Vera as a fallback (albeit with a more limited character set).
>  Especially since DejaVu and Vera are basically the same font, and
> substituting one for the other would not change the appearance of plots, I
> think this a reasonably safe thing to do -- but I'd appreciate feedback in
> case I haven't thought through all the issues.
>
> Mike
>
> Gökhan Sever wrote:
>
>>
>>
>> On Fri, Jan 29, 2010 at 7:43 AM, Michael Droettboom > md...@stsci.edu>> wrote:
>>
>>On 01/28/2010 08:08 PM, Gökhan Sever wrote:
>>
>>#!/usr/bin/python
>># -*- coding: utf-8 -*-
>>
>>from pylab import *
>>
>>plot([1]*5)
>>xlabel(u'μ = 50')
>>ylabel(u'σ = 1.5')
>>
>>show()
>>
>>It works for me.  Can you provide a screenshot and the output from
>>matplotlib with "verbose.level : debug-annoying" in your matplotlibrc?
>>
>>Mike
>>
>>
>> Mike,
>>
>> Attached are the outputs. Which font do you activated in your
>> matplotlibrc? Currently non-active in mine.
>>
>>
>> --
>> Gökhan
>> 
>>
>>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>


-- 
Gökhan
--
Download Intel® 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] using the symbol font in TeX plots

2010-02-26 Thread Michael Droettboom
SVN trunk has support for mathtext as symbol markers --

  plot(range(10), linestyle='None', marker=r'$\clubsuit$')

We could support arbitrary (non-math) text, too, fairly easily.  We just 
need to invent a syntax for it.

Mike

Gökhan Sever wrote:
> Thanks Mike. The Greek symbols become visible when I make the changes 
> as you suggested. DejaVu Sans has been installed in my system (Fedora 
> 12). We might put a note on the documentation stating to get wider 
> Unicode coverage people could install additional fonts --DejaVu Sans 
> being one of them instead of shipping the fonts with matplotlib.
>
> With my working unicode example, now I have three ways to show u^-2 on 
> labels. See the code at: 
> http://code.google.com/p/ccnworks/source/browse/trunk/various/threemus.py
>
> Not heavy Latex users like me might find unicode fonts much easier to 
> create their labels. Especially using units like #/cm^3.
>
> There are so many nice looking symbols in the DejaVu Sans samples at 
> http://dejavu.sf.net/samples/DejaVuSans.pdf
> Is it possible in matplotlib to use those symbols as replacement for 
> regular markers while plotting? I recall someone was asking about 
> using Latex symbols as markers, but not sure about the fate of his 
> question.
>
> Thanks
>
> On Fri, Feb 26, 2010 at 10:13 AM, Michael Droettboom  > wrote:
>
> Thanks for the reminder.  Sorry this fell through the cracks.
>
> The reason this worked for me and not for you is that I had set
> (and later forgotten) font.sans-serif to the following:
>
>  font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida
> Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde,
> sans-serif
>
> DejaVu Sans is the successor to Vera Sans that includes much
> larger Unicode coverage, including the Greek characters here.
>  Vera Sans (at least the version shipped with matplotlib) does not
> include these characters.
>
> It's an open question whether we want to ship the larger DejaVu
> fonts with matplotlib (and annoy the distro packagers even further
> who already dislike some of matplotlib's redundancy).  A less
> disruptive change may be to change the rc defaults to put DejaVu
> in front of Vera, even though we don't ship DejaVu.  This will
> help the majority of Linux users on modern distros (where DejaVu
> is almost always installed by default, I suspect), and still have
> our own Vera as a fallback (albeit with a more limited character
> set).  Especially since DejaVu and Vera are basically the same
> font, and substituting one for the other would not change the
> appearance of plots, I think this a reasonably safe thing to do --
> but I'd appreciate feedback in case I haven't thought through all
> the issues.
>
> Mike
>
> Gökhan Sever wrote:
>
>
>
> On Fri, Jan 29, 2010 at 7:43 AM, Michael Droettboom
> mailto:md...@stsci.edu>
> >> wrote:
>
>On 01/28/2010 08:08 PM, Gökhan Sever wrote:
>
>#!/usr/bin/python
># -*- coding: utf-8 -*-
>
>from pylab import *
>
>plot([1]*5)
>xlabel(u'μ = 50')
>ylabel(u'σ = 1.5')
>
>show()
>
>It works for me.  Can you provide a screenshot and the
> output from
>matplotlib with "verbose.level : debug-annoying" in your
> matplotlibrc?
>
>Mike
>
>
> Mike,
>
> Attached are the outputs. Which font do you activated in your
> matplotlibrc? Currently non-active in mine.
>
>
> -- 
> Gökhan
> 
> 
>
>
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
>
>
> -- 
> Gökhan

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Download Intel® 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] mplot3d stays?

2010-02-26 Thread Ben Axelrod
I also agree with Reinier.  I want my 3d plots to look as close as possible to 
my 2d plots.  Because mplot3d uses so much of the same matplotlib core, this is 
trivial.  As Friedrich mentioned, the mplot3d code is actually pretty small.  
To me, that is a great feature.   I found the mplot3d code very accessible.

I do agree that there is still much work to be done in mplot3d.  But I think 
starting from scratch is a waste of time.

FYI, I looked into using mayavi2 before settling on mplot3d.  Mayavi can create 
some stunning graphics, but I found that it is very restrictive in its plotting 
options.  Take for example the 3d scatter plot.  They combined the size and 
color parameter.  Getting around this strange restriction took me quite some 
time.  (Installation for me was also a pain due to VTK).

-Ben


-Original Message-
From: Jakub Nowacki [mailto:j.s.nowa...@googlemail.com] 
Sent: Friday, February 26, 2010 12:01 PM
To: matplotlib-users
Subject: Re: [Matplotlib-users] mplot3d stays?

Dear all,

I don't know if creating full blown 3d library makes much sense. I think 
Reinier is right here that the current mplot3d creates quite satisfactory 
outcome with matplotlib look-and-feel we all like. In general, there are 3d 
libraries/packages out there (VTK, Mayavi2 etc.), which do most of the stuff 
one would need. The problem is many times using is not that trivial. Also, the 
installation process is usually much more complex, eg. setting up mayavi2 on 
snow leopard took me several days. 

I asked the question in the first place because in many cases I need rather 
simple 3d plotting tool, without al the massive rendering capabilities etc. 
Since I use matplotlib anyway, it would be nice to use the same tool and not be 
forced to install and learn something new just to plot not very complicated 
surface. Hence, I think the main goal here should be to have a relatively 
simple but usable plotting tool with matplotlib look-an-feel. 

BTW I didn't know that my simple question would generate such a discussion. :)

Best wishes,

Jakub
--
Download Intel® 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

--
Download Intel® 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] using the symbol font in TeX plots

2010-02-26 Thread Gökhan Sever
Thanks again. I didn't know it was complete :)

For the second idea you mean something as generic as plotting such markers?

plt.plot(range(10), linestyle='None', marker=u'※ ')



On Fri, Feb 26, 2010 at 2:56 PM, Michael Droettboom  wrote:

> SVN trunk has support for mathtext as symbol markers --
>
>  plot(range(10), linestyle='None', marker=r'$\clubsuit$')
>
> We could support arbitrary (non-math) text, too, fairly easily.  We just
> need to invent a syntax for it.
>
> Mike
>
> Gökhan Sever wrote:
>
>> Thanks Mike. The Greek symbols become visible when I make the changes as
>> you suggested. DejaVu Sans has been installed in my system (Fedora 12). We
>> might put a note on the documentation stating to get wider Unicode coverage
>> people could install additional fonts --DejaVu Sans being one of them
>> instead of shipping the fonts with matplotlib.
>>
>> With my working unicode example, now I have three ways to show u^-2 on
>> labels. See the code at:
>> http://code.google.com/p/ccnworks/source/browse/trunk/various/threemus.py
>>
>> Not heavy Latex users like me might find unicode fonts much easier to
>> create their labels. Especially using units like #/cm^3.
>>
>> There are so many nice looking symbols in the DejaVu Sans samples at
>> http://dejavu.sf.net/samples/DejaVuSans.pdf
>> Is it possible in matplotlib to use those symbols as replacement for
>> regular markers while plotting? I recall someone was asking about using
>> Latex symbols as markers, but not sure about the fate of his question.
>>
>> Thanks
>>
>> On Fri, Feb 26, 2010 at 10:13 AM, Michael Droettboom > md...@stsci.edu>> wrote:
>>
>>Thanks for the reminder.  Sorry this fell through the cracks.
>>
>>The reason this worked for me and not for you is that I had set
>>(and later forgotten) font.sans-serif to the following:
>>
>> font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida
>>Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde,
>>sans-serif
>>
>>DejaVu Sans is the successor to Vera Sans that includes much
>>larger Unicode coverage, including the Greek characters here.
>> Vera Sans (at least the version shipped with matplotlib) does not
>>include these characters.
>>
>>It's an open question whether we want to ship the larger DejaVu
>>fonts with matplotlib (and annoy the distro packagers even further
>>who already dislike some of matplotlib's redundancy).  A less
>>disruptive change may be to change the rc defaults to put DejaVu
>>in front of Vera, even though we don't ship DejaVu.  This will
>>help the majority of Linux users on modern distros (where DejaVu
>>is almost always installed by default, I suspect), and still have
>>our own Vera as a fallback (albeit with a more limited character
>>set).  Especially since DejaVu and Vera are basically the same
>>font, and substituting one for the other would not change the
>>appearance of plots, I think this a reasonably safe thing to do --
>>but I'd appreciate feedback in case I haven't thought through all
>>the issues.
>>
>>Mike
>>
>>Gökhan Sever wrote:
>>
>>
>>
>>On Fri, Jan 29, 2010 at 7:43 AM, Michael Droettboom
>>mailto:md...@stsci.edu>
>>>> wrote:
>>
>>   On 01/28/2010 08:08 PM, Gökhan Sever wrote:
>>
>>   #!/usr/bin/python
>>   # -*- coding: utf-8 -*-
>>
>>   from pylab import *
>>
>>   plot([1]*5)
>>   xlabel(u'μ = 50')
>>   ylabel(u'σ = 1.5')
>>
>>   show()
>>
>>   It works for me.  Can you provide a screenshot and the
>>output from
>>   matplotlib with "verbose.level : debug-annoying" in your
>>matplotlibrc?
>>
>>   Mike
>>
>>
>>Mike,
>>
>>Attached are the outputs. Which font do you activated in your
>>matplotlibrc? Currently non-active in mine.
>>
>>
>>--Gökhan
>>
>>  
>>
>>
>>--Michael Droettboom
>>Science Software Branch
>>Operations and Engineering Division
>>Space Telescope Science Institute
>>Operated by AURA for NASA
>>
>>
>>
>>
>> --
>> Gökhan
>>
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>


-- 
Gökhan
--
Download Intel® 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] mplot3d stays?

2010-02-26 Thread Friedrich Romstedt
> I also agree with Reinier.  I want my 3d plots to look as close as possible 
> to my 2d plots.  Because mplot3d uses so much of the same matplotlib core, 
> this is trivial.  As Friedrich mentioned, the mplot3d code is actually pretty 
> small.  To me, that is a great feature.   I found the mplot3d code very 
> accessible.

Yes, I agree that it's really readable.  But I didn't understand the
sorting algorithm in plot_surface().

> I do agree that there is still much work to be done in mplot3d.  But I think 
> starting from scratch is a waste of time.

Well, I see ... When I write code "from scratch" as I often do, I mean
to open a new file and to copy old code only if it useful or
necessary.  So I don't want to break the old code.  I in fact think
the current code is doing good work.  But to my perception, it
nevetheless needs some additional concepts like the global "surface
space" and another sorting algorithm.

> FYI, I looked into using mayavi2 before settling on mplot3d.  Mayavi can 
> create some stunning graphics, but I found that it is very restrictive in its 
> plotting options.  Take for example the 3d scatter plot.  They combined the 
> size and color parameter.  Getting around this strange restriction took me 
> quite some time.  (Installation for me was also a pain due to VTK).

That's important information, at least for me.  I was so impressed by
mayavi, that I was near to be stopped from all enthusiasm for mplot3d.
 But I see, there would be some use.  The arguments you gave are
already quite strong.  I think the possibility to plot 2d things in 3d
context like a stack of curves using the matplotlib style seems to be
quite a good thing, isn't it?

I would like to tell some "fresh look" onto the problem just coming
into my mind.  What about turning matplotlib itself into the 3D
rendering engine?  This would maybe be like a fork.  But it would
leave all matplotlib commands intact, putting the layer like this:

matplotlib
--
3D rendering engine
--
backend

Instead of:

3D rendering engine

matplotlib

backend.

I mean, the matplotlib would create some kind of plotting commands,
either 2d or 3d.  The 3d ones would be translated into 2d camera space
by the intersecting layer.  2d ones would be promoted to the 3d camera
space before being projected into the 2d camera space.  This is a raw
idea, I'm shure, so please don't kill me for it.  When it turns out to
be without substance, I would not be offended.

How feasible would this be?

Friedrich

P.S.: But it would maybe simplify the sorting much.  The 3D engine
stores the projected polygons with z information (z as the depth from
the camera).  When another polygon arrives, it will be cut /after
projection/ into pieces based on the polygons in front of it, and be
drawn upon all polygons behind.  The weel again?

P.P.S.: I'm very un-self-confident about this ideas.  But I read, in
OSS one should also publish half-baken ideas, even when they do not
compile ...

--
Download Intel® 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] Change the size of the plotted 'o's ?

2010-02-26 Thread mikey
Sorry a rather stupid question as there are '.'s available. Although I
wouldn't mind knowing if it's possible to tinker with the sizes of
'o's and '.'s.

Thanks,

Mikey

On 27 February 2010 00:29, mikey  wrote:
> Hi there,
>
> I've just made script for displaying discrete data clustered in boxes
> on my graph. The plots are plotted with plt.plot(x,y,'o') and the 'o's
> seem a reasonable size on screen but when I render it to file they
> look huge so I'd like to reduce their size. Does anyone know how this
> is done?
>
> Regards,
>
> Mikey
>

--
Download Intel® 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] Change the size of the plotted 'o's ?

2010-02-26 Thread mikey
Hi there,

I've just made script for displaying discrete data clustered in boxes
on my graph. The plots are plotted with plt.plot(x,y,'o') and the 'o's
seem a reasonable size on screen but when I render it to file they
look huge so I'd like to reduce their size. Does anyone know how this
is done?

Regards,

Mikey

--
Download Intel® 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] Change the size of the plotted 'o's ?

2010-02-26 Thread PHobson
> -Original Message-
> From: mikey [mailto:abc.mi...@googlemail.com]
> Sent: Friday, February 26, 2010 4:29 PM
> To: matplotlib-users@lists.sourceforge.net
> Subject: [Matplotlib-users] Change the size of the plotted 'o's ?
> 
> Hi there,
> 
> I've just made script for displaying discrete data clustered in boxes
> on my graph. The plots are plotted with plt.plot(x,y,'o') and the 'o's
> seem a reasonable size on screen but when I render it to file they
> look huge so I'd like to reduce their size. Does anyone know how this
> is done?

Mike,

There are a couple of ways. See below:

# untested, might have typos 
import numpy as np
import matplotlib.pyplot as pl

x = np.random.randn(20)
fig = pl.figure()
ax = pl.add_subplot(1,1,1)

# you can specify the marker size two ways directly:
ax.plot(x, 'ko', markersize=4) # size in points
ax.plot(x, 'bs', ms=4) % ms is just an alias for markersize


# or you can specify it after the plotting:
X = ax.plot(x, 'ko') # X is a *list* of line2d objects...

X[0].set_markersize(4) # set_ms works too
# or...
pl.setp(Y, markersize=4) # again, ms works.
# 

For a list of all the properties you can tweak, type:
pl.getp()

HTH,
-paul

--
Download Intel® 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] Change the size of the plotted 'o's ?

2010-02-26 Thread John Hunter
On Fri, Feb 26, 2010 at 6:35 PM, mikey  wrote:
> Sorry a rather stupid question as there are '.'s available. Although I
> wouldn't mind knowing if it's possible to tinker with the sizes of
> 'o's and '.'s.

See the "markersize" parameter

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot

JDH

--
Download Intel® 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] Change the size of the plotted 'o's ?

2010-02-26 Thread Gökhan Sever
On Fri, Feb 26, 2010 at 6:29 PM, mikey  wrote:

> Hi there,
>
> I've just made script for displaying discrete data clustered in boxes
> on my graph. The plots are plotted with plt.plot(x,y,'o') and the 'o's
> seem a reasonable size on screen but when I render it to file they
> look huge so I'd like to reduce their size. Does anyone know how this
> is done?
>
> Regards,
>
> Mikey
>
>
Hey,

Try:

I[1]: plt.plot(range(100), "o", markersize=100)

I[2]: plt.plot(range(100), "o", markersize=1)

I[3]: plt.figure(); plt.plot(range(100), "o", ms=1)




>
> --
> Download Intel® 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
>



-- 
Gökhan
--
Download Intel® 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] Artist tutorial different response

2010-02-26 Thread David Arnold
All,

On: http://matplotlib.sourceforge.net/users/artists.html

In the Axes Container section, you can see in what follows that I got some very 
different responses than what is shown on the page:

In [1]: fig=figure()

In [3]: ax=fig.add_subplot(111)

In [4]: rect=matplotlib.patches.Rectangle((1,1),width=5,height=12)

In [5]: print rect.get_axes()
--> print(rect.get_axes())
None

In [6]: print rect.get_transform()
--> print(rect.get_transform())
BboxTransformTo(Bbox(array([[  1.,   1.],
   [  6.,  13.]])))

In [7]: ax.add_patch(rect)
Out[7]: 

In [8]: print rect.get_axes()
--> print(rect.get_axes())
Axes(0.125,0.1;0.775x0.8)

In [9]: print rect.get_transform()
--> print(rect.get_transform())
CompositeGenericTransform(BboxTransformTo(Bbox(array([[  1.,   1.],
   [  6.,  13.]]))), 
CompositeGenericTransform(TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())),
 CompositeAffine2D(BboxTransformFrom(TransformedBbox(Bbox(array([[ 0.,  0.],
   [ 1.,  1.]])), 
TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform(), 
BboxTransformTo(TransformedBbox(Bbox(array([[ 0.125,  0.1  ],
   [ 0.9  ,  0.9  ]])), BboxTransformTo(TransformedBbox(Bbox(array([[ 0.,  
0.],
   [ 8.,  6.]])), Affine2D(array([[ 80.,   0.,   0.],
   [  0.,  80.,   0.],
   [  0.,   0.,   1.]])

In [10]: print ax.transData
---> print(ax.transData)
CompositeGenericTransform(TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())),
 CompositeAffine2D(BboxTransformFrom(TransformedBbox(Bbox(array([[ 0.,  0.],
   [ 1.,  1.]])), 
TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform(), 
BboxTransformTo(TransformedBbox(Bbox(array([[ 0.125,  0.1  ],
   [ 0.9  ,  0.9  ]])), BboxTransformTo(TransformedBbox(Bbox(array([[ 0.,  
0.],
   [ 8.,  6.]])), Affine2D(array([[ 80.,   0.,   0.],
   [  0.,  80.,   0.],
   [  0.,   0.,   1.]]

In [11]: print ax.get_xlim()
---> print(ax.get_xlim())
(0.0, 1.0)

In [12]: print ax.dataLim.get_bounds()
---> print(ax.dataLim.get_bounds())
---
AttributeErrorTraceback (most recent call last)

/Library/Frameworks/Python.framework/Versions/6.0.0/Examples/matplotlib-0.99.1.1/event_handling/ in ()

AttributeError: 'Bbox' object has no attribute 'get_bounds'

In [13]: ax.autoscale_view()

In [14]: print ax.get_xlim()
---> print(ax.get_xlim())
(1.0, 6.0)

In [15]: ax.figure.canvas.draw()

David.
--
Download Intel® 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