[Matplotlib-users] Basemap installation on Ubuntu 9.04 (Jaunty

2009-07-23 Thread Nicolas
-- 
_/\/¯¯\/\_ 33º49'45.24"S & 18º28'45.60"E
Dr. Nicolas Fauchereau
Senior Researcher
CSIR - NRE
Research Group: Ocean systems and climate
15 Lower Hope street, Rosebank 7700
South Africa
_/\/¯¯\/\_ 33º49'45.24"S & 18º28'45.60"E

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


[Matplotlib-users] Basemap installation on Ubuntu 9.04 (Jaunty Jackalope)

2009-07-23 Thread Nicolas
Hi all

I was wondering if anyone managed to find / install Basemap on a i386
machine running ubuntu 9.04 (Jaunty Jackalope) ...

I've installed the debs through synaptic, and I've tried without
success to compile
Basemap (0.99), with failure at the libgeos compilation. Trying to
install "old" .deb (python-basemap_0.99-0ads1_i386.deb) complains
about python 2.6

do I have to redo all the installation (numpy etc) using an older python (2.5) ?

thanks for any advice


-- 
_/\/¯¯\/\_ 33º49'45.24"S & 18º28'45.60"E
Dr. Nicolas Fauchereau
Senior Researcher
CSIR - NRE
Research Group: Ocean systems and climate
15 Lower Hope street, Rosebank 7700
South Africa
_/\/¯¯\/\_ 33º49'45.24"S & 18º28'45.60"E

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


[Matplotlib-users] problem with streamplot method in basemap-1.0.3(4)

2012-06-20 Thread Nicolas
Hi all

I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
7.3 (linux x86_64) running on a linux ubuntu 11.10.

archives downloaded from
http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/

My matplotlib version is 1.1.0 and I have checked that indeed the call
to mpl_toolkits.basemap returns the correct version (I have installed
successively 1.0.3 and then cleaned up and installed 1.0.4)

the traceback is

"""
Traceback (most recent call last):
 File "streamplot_demo.py", line 32, in 
  
m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
 File 
"/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
line 3370, in streamplot
  ret =  ax.streamplot(x,y,u,v,*args,**kwargs)
AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
"""

the doc string for streamplot_demo.py (in the example folder of the
basemap1.0.4 sources) states that it requires the vectorplot scikit,
which I have installed but been unable to get working (complains about
missing lic_internal module ...)

what is confusing is that the entry for streamplot_demo in the README
(from basemap_1.0.4-examples) states that it "shows the new matplotlib
streamplot method to visualize wind fields"

Do I need to upgrade matplotlib to the development version ?

thanks a lot in advance for any help on that one ...

-- 
-----
Dr. Nicolas Fauchereau
Climate Scientist – National Climate Centre
National Institute of Water and Atmospheric Research (NIWA) Ltd.
41 Market Place
Viaduct Precinct, Auckland
NEW ZEALAND
Tel: +64 (0)9 375 2053
--
"It is a mistake to think you can solve any major problems just with potatoes.".
Douglas Adams.

--
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] problem with streamplot method in basemap-1.0.3(4)

2012-06-20 Thread Nicolas
Thanks Ben

so streamplot "will" be part of a future stable release of matplotlib
then ? one does not need the scikits.vectorplot installed ?

I will try and pull the latest development version of matplotlib and
install it (linux and mac os X), and then come back to the list to
give some feedbacks

cheers

Nico

On 21 June 2012 11:37, Benjamin Root  wrote:
>
>
> On Wednesday, June 20, 2012, Nicolas wrote:
>>
>> Hi all
>>
>> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
>> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>>
>> archives downloaded from
>>
>> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>>
>> My matplotlib version is 1.1.0 and I have checked that indeed the call
>> to mpl_toolkits.basemap returns the correct version (I have installed
>> successively 1.0.3 and then cleaned up and installed 1.0.4)
>>
>> the traceback is
>>
>> """
>> Traceback (most recent call last):
>>  File "streamplot_demo.py", line 32, in 
>>
>>  m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
>>  File
>> "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
>> line 3370, in streamplot
>>  ret =  ax.streamplot(x,y,u,v,*args,**kwargs)
>> AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
>> """
>>
>> the doc string for streamplot_demo.py (in the example folder of the
>> basemap1.0.4 sources) states that it requires the vectorplot scikit,
>> which I have installed but been unable to get working (complains about
>> missing lic_internal module ...)
>>
>> what is confusing is that the entry for streamplot_demo in the README
>> (from basemap_1.0.4-examples) states that it "shows the new matplotlib
>> streamplot method to visualize wind fields"
>>
>> Do I need to upgrade matplotlib to the development version ?
>
>
>
> Yes.  Streamplot hasn't been officially released yet.  Maybe Basemap should
> check for the function first?
>
> Ben Root



-- 
-
Dr. Nicolas Fauchereau
Climate Scientist – National Climate Centre
National Institute of Water and Atmospheric Research (NIWA) Ltd.
41 Market Place
Viaduct Precinct, Auckland
NEW ZEALAND
Tel: +64 (0)9 375 2053
--
"It is a mistake to think you can solve any major problems just with potatoes.".
Douglas Adams.

--
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] problem with streamplot method in basemap-1.0.3(4)

2012-06-21 Thread Nicolas
Hi all

FYI, the streamplot example does work with the dev. version of
matplotlib (that I pulled out from github, more specifically
matplotlib-matplotlib-v1.1.1-rc2-664-ga2d44d5.zip)

thanks

Nico

On 22 June 2012 02:51,   wrote:
> Send Matplotlib-users mailing list submissions to
>        matplotlib-users@lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> or, via email, send a message with subject or body 'help' to
>        matplotlib-users-requ...@lists.sourceforge.net
>
> You can reach the person managing the list at
>        matplotlib-users-ow...@lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Matplotlib-users digest..."
>
>
> Today's Topics:
>
>   1. problem with streamplot method in basemap-1.0.3(4) (Nicolas)
>   2. Re: problem with streamplot method in     basemap-1.0.3(4)
>      (Benjamin Root)
>   3. Re: problem with streamplot method in     basemap-1.0.3(4) (Nicolas)
>   4. Re: problem with streamplot method in     basemap-1.0.3(4)
>      (Jeff Whitaker)
>   5. Can boxplot handle np.NaN? (Wouter Overmeire)
>
>
> ------
>
> Message: 1
> Date: Thu, 21 Jun 2012 11:28:55 +1200
> From: Nicolas 
> Subject: [Matplotlib-users] problem with streamplot method in
>        basemap-1.0.3(4)
> To: matplotlib-users@lists.sourceforge.net
> Message-ID:
>        
> Content-Type: text/plain; charset=windows-1252
>
> Hi all
>
> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>
> archives downloaded from
> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>
> My matplotlib version is 1.1.0 and I have checked that indeed the call
> to mpl_toolkits.basemap returns the correct version (I have installed
> successively 1.0.3 and then cleaned up and installed 1.0.4)
>
> the traceback is
>
> """
> Traceback (most recent call last):
>  File "streamplot_demo.py", line 32, in 
>  m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
>  File 
> "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
> line 3370, in streamplot
>  ret =  ax.streamplot(x,y,u,v,*args,**kwargs)
> AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
> """
>
> the doc string for streamplot_demo.py (in the example folder of the
> basemap1.0.4 sources) states that it requires the vectorplot scikit,
> which I have installed but been unable to get working (complains about
> missing lic_internal module ...)
>
> what is confusing is that the entry for streamplot_demo in the README
> (from basemap_1.0.4-examples) states that it "shows the new matplotlib
> streamplot method to visualize wind fields"
>
> Do I need to upgrade matplotlib to the development version ?
>
> thanks a lot in advance for any help on that one ...
>
> --
> -
> Dr. Nicolas Fauchereau
> Climate Scientist ? National Climate Centre
> National Institute of Water and Atmospheric Research (NIWA) Ltd.
> 41 Market Place
> Viaduct Precinct, Auckland
> NEW ZEALAND
> Tel: +64 (0)9 375 2053
> ------
> "It is a mistake to think you can solve any major problems just with 
> potatoes.".
> Douglas Adams.
>
>
>
> --
>
> Message: 2
> Date: Wed, 20 Jun 2012 19:37:04 -0400
> From: Benjamin Root 
> Subject: Re: [Matplotlib-users] problem with streamplot method in
>        basemap-1.0.3(4)
> To: Nicolas 
> Cc: "matplotlib-users@lists.sourceforge.net"
>        
> Message-ID:
>        
> Content-Type: text/plain; charset="iso-8859-1"
>
> On Wednesday, June 20, 2012, Nicolas wrote:
>
>> Hi all
>>
>> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
>> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>>
>> archives downloaded from
>>
>> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>>
>> My matplotlib version is 1.1.0 and I have checked that indeed the call
>> to mpl_toolkits.basemap returns the correct version (I have installed
>> successively 1.0.3 and then cleaned up and installed 1.0.4)
>>
>> the traceback is
&

Re: [Matplotlib-users] Taylor diagram (mdekauwe)

2010-12-09 Thread Nicolas
Hi

Jean-Marie Epitalon (from IPSL) developped several scripts devoted to
model inter-comparison, included Taylor Diagram, which you can find
here 
(http://www.ipsl.jussieu.fr/~jmesce/Taylor_diagram/Miscelaneous/plot_taylor_diagrams.py)

see also here (http://www.ipsl.jussieu.fr/~jmesce/Taylor_diagram/index.html)
and follow the complete description of the program code

hope that helps

Nicolas

> Message: 6
> Date: Thu, 9 Dec 2010 14:42:41 -0800 (PST)
> From: mdekauwe 
> Subject: [Matplotlib-users]  Taylor diagram
> To: matplotlib-users@lists.sourceforge.net
> Message-ID: <30421393.p...@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi,
>
> Has anyone ever managed to draw a taylor diagram in Matplotlib? For example
> like this
>
> http://www.mathworks.com/matlabcentral/fx_files/20559/2/taylordiag_fig.jpg
>
> Cheers,
>
> Martin
> --
> View this message in context: 
> http://old.nabble.com/Taylor-diagram-tp30421393p30421393.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> End of Matplotlib-users Digest, Vol 55, Issue 12
> ****
>



-- 
_/\/¯¯\/\_ 33º49'45.24"S & 18º28'45.60"E
Dr. Nicolas Fauchereau
CSIR - NRE
Research Group: Ocean systems and climate
15 Lower Hope street, Rosebank 7700
South Africa
tel: 021 658 2764
_/\/¯¯\/\_ 33º49'45.24"S & 18º28'45.60"E

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


[Matplotlib-users] transformations

2007-02-05 Thread Nicolas
Hello,

I tried to use some affine transformations, but it didn't match to get it works.
I use matplotlib 0.87.5 with python 2.4.3 and Numeric 24.2 on winXP.

I tried for example :
plot([1,0,1],[0,1,0], transform = matplotlib.transforms.Affine(0,1,1,0,0,0))

Then I got :
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\lib\site-packages\matplotlib\pylab.py", line 2019, in plot
ret =  gca().plot(*args, **kwargs)
  File "C:\Python24\lib\site-packages\matplotlib\axes.py", line 2124, in plot
self.add_line(line)
  File "C:\Python24\lib\site-packages\matplotlib\axes.py", line 879, in add_line
xys = self._get_verts_in_data_coords(
  File "C:\Python24\lib\site-packages\matplotlib\axes.py", line 934, in 
_get_verts_in_data_coords
xys = trans.numerix_xy(asarray(xys))
ValueError: Domain error on Transformation::numerix_xy
>>> plot([1,0,1],[0,1,0], transform = matplotlib.transforms.Affine(1,0,0,1,0,0))
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\lib\site-packages\matplotlib\pylab.py", line 2019, in plot
ret =  gca().plot(*args, **kwargs)
  File "C:\Python24\lib\site-packages\matplotlib\axes.py", line 2124, in plot
self.add_line(line)
  File "C:\Python24\lib\site-packages\matplotlib\axes.py", line 879, in add_line
xys = self._get_verts_in_data_coords(
  File "C:\Python24\lib\site-packages\matplotlib\axes.py", line 934, in 
_get_verts_in_data_coords
xys = trans.numerix_xy(asarray(xys))
ValueError: Domain error on Transformation::numerix_xy

Thanks a lot,

Nicolas
 

-
 Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses.-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] RE : Re: RE : Re: transformations

2007-06-08 Thread Nicolas

I can't figure why Polygons are used even when I simply draw lines.
But I know at least why I use empty list of vertices. ;)
In fact, I use matplotlib for a dynamic geometry software (something like
GeoGebra), and systematic use of high-level functions of matplotlib would be
to slow for that purpose.
And yet, I didn't want to use too low-level functions, like the renderer's
ones, for I didn't want to depend too much of a particular renderer.

So, I created once a set of plots and fills for every object, and then I
modified its attributes . I used to set its vertices to an empty list when I
didn't want it to appear on the figure.
I suppose now I'd better use instead something like.
   my_plot._visible = False

Nevertheless, I think empty vertices should be supported here (or not
supported at all for all renderers - for in 0.90.1 it still works with tkagg
for example)

Nicolas



On 6/6/07, John Hunter <[EMAIL PROTECTED]> wrote:


On 6/6/07, Nicolas <[EMAIL PROTECTED]> wrote:

> Unfortunately, I didn't use instantiated Polygon items myself, so for
now I
> can't figure which part of my code produces indirectly such empty
> Polygons...
>
> May it be however possible to modify a little matplotlib code, so as to
> assure the compatibility with the previous existing versions of
matplotlib ?
> Something like :

I don't have a problem with this, but it just makes it easier for
latent bugs in your code to remain hidden.  Should we raise in the
Polygon constructor is you pass in an empty list of vertices?  Of
course, you can always set xy directly, so this won't catch all the
errors unless we use properties or traits.

JDH

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] export of a zone in png

2007-06-27 Thread Nicolas
Hi,

I would like to export a zone of a Figure in .png.
Something like figure.savefig("mypicture.png", box = (0,0,5,5))
How may I proceed, without drawing all the plots again ?
I use wxagg.
Thanks,

Nicolas

   
-
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail -
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] export of a specific zone of a figure

2007-06-28 Thread Nicolas
Hi,

I would like to export a zone of a Figure in .png.
Something like figure.savefig("mypicture.png", box = (0,0,5,5))
How may I proceed, without drawing all the plots again ?
I use wxagg.
Thanks,

Nicolas
   
-
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail -
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] export of a specific zone of a figure

2007-06-28 Thread Nicolas

Thanks for your reply.

However, I don't want to had a PIL dependency.

Is there any other method, using only matplotlib or wx ?

Nicolas
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] export of a specific zone of a figure

2007-06-29 Thread Nicolas

Hi,
I can figure the first steps :
something like :

   matrix = []
   buffer = self.get_renderer().tostring_argb()
   l, h = self.GetSize()
   for ligne in xrange(h):
   matrix.append([])
   for colonne in xrange(l):
   i = 4*(ligne*h + colonne)
   pixel = buffer[i:i+4]
   matrix[-1].append(pixel)
   zone_to_export = array(matrix)[pixely0:pixely1, pixelx0:pixelx1]
   new_buffer = buffer("".join("".join(elt for elt in ligne) for
ligne in zone_to_export ))

But then I don't know what to with this new buffer.
I tried to create a new RenderAgg instance, so as to use its png export
facilities.
r = RendererAgg(pixelx1 - pixelx0, pixely1 - pixely0, Value(dpi))
...
r._renderer.write_png(nom)

But I don't know what to put between the two previous lines.
How may I load a buffer content into a RenderAgg instance ?
I suppose I may use something like :
r.draw_image(0, 0, im)
but what is the correct format for im ? Is there an Image class in
matplotlib (I looked for, but didn't find).
How may I convert my buffer ?

Thanks a lot,

Nicolas



How may I transform my buffer into an image ?
On 6/28/07, John Hunter <[EMAIL PROTECTED]> wrote:


On 6/28/07, Nicolas <[EMAIL PROTECTED]> wrote:
> Thanks for your reply.
>
> However, I don't want to had a PIL dependency.
>
> Is there any other method, using only matplotlib or wx ?

agg offers methods to convert the image pixel buffer to strings or
buffers, which you could then convert to numpy arrays, so a slice
extraction, and reconvert back to a buffer and ultimately a PNG. I
don't have time right now to write some example code, but you may want
to poke around in backend_agg to see if you can figure it out, and if
not remind me next week.

Thanks,
JDH

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] export of a specific zone of a figure

2007-07-03 Thread Nicolas

Thank you very much.
I know very little about numpy in fact.

If I don't find a pure matplotlib method, I will use your suggestion with
wx.
I think however matplotlib may be used only (and it will be even better as I
plan to make a Qt version in the future)

So, in :

from matplotlib.transforms import Value
from matplotlib.backends.backend_agg import RendererAgg
r = RendererAgg(50, 50, Value(72))
r.draw_image(0, 0, im)


What is the correct format for im ?

Thanks,

Nicolas

On 7/2/07, Christopher Barker <[EMAIL PROTECTED]> wrote:


I don't know how to do it with the MPL agg back-end, but I think you
mentioned wx, and you can do it there instead. a wxImage can be
constructed from a buffer object, then saved as a PNG. You may need to
set the rgb and alpha portions separately. See the wxPython wiki and
search for "Image".

Also:

> matrix = []
> buffer = self.get_renderer().tostring_argb()
> l, h = self.GetSize()
> for ligne in xrange(h):
> matrix.append([])
> for colonne in xrange(l):
> i = 4*(ligne*h + colonne)
> pixel = buffer[i:i+4]
> matrix[-1].append(pixel)

This is a very slow way to create the numpy array!

Option a: first create an empty array:

matrix = numpy.empty((l,h,4), numpy.byte)

then fill that in. but even better:

you can build the array directly from the buffer string:

matrix = numpy.fromstring(buffer, dtype=numpy.byte)
lotlib-users

--
Christopher Barker, Ph.D.
Oceanographer

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

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] adding a box (domain) on a basemap map

2008-05-07 Thread Nicolas
Hi all

sorry for posting this question that might have been answered before, but
I'm in the urgent need of finding a way to overlay a rectangular box on a
basemap map (cylindrical projection) given the latitudes and longitudes of
the domain. This is to delineate on a map the domain over which a index has
been computed ...

any quick answer welcome

thanks

-- 
_/\/¯¯\/\_ 33º49'45.24"S & 18º28'45.60"E
Dr. Nicolas Fauchereau
post-doctoral fellow
Oceanography Dept.
University of Cape-Town
Private Bag. 7701 Rondebosh
Tel: 021 650 53 15
South Africa
_/\/¯¯\/\_ 33º49'45.24"S & 18º28'45.60"E
-
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] [Patch] Patch for fontmanager crash

2013-07-18 Thread Nicolas Mailhot
Le Mer 17 juillet 2013 15:04, Michael Droettboom a écrit :
> This patch doesn't make a whole lot of sense to me.  get_name should
> work just fine if self._family is None, and indeed it does in my own
> testing:
>
> ```
> from matplotlib import font_manager
>
> f = font_manager.FontProperties(None)
> print f._family
> print f.get_family()
> print f.get_name()
> ```
>
> So I'd much prefer to get to the bottom of the root cause of this
> problem than patch it unnecessarily in this way.  Any idea what that is?

I haven't the faintest idea. The function seems to be called with a "None"
font, and then it crashes. As it's executed under a Linux system it uses
the fontconfig backend with cairo. The call only occurs when matplotlib is
fed more data than can be isolated in an simple example

Attaching the only patches Fedora/Red Hat applied before the build :

Patch0: %{name}-noagg.patch
Patch1: %{name}-tk.patch
# http://sourceforge.net/mailarchive/message.php?msg_id=30202451
# https://github.com/matplotlib/matplotlib/pull/1666
# https://bugzilla.redhat.com/show_bug.cgi?id=896182
Patch2: %{name}-fontconfig.patch

[…]

# Remove bundled libraries
rm -r agg24 lib/matplotlib/pyparsing_py?.py

# Remove references to bundled libraries
%patch0 -p1 -b .noagg
sed -i -e s/matplotlib\.pyparsing_py./pyparsing/g lib/matplotlib/*.py

# Correct tcl/tk detection
%patch1 -p1 -b .tk
sed -i -e 's|@@libdir@@|%{_libdir}|' setupext.py

# Use fontconfig by default
%patch2 -p1 -b .fontconfig

Regards,

-- 
Nicolas Mailhot

python-matplotlib-fontconfig.patch
Description: Binary data


python-matplotlib-noagg.patch
Description: Binary data


python-matplotlib-tk.patch
Description: Binary data
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [Patch] Patch for fontmanager crash

2013-07-19 Thread Nicolas Mailhot

Le Jeu 18 juillet 2013 14:12, Nicolas Mailhot a écrit :
> Le Mer 17 juillet 2013 15:04, Michael Droettboom a écrit :
>> This patch doesn't make a whole lot of sense to me.  get_name should
>> work just fine if self._family is None, and indeed it does in my own
>> testing:
>>
>> ```
>> from matplotlib import font_manager
>>
>> f = font_manager.FontProperties(None)
>> print f._family
>> print f.get_family()
>> print f.get_name()
>> ```
>>
>> So I'd much prefer to get to the bottom of the root cause of this
>> problem than patch it unnecessarily in this way.  Any idea what that is?
>
> I haven't the faintest idea. The function seems to be called with a "None"
> font, and then it crashes. As it's executed under a Linux system it uses
> the fontconfig backend with cairo. The call only occurs when matplotlib is
> fed more data than can be isolated in an simple example
>
> Attaching the only patches Fedora/Red Hat applied before the build :
>
> Patch0: %{name}-noagg.patch
> Patch1: %{name}-tk.patch
> # http://sourceforge.net/mailarchive/message.php?msg_id=30202451
> # https://github.com/matplotlib/matplotlib/pull/1666
> # https://bugzilla.redhat.com/show_bug.cgi?id=896182
> Patch2: %{name}-fontconfig.patch
>
> […]
>
> # Remove bundled libraries
> rm -r agg24 lib/matplotlib/pyparsing_py?.py
>
> # Remove references to bundled libraries
> %patch0 -p1 -b .noagg
> sed -i -e s/matplotlib\.pyparsing_py./pyparsing/g lib/matplotlib/*.py
>
> # Correct tcl/tk detection
> %patch1 -p1 -b .tk
> sed -i -e 's|@@libdir@@|%{_libdir}|' setupext.py
>
> # Use fontconfig by default
> %patch2 -p1 -b .fontconfig

BTW if you have some code to add to the crashing function to identify
what's wrong, I can reproduce the crash at will (though the processing
before crash time is rather long)

Regards,

-- 
Nicolas Mailhot


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Graph ticks label missing !

2013-07-19 Thread Nicolas Mailhot
Le Mer 17 juillet 2013 14:56, Michael Droettboom a écrit :
> Can you please provide a completely standalone example?  The following
> code has undefined variables etc.

Here it is, I'm afraid this testcase intent is less clear than what I
pasted previously (I replaced variables with precomputed values)

As shown in the attached png, the bottom tick labels (month names) are
missing. It worked in matplotlib ≤ 1.2.0

-- 
Nicolas Mailhot

testcase.py
Description: Binary data
<>--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Graph ticks label missing !

2013-08-26 Thread Nicolas Mailhot

Le Ven 19 juillet 2013 17:47, Nicolas Mailhot a écrit :
> Le Mer 17 juillet 2013 14:56, Michael Droettboom a écrit :

Hi,

>> Can you please provide a completely standalone example?  The following
>> code has undefined variables etc.
>
> Here it is, I'm afraid this testcase intent is less clear than what I
> pasted previously (I replaced variables with precomputed values)
>
> As shown in the attached png, the bottom tick labels (month names) are
> missing. It worked in matplotlib ≤ 1.2.0

Can you confirm the example was good enough for identifying the problem or
did I forget something again?

Regards,

-- 
Nicolas Mailhot


--
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=48897511&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Graph ticks label missing !

2013-08-27 Thread Nicolas Mailhot

Le Lun 26 août 2013 18:21, Goyo a écrit :
> 2013/7/19 Nicolas Mailhot :
>> Le Mer 17 juillet 2013 14:56, Michael Droettboom a écrit :
>>> Can you please provide a completely standalone example?  The following
>>> code has undefined variables etc.
>>
>> Here it is, I'm afraid this testcase intent is less clear than what I
>> pasted previously (I replaced variables with precomputed values)
>>
>> As shown in the attached png, the bottom tick labels (month names) are
>> missing. It worked in matplotlib ≤ 1.2.0
>
> I can confirm the issue with 1.2.1 but it works with a recent
> development version (output attached) so it must have been fixed at
> some point.

Thank you very much for the data point, I'll try to get 1.3.0 built on RHEL 6

Regards,

-- 
Nicolas Mailhot


--
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=48897511&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Choosing optimal figure width/height automatically

2013-10-17 Thread Nicolas Rougier

Would something like this suit your needs ?

import matplotlib.pyplot as plt

# Image size
width,height = 640,480

# Pixel border around image
border = 1

dpi = 72.0
figsize= (width+2*border)/float(dpi), (height+2*border)/float(dpi)
fig = plt.figure(figsize=figsize, dpi=dpi, facecolor="white")
hpixel = 1.0/(width+2*border)
vpixel = 1.0/(height+2*border)
ax = fig.add_axes([border*hpixel, border*vpixel,
  1-2*border*hpixel, 1-2*border*vpixel])

ax.set_xlim(0, width)
ax.set_ylim(0, height)
plt.show()




Nicolas


On Oct 17, 2013, at 4:16 PM, Christoph Groth  wrote:

> Benjamin Root writes:
> 
>> I particularly like using the figaspect() function:
>> 
>> (...)
>> 
>> It isn't perfect, but for its simplicity, it gets it mostly right.
> 
> Thanks, Benjamin, for your quick reply.
> 
> Unfortunately, figaspect is only an approximate solution, as it simply
> uses the aspect ration of the image for the whole figure (with axes and
> labels).
> 
> I wonder how difficult it would be to teach matplotlib to tightly fit
> the axes around an image, and, ideally, output the figure cropped.
> 
> 
> --
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 1. twinx and grid (garyr)

2014-02-09 Thread Nicolas Fauchereau
Hi Gary 

To get more control on which grid shows / doesn't, you can do:

ax1.grid('on')
ax2.grid('off') 

instead of: 

plt.grid()

Nico 

On 9/02/2014, at 5:34 pm, matplotlib-users-requ...@lists.sourceforge.net wrote:

> Message: 1
> Date: Sat, 8 Feb 2014 17:29:16 -0800
> From: "garyr" 
> Subject: [Matplotlib-users] twinx and grid
> To: 
> Message-ID: <4ADC6E5C7E0B41E48913F2C42408B5E6@owner59bf8d40c>
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
>   reply-type=original
> 
> The script below labels both the left and right x-axes and shows a grid. Is
> there a way to force the horizontal grid lines to line up with the tic marks 
> on
> the left axis (ax1)?
> 
> import numpy as np
> import matplotlib.pyplot as plt
> fig = plt.figure()
> ax1 = fig.add_subplot(111)
> t = np.arange(0.01, 10.0, 0.01)
> s1 = np.exp(t)
> ax1.plot(t, s1, 'b-')
> ax2 = ax1.twinx()
> s2 = np.sin(2*np.pi*t)
> ax2.plot(t, s2, 'r')
> plt.grid()
> plt.show()
> 
> 

--
Dr. Nicolas Fauchereau
Climate Scientist – National Climate Centre
National Institute of Water and Atmospheric Research (NIWA) Ltd.
41 Market Place
Viaduct Precinct, Auckland
NEW ZEALAND
Tel: +64 (0)9 375 2053



--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib for tiles - blank lines

2014-03-24 Thread Nicolas Rougier


If you do not draw at all (no pcolor call), do you still get transparent colors 
?
If yes, what is your .matplotlibrc ?


Nicolas


On 24 Mar 2014, at 11:49, Jesper Larsen  wrote:

> Thanks Pierre,
> 
> from __future__ import division did not help me, I am using mpl 1.1.1rc. I 
> will try upgrading to a newer version of mpl and report back whether that 
> helps. My output is:
> 
> [(511, (255, 255, 255, 0)), (65025, (0, 0, 128, 255))]
> 
> Best regards,
> Jesper
> 
> 
> 
> 2014-03-24 11:27 GMT+01:00 Pierre Haessig :
> Hi,
> 
> Le 24/03/2014 10:45, Jesper Larsen a écrit :
> > I am using matplotlib to produce plots (tiles) in a Web Map Service.
> > Unfortunately I cannot get Matplotlib to plot on the entire image.
> > There are one transparent (pixel) line at the bottom and one
> > transparent line at the right. This is of course a problem when the
> > tiles are shown in a map. Please see example below. Can anyone see
> > what I am doing wrong?
> I've run your code and got no transparent pixels.
> 
> print im.getcolors()
> [(65536, (0, 0, 128, 255))]
> 
> I also tried with __future__ division to see if there was something with
> figsize = w/dpi, h/dpi, but got the same output
> 
> best,
> Pierre
> 
> (python 2.7 on Linux, mpl 1.3.1)
> 
> 
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] creating colors for many plots

2014-05-08 Thread Nicolas Rougier


A colormap can be called like a function to get the colors associated to 
(normalized) values. In your example, it is called with uniformly spaced values 
(linspace) between 0 and 1. This should return the corresponding colors.

print plt.get_cmap('gray')(0.0)
(0.0, 0.0, 0.0, 1.0)

print plt.get_cmap('gray')(1.0)
(1.0, 1.0, 1.0, 1.0)

print plt.get_cmap('gray')(np.linspace(0,1,6))
[[ 0.   0.   0.   1. ]
 [ 0.2  0.2  0.2  1. ]
 [ 0.4  0.4  0.4  1. ]
 [ 0.6  0.6  0.6  1. ]
 [ 0.8  0.8  0.8  1. ]
 [ 1.   1.   1.   1. ]]


Nicolas


On 08 May 2014, at 11:41, MaxMax  wrote:

> i have found a solution for creating colors for many plots at this page:
> http://stackoverflow.com/questions/7513262/matplotlib-large-set-of-colors-for-plots
> 
> what does this the following line do?
> colors = plt.get_cmap('jet')(np.linspace(0, 1.0, len(kinds)))
> 
> plt.get_cmap('jet') gets a LinearSegmentedColormap object and np.linspace
> creates a ndarray
> but what happens because of this instruction?
> 
> 
> 
> --
> View this message in context: 
> http://matplotlib.1069221.n5.nabble.com/creating-colors-for-many-plots-tp43381.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
> 
> --
> Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3D Bar (histogram) question

2009-07-07 Thread Nicolas Bigaouette
Hi,

I compiled matplotlib svn revision 7246 yesterday to try the 3D stuff.

>From mpl's website, an example for 3D bar plotting is shown[1]. I just don't
understand the axes. From the code, shouldn't X values go from 0 to 20,
instead of 0 to 400 000 like shown on the graph? Where does these values for
the X and Z axes comes from (in the graph)?

I'm trying my own 3D bar plot, with similar "weird" results.

Could it be a bug?

Thanx a lot.

[1] http://matplotlib.sourceforge.net/examples/mplot3d/bars3d_demo.html
--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to get ticks "out" using mpl_toolkits.axes_grid.axislines ?

2009-07-23 Thread Nicolas Pinto
Hello,

I'm trying to get the ticks "out" in the following scripts using matplotlib
svn version. Any reason why it's not working ? Should I dig deeper in
mpl_toolkits ?

# -- Script 1
# modified from
http://matplotlib.sourceforge.net/examples/axes_grid/simple_axisline3.html
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.axislines import Subplot

plt.rc("xtick", direction="out")
plt.rc("ytick", direction="out")

fig = plt.figure(1, (3,3))

ax = Subplot(fig, 111)
fig.add_subplot(ax)

ax.axis["right"].set_visible(False)
ax.axis["top"].set_visible(False)

plt.show()

# -- EOF

# -- Script 2
# modified from
http://matplotlib.sourceforge.net/examples/axes_grid/simple_axisline2.html

import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.axislines import SubplotZero
import numpy as np

*plt.rc("xtick", direction="out")
plt.rc("ytick", direction="out")
*
fig = plt.figure(1, (4,3))

# a subplot with two additiona axis, "xzero" and "yzero". "xzero" is
# y=0 line, and "yzero" is x=0 line.
ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)

# make xzero axis (horizontal axis line through y=0) visible.
ax.axis["xzero"].set_visible(True)
ax.axis["xzero"].label.set_text("Axis Zero")

# make other axis (bottom, top, right) invisible.
for n in ["bottom", "top", "right"]:
ax.axis[n].set_visible(False)

xx = np.arange(0, 2*np.pi, 0.01)
ax.plot(xx, np.sin(xx))

plt.show()

# -- EOF

Thanks for your help.

Best regards,

-- 
Nicolas Pinto
Ph.D. Candidate, Brain & Computer Sciences
Massachusetts Institute of Technology, USA
http://web.mit.edu/pinto
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to get ticks "out" using mpl_toolkits.axes_grid.axislines ?

2009-07-23 Thread Nicolas Pinto
Thanks Jae-Joon, it's working now. And thanks for pointing me to "spine",
that's exactly what I was looking for!

Cheers,

N

On Thu, Jul 23, 2009 at 6:40 PM, Jae-Joon Lee  wrote:

> Hi,
>
> Thanks for reporting this.
> The axes class in axes_grid toolkits uses different artists to render
> ticks and ticklabels. And some of the features in the original
> matplotlib won't work correctly, and the "tick direction" turned out
> to be one of them.
>
> However, I just committed a fix for this to the svn (r7292), so it
> should work now.
> So, please install mpl from the current svn again, and test it.
> Unfortunately, while the ticks are rotated, the pad for tick labels
> are not automatically adjusted.
> Therefore, you may want to adjust it manually. e.g.,
>
> ax.axis["left"].major_tick_pad = 10
>
> I'll try to improve this in the future.
>
> On the other hand, you may take a look at the recently added "spine"
> support in the main matplotlib.
>
>
> http://matplotlib.sourceforge.net/examples/pylab_examples/spine_placement_demo.html
>
> If you use spine, than all the ticks & ticklabels feature in mpl will work.
>
> Regards,
>
> -JJ
>
>
> On Thu, Jul 23, 2009 at 3:23 PM, Nicolas Pinto
> wrote:
> > Hello,
> >
> > I'm trying to get the ticks "out" in the following scripts using
> matplotlib
> > svn version. Any reason why it's not working ? Should I dig deeper in
> > mpl_toolkits ?
> >
> > # -- Script 1
> > # modified from
> >
> http://matplotlib.sourceforge.net/examples/axes_grid/simple_axisline3.html
> > import matplotlib.pyplot as plt
> > from mpl_toolkits.axes_grid.axislines import Subplot
> >
> > plt.rc("xtick", direction="out")
> > plt.rc("ytick", direction="out")
> >
> > fig = plt.figure(1, (3,3))
> >
> > ax = Subplot(fig, 111)
> > fig.add_subplot(ax)
> >
> > ax.axis["right"].set_visible(False)
> > ax.axis["top"].set_visible(False)
> >
> > plt.show()
> >
> > # -- EOF
> >
> > # -- Script 2
> > # modified from
> >
> http://matplotlib.sourceforge.net/examples/axes_grid/simple_axisline2.html
> >
> > import matplotlib.pyplot as plt
> > from mpl_toolkits.axes_grid.axislines import SubplotZero
> > import numpy as np
> >
> > plt.rc("xtick", direction="out")
> > plt.rc("ytick", direction="out")
> >
> > fig = plt.figure(1, (4,3))
> >
> > # a subplot with two additiona axis, "xzero" and "yzero". "xzero" is
> > # y=0 line, and "yzero" is x=0 line.
> > ax = SubplotZero(fig, 1, 1, 1)
> > fig.add_subplot(ax)
> >
> > # make xzero axis (horizontal axis line through y=0) visible.
> > ax.axis["xzero"].set_visible(True)
> > ax.axis["xzero"].label.set_text("Axis Zero")
> >
> > # make other axis (bottom, top, right) invisible.
> > for n in ["bottom", "top", "right"]:
> > ax.axis[n].set_visible(False)
> >
> > xx = np.arange(0, 2*np.pi, 0.01)
> > ax.plot(xx, np.sin(xx))
> >
> > plt.show()
> >
> > # -- EOF
> >
> > Thanks for your help.
> >
> > Best regards,
> >
> > --
> > Nicolas Pinto
> > Ph.D. Candidate, Brain & Computer Sciences
> > Massachusetts Institute of Technology, USA
> > http://web.mit.edu/pinto
> >
> >
> --
> >
> > ___
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> >
>



-- 
Nicolas Pinto
Ph.D. Candidate, Brain & Computer Sciences
Massachusetts Institute of Technology, USA
http://web.mit.edu/pinto
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Using spines and set_yscale

2009-08-04 Thread Nicolas Pinto
Hello,

In the following code (using matplotlib svn), I'm trying to set the left
(log) axis "outward" using spines. Subplots 222 and 223 have "weird"
behaviors. Am I using the API incorrectly? I got it to work by calling
ax.set_yscale('log') twice (subplot 224). Where should I start if I want to
contribute a patch?

import matplotlib.pyplot as plt

plt.rcParams["xtick.direction"] = "out"
plt.rcParams["ytick.direction"] = "out"

x = [.5, 111,68, 192, 340, 325]

fig = plt.figure()

ax = fig.add_subplot(221)
ax.set_yscale('log')
ax.bar(range(len(x)), x, align='center')

ax = fig.add_subplot(222)
ax.set_yscale('log')
ax.bar(range(len(x)), x, align='center')
ax.spines["left"].set_position(("outward", 10))

ax = fig.add_subplot(223)
ax.bar(range(len(x)), x, align='center')
ax.spines["left"].set_position(("outward", 10))
ax.set_yscale('log')

ax = fig.add_subplot(224)
ax.set_yscale('log')
ax.bar(range(len(x)), x, align='center')
ax.spines["left"].set_position(("outward", 10))
ax.set_yscale('log')

plt.show()
# EOF

Thanks for your help.

Best regards,

-- 
Nicolas Pinto
Ph.D. Candidate, Brain & Computer Sciences
Massachusetts Institute of Technology, USA
http://web.mit.edu/pinto
--
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] FYI, typo

2009-08-21 Thread Nicolas Pinto
Hey guys,

I found another typo here:

http://matplotlib.sourceforge.net/api/axes_api.html?highlight=legend#matplotlib.axes.Axes.get_legend_handles_labels

-equibalent
+equivalent

Cheers,

N

On Fri, Aug 21, 2009 at 8:29 PM, marc desmarais  wrote:

> This sentence is missing "to" or "and" I think:
>
> "These helper methods will take your data (eg. numpy arrays and strings)
> create primitive ...
>
> Is in at http://matplotlib.sourceforge.net/users/artists.html
>
> Marc Desmarais
> Long Beach, CA
>
>
>
> --
> 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
>
>


-- 
Nicolas Pinto
Ph.D. Candidate, Brain & Computer Sciences
Massachusetts Institute of Technology, USA
http://web.mit.edu/pinto
--
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] mplot3D plot_surface colors

2009-08-26 Thread Nicolas Bigaouette
Its great news that the 3D is receiving more polish :)

After reading on wikipedia, wouldn't it be nicier to have Phong
reflection[1] instead of Gouraud?

Maybe it would be too hard, as the Gouraud seems to be implemented directly
in Agg (from what others just said...)

Anyway, just a suggestion ;)


[1] http://en.wikipedia.org/wiki/Phong_reflection_model


2009/8/26 Eric Firing 

> Reinier Heeres wrote:
> > Hi JJ,
> >
> > Thanks for the examples! I indeed suspected the anti-aliasing as well.
> > I'll include an option for linecolors = facecolors soon (probably this
> > weekend); it seems to be a good solution.
>
> No, not in general.  There are two problems: it distorts the sizes and
> positions of the patches, very slightly, but enough that it might be a
> problem in some applications; and it does not work with alpha != 1.
>
> Eric
>
>
> --
> 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
>
--
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] how to update plots fast

2009-09-02 Thread Nicolas Bigaouette
Have you read these?
http://www.scipy.org/Cookbook/Matplotlib/Animations
http://matplotlib.sourceforge.net/examples/animation/index.html?highlight=animation

What I normally do is plot everything (forget about interactive mode, its
just too slow) and get handles to curves, then update the curves values.
With this you don't need to redraw _everything_ each time you add a new
element.

I remember reading a page about animation and backends, but I can't find it
anymore, maybe the previous links can help you.

Good luck


2009/9/2 RazAlon 

>
> Hi,
>
> I wish to have several (about 3) plots which are updated about once per
> second, as part of some application that's monitoring an instrument.
>
> I set pyplot to interactive mode. I create as many figures as I need, and
> then I simply plot to them whenever I have new data coming in (each time I
> plot a new x and y vectors, I don't know if it's possible just to append
> data points to existing plots).
>
> I work on windows xp with the default matplotlib settings.
>
> This procedure is very slow. The plots take ages to update.
>
> Is there a faster way to do that?
>
> Thank you,
> Raz
>
>
>
> --
> View this message in context:
> http://www.nabble.com/how-to-update-plots-fast-tp25252745p25252745.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
>
> --
> 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
>
--
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] Fwd: best format for MS word?

2009-09-03 Thread Nicolas Bigaouette
I'm sure everybody find this really sad... If he wants control over the
ploting capabilities, then why not have matplotlib and send him the script?I
know when I switched to matplotlib from matlab I wanted to be able to edit
directly the graph with point and click, but sometimes it is more powerful
or even easier to edit the script.

If the changes are really small, you could always send him an SVG that he
edits in Inkscape. I do that sometimes.

There might be other open source plotting packages which are WYSIWYG, like
qtiplot. Please, please! don't go with excel ;) Its quality is so much lower
then any other software.


2009/9/3 Shixin Zeng 

> Forgot CC list.
>
> Thanks for your helps.
>
> Best Regards
>
> Shixin Zeng
>
>
>
>
> -- Forwarded message --
> From: Shixin Zeng 
> Date: Wed, Sep 2, 2009 at 11:02 PM
> Subject: Re: [Matplotlib-users] best format for MS word?
> To: Stan West 
>
>
> On Wed, Sep 2, 2009 at 8:59 PM, Stan West wrote:
> >> -Original Message-
> >> From: Shixin Zeng [mailto:zeng.shi...@gmail.com]
> >> Sent: Wednesday, September 02, 2009 16:11
> >>
> >> While for embeding eps files in word, I've just tried that. MS word
> >> 2007 seems to have some problem on this. See the attached eps
> >> file produced from matplotlib. In MS word 2007, the labels
> >> and titles of axes are gone, even on the printed version of
> >> the word file. It's there when I view/print it with gsview.
> >
> > I don't have Word 2007, but I imported your file into Word 2003 and saw
> that
> > the titles and labels were missing.  I would blame that on shortcomings
> of the
> > Word PS engine.  When I printed to a non-PostScript printer, the titles
> and
> > labels were missing as in your test; that doesn't surprise me, because
> the
> > Word PS engine would be used to render for a non-PS printer.  However,
> when I
> > printed to PostScript devices (the Adobe PDF driver and the PDFCreator
> > driver), the titles and text were present; Word shouldn't invoke its PS
> engine
> > when the printer understands PS.  Is there any chance that you were using
> a
> > non-PS printer, or that your printer has two or more modes (like the
> > Hewlett-Packard models that automatically switch between PCL and PS) and
> you
> > were not using a PS driver?  How about testing with PDFCreator?
> >
> >
> I'm not sure if my printer supports PS or not, it's Dell Laser 1320c,
> I couldn't find any information from its property page.
>
> I'm afraid that I'm giving up matplotlib for my paper plotting, since
> my professor wants me to do plotting with excel such that he doesn't
> have to ask me to do every small change on the plot if he could do it
> himself.
>
>
> --
> 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
>
--
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] making quicktime animations from linux

2009-09-03 Thread Nicolas Bigaouette
I produce all my movies in Ogg container + Theora compression. I use
ffmpeg2theora for that, available on all platforms:ffmpeg2theora --nosound
--optimize --width 1024 --height 768 --inputfps=15 --aspect 4:3
png/mov%04d.png -o movie.ogv

2009/9/3 Andrew Straw 

> I use::
>
>  ffmpeg -r 60 -i frame%05d.png -vcodec wmv2 -b 2000k out.avi
>
> And this works well to generate movies that play on Windows, Mac and
> Linux. As a bonus, these movies can be included in Latex/Beamer output
> using the movies15 package and played within the PDF via Adobe Reader on
> Mac and Windows. (I'm sure it's just a matter of time before the linux
> PDF readers can do this, too.) Finally I feel I am near a an end to my
> cross-platform, doesn't-suck presentation-with-movies quest. I only wish
> the movie format required to make this possible was less license and
> patent encumbered...
>
> I have been encoding on Ubuntu Jaunty with libraries from mediabuntu. I
> haven't tested the above using the plain Ubuntu ffmpeg yet.
>
> -Andrew
>
> Philip Austin wrote:
> > This isn't strictly a matplotlib question, but I'm hoping
> > dual mac/linux users can provide some advice on converting png
> > files to quicktime movies using mencoder on Ubuntu or Centos.
> > So far I've found that
> >
> > 1) starting with
> > http://matplotlib.sourceforge.net/examples/animation/movie_demo.html
> > using
> >
> > mencoder mf://*.png -mf type=png:w=800:h=600:fps=25\
> > -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi
> >
> > produces an avi file that works with Ubuntu/mplayer, but
> > fails with Windows Media Player.
> >
> > 2) changing the codec based on
> http://pymolwiki.org/index.php/Making_Movies
> >
> > mencoder -mc 0 -noskip -skiplimit 0 -ovc lavc -lavcopts
> > vcodec=msmpeg4v2:vhq "mf://*.png" -mf type=png:fps=18 -o output.avi
> >
> > works with mplayer and windows media player, but won't play
> > on macs (unless they install vlc).
> > When I try to convert the avi file to quicktime using
> >
> >> h264enc -2p -p qt
> >>
> > and accepting all defaults
> > it makes it through both passes, gets to
> > "converting avi file to mp4 container"
> > and exits the "-> Failed!"
> >
> > Any pointers appreciated.  I'm open to  any linux based
> > solution that produces animations
> > that can be be viewed on all three platforms  -- thanks, Phil
> >
> >
> >
> >
> >
> --
> > 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
> >
>
>
>
> --
> 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
>
--
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


[Matplotlib-users] funny bug with greek letters

2009-09-04 Thread Nicolas Chopin
  Hi list,
when I do:
hist(randn(100)); xlabel('$\gamma$')
things work as expected.
However, if I try:
hist(randn(100)); xlabel('$\beta$')
then either I get an error, or I get the label "eta" under the plot.
Other letters seem to trigger this: tau, alpha, rho, maybe others.
This problems wether text.usetex is set to True or not (in matplolibrc file).

Version: 0.98.5.2 (Ubuntu Jaunty, ipython 0.9.1 shell).

Has anyone had the same problem, and is there any fix?
Sorry if this has been reported before, I tried to find it, but
nothing came out.

Thanks in advance

-- 
________
Nicolas Chopin
ENSAE
3, Avenue Pierre Larousse
92245 Malakoff CEDEX
FRANCE
tel +33 1 41 17 65 22 | fax +33 1 41 17 38 52
http://www.crest.fr/pageperso/Nicolas.Chopin/Nicolas.Chopin.htm

--
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] funny bug with greek letters

2009-09-05 Thread Nicolas Chopin
thanks a lot! I did not know about raw strings, sorry, even Python has
its black corners, I guess.
funny \gamma works, though.
On a related note, usetex=True is fancy, but produce much bigger eps
files for me, so I stick with the standard mathtex rendering.
Thanks again
Nicolas


2009/9/4 Nicolas Chopin :
>  Hi list,
> when I do:
> hist(randn(100)); xlabel('$\gamma$')
> things work as expected.
> However, if I try:
> hist(randn(100)); xlabel('$\beta$')
> then either I get an error, or I get the label "eta" under the plot.
> Other letters seem to trigger this: tau, alpha, rho, maybe others.
> This problems wether text.usetex is set to True or not (in matplolibrc file).
>
> Version: 0.98.5.2 (Ubuntu Jaunty, ipython 0.9.1 shell).
>
> Has anyone had the same problem, and is there any fix?
> Sorry if this has been reported before, I tried to find it, but
> nothing came out.
>
> Thanks in advance
>
> --
> 
> Nicolas Chopin
> ENSAE
> 3, Avenue Pierre Larousse
> 92245 Malakoff CEDEX
> FRANCE
> tel +33 1 41 17 65 22 | fax +33 1 41 17 38 52
> http://www.crest.fr/pageperso/Nicolas.Chopin/Nicolas.Chopin.htm
>



-- 

Nicolas Chopin
ENSAE
3, Avenue Pierre Larousse
92245 Malakoff CEDEX
FRANCE
tel +33 1 41 17 65 22 | fax +33 1 41 17 38 52
http://www.crest.fr/pageperso/Nicolas.Chopin/Nicolas.Chopin.htm

--
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] making quicktime animations from linux -- summary

2009-09-05 Thread Nicolas Bigaouette
Thats good information to have gathered! It sure will be usefull.
Have you look into the new html5's video tag? You can directly embed ogg in
a page, without flash or any other plugin. Firefox 3.5 supports that, I
think Safari would work too.
See this page for information (and look up the source)
http://www.mozilla.com/en-US/firefox/video/

2009/9/5 Jouni K. Seppänen 

> Phil Austin  writes:
>
> > http://clouds.eos.ubc.ca/~phil/video/samples/movie.ogv
> > size: 0.33 Mbytes (!)
> > note: we followed the install instructions at
> > http://www.theora.org/downloads/
> >but Safari didn't recognize the ogv suffix, and didn't
> >offer to associate it with a player
>
> Your web server claims this to be a text file:
> Content-Type: text/plain; charset=UTF-8
>
> If you put something like
> AddType video/ogg .ogv
> in a relevant Apache configuration file, browsers may have a better
> chance of identifying the file type.
>
> --
> Jouni K. Seppänen
> http://www.iki.fi/jks
>
>
>
> --
> 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
>
--
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] mplot3d bars3d demo

2009-09-16 Thread Nicolas Bigaouette
I have reported that issue on the tracker at the end of July. You can fin
dit here:
http://sourceforge.net/tracker/?func=detail&atid=560720&aid=2830483&group_id=80706
It's supposed to be fixed in 0.99... are you sure you are using it?

I remember trying it just after the bug was closed with an svn version and
it was working. But then again I just tried it  (0.99.0) and I get the bad
behaviour... You seem not to be the only one! Maybe the issue should be
re-opened.


2009/9/16 Sammy Yu 

> Hi,
>   I've been playing around with mplotlib's 3d charting functionality.
>  I wanted to generate something similar to this example:
>
> http://matplotlib.sourceforge.net/plot_directive/mpl_examples/mplot3d/bars3d_demo.py
>
> However, the number on scales are off (see attached). It should look like
> this:
> http://matplotlib.sourceforge.net/_images/bars3d_demo.png
>
> I'm running matplotlib-0.99.0.  Is this a known issue?
>
> Thanks,
> Sammy
>
>
> --
> Come build with us! The BlackBerry® 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-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Come build with us! The BlackBerry® 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-12, 2009. Register now!
http://p.sf.net/sfu/devconf___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] glumpy: fast OpenGL numpy visualization + matplotlib integration

2009-09-28 Thread Nicolas Rougier

Hi all,

glumpy is a fast OpenGL visualization tool for numpy arrays coded on  
top of pyglet (http://www.pyglet.org/). The package contains many  
demos showing basic usage as well as integration with matplotlib. As a  
reference, the animation script available from matplotlib distribution  
runs at around 500 fps using glumpy instead of 30 fps on my machine.

Package/screenshots/explanations at: 
http://www.loria.fr/~rougier/coding/glumpy.html
(it does not require installation so you can run demos from within the  
glumpy directory).


Nicolas

--
Come build with us! The BlackBerry® 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-12, 2009. Register now!
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] [Numpy-discussion] glumpy: fast OpenGL numpy visualization + matplotlib integration

2009-09-28 Thread Nicolas Rougier



Well, I've been starting working on a pyglet backend but it is  
currently painfully slow mainly because I do not know enough of the  
matplotlib internal machinery to really benefit from it. In the case  
of glumpy, the use of texture object for representing 2d arrays is a  
real speed boost since interpolation/colormap/heightmap is made on the  
GPU.


Concerning matplotlib examples, the use of glumpy should be actually  
two lines of code:


from pylab import *
from glumpy import imshow, show

but I did not package it this way yet (that is easy however).

I guess the main question is whether people are interested in glumpy  
to have a quick & dirty "debug" tool on top of matplotlib or whether  
they prefer a full fledged and fast pyglet/OpenGL backend (which is  
really harder).


Nicolas



On 28 Sep, 2009, at 18:05 , Gökhan Sever wrote:




On Mon, Sep 28, 2009 at 9:06 AM, Nicolas Rougier > wrote:


Hi all,

glumpy is a fast OpenGL visualization tool for numpy arrays coded on
top of pyglet (http://www.pyglet.org/). The package contains many
demos showing basic usage as well as integration with matplotlib. As a
reference, the animation script available from matplotlib distribution
runs at around 500 fps using glumpy instead of 30 fps on my machine.

Package/screenshots/explanations at: 
http://www.loria.fr/~rougier/coding/glumpy.html
(it does not require installation so you can run demos from within the
glumpy directory).


Nicolas
___
NumPy-Discussion mailing list
numpy-discuss...@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Hi Nicolas,

This is technically called OpenGL backend, isn't it? It is nice that  
integrates with matplotlib, however 300 hundred lines of code indeed  
a lot of lines for an ordinary user. Do you think this could be  
further integrated into matplotlib with a wrapper to simplify its  
usage?



--
Gökhan
--
Come build with us! The BlackBerry® 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-12, 2009. Register  
now!

http://p.sf.net/sfu/devconf___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Come build with us! The BlackBerry® 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-12, 2009. Register now!
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] Subplots, multiple bar3d plots + titling

2009-09-28 Thread Nicolas Bigaouette
I'm not sure its possible right now to do subplots with 3D.

As for the title, I cannot either put titles on any 3D graphs...


2009/9/28 

> Greetings,
>
> I would like to plot to make a figure with 3 subplots
> of the form (221) to (223):
>  - each subplot should show a bar3d plot of a matrix
>  - each subplot should have it's own title
>
> The problems:
>  a) I don't see (nor did i find something) how i can
>use subplots combined with bar3d (from the mpl_toolkits.mplot3d)
>package.
>
>  b) I don't manage to give the 3d bar plot a title. In the attached
>code you will see that a title is set, but it does not show
>up in the figure
>
> Could someone please help me out with these problems?
>
> Thanks,
> q
>
> -
>
> The code for the basic plot of the matrix:
>
>
> from mpl_toolkits.mplot3d import Axes3D
> import matplotlib.pyplot as plt
> from matplotlib.ticker import FixedFormatter, LinearLocator, FixedLocator
> from numpy import *
>
> psi=1/sqrt(2)*array([1, 0, 0, 1])
> rho=outer(psi,psi)
>
> fig = plt.figure()
>
> ax = Axes3D(fig)
>
> elements = (len(rho) * len(rho))
> xpos, ypos = meshgrid(array(range(len(rho)))+0.25,
> array(range(len(rho)))+0.25)
>
> xpos = xpos.flatten()
> ypos = ypos.flatten()
> zpos = zeros(elements)
>
> dx = 0.5 * ones_like(zpos)
> dy = dx.copy()
> dz = absolute(rho.flatten())
>
> ax.set_title('absolute')
>
> ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='#F8F800')
>
> plt.show()
>
>
>
>
> --
> Come build with us! The BlackBerry® 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-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Come build with us! The BlackBerry® 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-12, 2009. Register now!
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] Axes3D - size of the Z axe

2009-10-02 Thread Nicolas Bigaouette
I was looking for something similar. It seems Axes3D() takes the angle as
argument:
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d as m3d
fig = plt.figure()
ax  = m3d.Axes3D(fig, elev = 20.0, azim = 45)
in degrees.

2009/10/2 German Ocampo 

> Hello
>
> After search  in google, I found a solution changing the initial point
> of view of the plot, using a  function which control the angle and
> elevation of the initial view:
>
> ax.view_init(elevation, azimuth) and tried and works
>
> ax = Axes3D(fig)
> ax.view_init(64, -30)
>
> Question: Is it possible to include this function in the Axes3D
> documentation web page? or where I could find it in the webpage?
>
>
> http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/api.html?highlight=axes3d#module-mpl_toolkits.mplot3d.axes3d
>
> Thanks
>
> German
>
>
> On Fri, Oct 2, 2009 at 1:24 PM, German Ocampo  wrote:
> > Hello everybody
> >
> > How can I control the size of the Z axis in a 3D plot using Axes3D in
> > matplotlib?
> >
> > regards
> >
> > german
> >
>
>
> --
> Come build with us! The BlackBerry® 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-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Come build with us! The BlackBerry® 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-12, 2009. Register now!
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] mplot3d: plot_surface() and contour on grid?

2009-10-09 Thread Nicolas Bigaouette
Thanx all,
Can it be used to do a projection not only on the xoy axis but also on the
xoz and yoz?
N

2009/10/9 Andrew Straw 

> Matthias Michler wrote:
> > Hello list,
> >
> > I'm not an expert in axes3d, but in case the feature which Nicolas
> requested
> > is not possible in an easy manner up to now, I propose an additional
> kwarg
> > for axes3d.Axes3D.contour. Something like *offset*. If offset is None the
> > z-values of the contour lines corresponds to given Z and otherwise offset
> is
> > used for the z-values of the contour lines.
> > I attached a changed axes3d.py and a patch against current svn. The
> result is
> > illustrated in the contour3d_demo.png.
> >
> > Could any of the experts have a look at it and tell me if this could be
> > useful, please?
> >
> > Thanks in advance for any comments.
> >
> > Kind regards
> > Matthias
> >
> > On Wednesday 30 September 2009 19:22:42 Nicolas Bigaouette wrote:
> >
> >> Hi,
> >> I have a nice plot_surface() using mplot3d (see attachement).
> >>
> >> I'd like to project the surface on the axis xoy, xoz and yoz with a
> >> contour, similar to this figure:
> >> http://homepages.ulb.ac.be/~dgonze/INFO/matlab/fig19.jpg<http://homepages.ulb.ac.be/%7Edgonze/INFO/matlab/fig19.jpg>
> >>
> >> Is it possible using matplotlib and mplot3d?
> >>
> >> Thanx!
> >>
> >
> >
> Hi Matthias,
>
> I committed your patch to a github branch of MPL, but I'll let Reinier
> actually commit something based on this to MPL.
> http://github.com/astraw/matplotlib/tree/dev/michler-3d-contourf-offsets
>
> -Andrew
>
>
> --
> Come build with us! The BlackBerry(R) 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 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Come build with us! The BlackBerry(R) 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 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mplot3d: plot_surface() and contour on grid?

2009-12-12 Thread Nicolas Bigaouette
Wonderful! Thanx a lot ;)

2009/12/11 

> Reinier,
>
> This in incredible. Wow. Thanks for all of your hard work.
>
> Cheers,
> -paul
>
> > -Original Message-
> > From: Reinier Heeres [mailto:rein...@heeres.eu]
> > Sent: Thursday, December 10, 2009 3:37 PM
> > To: Matthias Michler
> > Cc: matplotlib-users@lists.sourceforge.net
> > Subject: Re: [Matplotlib-users] mplot3d: plot_surface() and contour on
> > grid?
> >
> > Hi,
> >
> > I just committed a patch to do this in svn, also allowing for contour
> > lines along other directions.
> >
> > See the attached image for an example.
>
>
>
> --
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Qt4Agg backend and SIGINT (ctrl+c)

2010-02-23 Thread Nicolas Bigaouette
Hi,

I cannot kill a plot by "ctrl+c" in a terminal (sending the SIGINT) when
using the Qt4Agg backend. When using GTKAgg it works fine...

What could be wrong? I need that.

Thanx!
--
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] GTK pylab console

2008-06-27 Thread Nicolas Rougier


Hi all, 

I've developed a GTK/Python/Pylab console that is able to display
most matplotlib figures directly within the console and handle
matplotlib mouse events properly.


Screenshots and sources are available at:
http://www.loria.fr/~rougier/pylab.html


I've tested several examples from matplotlib examples and they
seem to be displayed properly. Any comments/requests are welcome.


Nicolas Rougier.


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] GTK pylab console

2008-06-27 Thread Nicolas Rougier


Thanks. I've stumbled across "reinteract" and found that the inline plot
has been done using the previous version of the pylab console
(http://blog.fishsoup.net/2007/11/10/reinteract-better-interactive-python/)

Concerning ipython, I've once designed the code to integrate it but
since then I got a bit lost with the future new version of ipython
(ipython1). I will try to look again.


Nicolas


On Fri, 2008-06-27 at 09:29 -0400, Michael Droettboom wrote:
> Very nice.  I like the idea of inline plots -- less of an interrupted flow.
> 
> Have you looked at the similar project "reinteract"?  
> (www.reinteract.org)  It's a little more aggressively different, for 
> what it's worth.  The author seems to have lost steam in the last few 
> months, but it has some interesting ideas.
> 
> It would be neat to integrate ipython, rather than just the standard 
> python shell, into your console to get autocompletion, fancier help 
> etc.  I think the combination could be great.
> 
> Thanks for sharing this, and keep us updated!
> 
> Cheers,
> Mike
> 
> Nicolas Rougier wrote:
> > Hi all, 
> >
> > I've developed a GTK/Python/Pylab console that is able to display
> > most matplotlib figures directly within the console and handle
> > matplotlib mouse events properly.
> >
> >
> > Screenshots and sources are available at:
> > http://www.loria.fr/~rougier/pylab.html
> >
> >
> > I've tested several examples from matplotlib examples and they
> > seem to be displayed properly. Any comments/requests are welcome.
> >
> >
> > Nicolas Rougier.
> >
> >
> > -
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > ___
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >   
> 


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Problem with loglog and ls='steps'

2008-08-25 Thread Nicolas Champavert
Hi,

 I have a problem with the loglog function with ls='steps' (matplotlib 
version: 0.98.3). When I try to plot arrays with loglog(x,y,ls='steps'), 
nothing is drawn whereas loglog(x,y) and plot(x,y,ls='steps'):

x=[10.,20.,30.,40.,50.]
y=[0.09,0.02,0.02,0.03,0.01]
pylab.loglog(x,y) #it works
pylab.loglog(x,y,ls='steps') #nothing is drawn...
pylab.plot(x,y,ls='steps') #it works

 Is there something I can do to use loglog with ls='steps'?

thanks in advance,
Nicolas


-
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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Simple 3D support

2008-11-27 Thread Nicolas Rougier

Hi all,

I've been working lately on 3d visualization for my own need and maybe  
the result may have some interest for some of you. I know there is  
already mlab/mayavi2/vtk that does a great job, but after having spent  
a lot of time trying to install all requirements, I headed for a very  
fast, simple and dedicated solution. Currently, scigl (this is the  
name of the framework) dependencies are restricted to OpenGL,  GLUT,  
GLEW  and Boost (for python export).

You can find a beta version at http://www.loria.fr/~rougier/scigl/index.html 
  and the mandatory screenshots are available at 
http://www.loria.fr/~rougier/scigl/screenshots.html 
.


Nicolas



  

-
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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Simple 3D support

2008-11-28 Thread Nicolas Rougier


I tried installing mayavi on macos some months ago but I do not remember
exactly what were the problems. I know that I ended recompiling vtk from
sources and it did not work for some reason. The EPD bundle did not work
because (I think) of some conflicts between installed python version
(macpython and python from darwin ports) and the egg did not compile at
all. I tried today the last EPD on a fresh leopard install and it seems
to be working now.

Nicolas

On Fri, 2008-11-28 at 05:14 -0800, Lou Pecora wrote:
> This looks interesting.  What platform are you using?  How hard was the 
> installation and what problems, if any, did you run into?  And their fixes?  
> Thanks for the info.
> 
> -- Lou Pecora,   my views are my own.
> 
> 
> --- On Thu, 11/27/08, Nicolas Rougier <[EMAIL PROTECTED]> wrote:
> 
> > From: Nicolas Rougier <[EMAIL PROTECTED]>
> > Subject: [Matplotlib-users] Simple 3D support
> > To: matplotlib-users@lists.sourceforge.net
> > Date: Thursday, November 27, 2008, 3:36 PM
> > Hi all,
> > 
> > I've been working lately on 3d visualization for my own
> > need and maybe  
> > the result may have some interest for some of you. I know
> > there is  
> > already mlab/mayavi2/vtk that does a great job, but after
> > having spent  
> > a lot of time trying to install all requirements, I headed
> > for a very  
> > fast, simple and dedicated solution. Currently, scigl (this
> > is the  
> > name of the framework) dependencies are restricted to
> > OpenGL,  GLUT,  
> > GLEW  and Boost (for python export).
> > 
> > You can find a beta version at
> > http://www.loria.fr/~rougier/scigl/index.html 
> >   and the mandatory screenshots are available at
> > http://www.loria.fr/~rougier/scigl/screenshots.html 
> > .
> > 
> > 
> > Nicolas
> > 
> > 
> > 
> >   
> > 
> > -
> > 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=100&url=/
> > ___
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
>   


-
This SF.Net email is sponsored by the 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=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] fill_between a plot with gradient

2009-01-14 Thread Vergnes Nicolas
Hi all,

I'm using  plot(x,y)  and fill_between(x,y) to make a graphic flat plot

I'd like to create a fill_between with a gradient color like this
geen/yellow plot in example :
http://oss.oetiker.ch/rrdtool/gallery/fsu_predict.png
I have seen that fill_between() have cmap = , is it a good way to do ?

How to have a gradient from 0 to the y ?
Or how to have a gradient from 0 to max(y) ?

Thank you,


        Nicolas Vergnes
...


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

2009-05-28 Thread Nicolas Pourcelot

Hi,

is there any way to use Computer Modern in any text in matplotlib ?

In http://matplotlib.sourceforge.net/users/customizing.html, I read the 
following :


#font.serif  : Bitstream Vera Serif, New Century Schoolbook, Century 
Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New 
Roman, Times, Palatino, Charter, serif
#font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, 
Lucid, Arial, Helvetica, Avant Garde, sans-serif
#font.cursive: Apple Chancery, Textile, Zapf Chancery, Sand, cursive
#font.fantasy: Comic Sans MS, Chicago, Charcoal, Impact, Western, 
fantasy
#font.monospace  : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, 
Courier New, Courier, Fixed, Terminal, monospace

So, Computer Modern is not listed there.

However, Computer Modern is used in mathtext, so I suppose there is a 
way to use it also in plain text, but I can't figure it...


I tried :
/mpl.rc('font', family = 'serif', serif = 'computer modern roman')/
but it did not work.

Thanks a lot,

Nicolas P.
--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] mathtext : overrightarrow

2009-05-28 Thread Nicolas Pourcelot
Hi,

is there any way to display a big arrow on a vector using mathtext, like 
"$\overrightarrow{AB}$" ?

If not, is there any plan to implement it in a next release ?

Thanks a lot,

Nicolas P.

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mathtext : overrightarrow

2009-05-28 Thread Nicolas Pourcelot
Thanks for your answer.


Michael Droettboom a écrit :
> Handling this like an accent is trivial, and handled with the patch 
> below (which I will commit to SVN).
It is however not so much useful, since \vec does already the job.

> Handling this in such a way that the length of the arrow changes based 
> on the size of the underlying text is less straightforward and will 
> take some time to implement.
This is what I meant, yes.
Hope you will success, I miss it quite a lot for now.

Thanks again,

Nicolas

> Cheers,
> Mike
>
> Index: lib/matplotlib/mathtext.py
> ===
> --- lib/matplotlib/mathtext.py(revision 7148)
> +++ lib/matplotlib/mathtext.py(working copy)
> @@ -2445,7 +2445,9 @@
> r"'" : r'\combiningacuteaccent',
> r'~' : r'\combiningtilde',
> r'.' : r'\combiningdotabove',
> -r'^' : r'\circumflexaccent'
> +r'^' : r'\circumflexaccent',
> +    r'overrightarrow' : r'\rightarrow',
> +r'overleftarrow'  : r'\leftarrow'
> }
>
> _wide_accents = set(r"widehat widetilde".split())
>
> Nicolas Pourcelot wrote:
>> Hi,
>>
>> is there any way to display a big arrow on a vector using mathtext, 
>> like "$\overrightarrow{AB}$" ?
>>
>> If not, is there any plan to implement it in a next release ?
>>
>> Thanks a lot,
>>
>> Nicolas P.
>>
>> --
>>  
>>
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
>> is a gathering of tech-side developers & brand creativity 
>> professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, 
>> & iPhoneDevCamp as they present alongside digital heavyweights like 
>> Barbarian Group, R/GA, & Big Spaceship. 
>> http://p.sf.net/sfu/creativitycat-com 
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>   
>

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] computer modern

2009-05-29 Thread Nicolas Pourcelot
Thanks, it works well.

However, I forgot that computer modern does not include accented 
characters (unlike latin modern), so I eventually used Stix :

mpl.rc('font', family = 'serif', serif = 'STIXGeneral')

By the way, is there any way to use Stix for sans-serif as well, or even 
cursive and monospace ? I don't know how to do that, since Stix seems to 
contain all of them in a single file (STIXGeneral.ttf) ?

Nicolas


Michael Droettboom a écrit :
> The name of the Computer Modern Roman font that ships with matplotlib 
> is "cmr10", so
>
>   mpl.rc('font', family = 'serif', serif = 'cmr10')
>
> should work.
>
> Mike
>
> Nicolas Pourcelot wrote:
>> Hi,
>>
>> is there any way to use Computer Modern in any text in matplotlib ?
>>
>> In http://matplotlib.sourceforge.net/users/customizing.html, I read 
>> the following :
>>
>> #font.serif  : Bitstream Vera Serif, New Century Schoolbook, 
>> Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 
>> L, Times New Roman, Times, Palatino, Charter, serif
>> #font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, 
>> Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
>> #font.cursive: Apple Chancery, Textile, Zapf Chancery, Sand, 
>> cursive
>> #font.fantasy: Comic Sans MS, Chicago, Charcoal, Impact, 
>> Western, fantasy
>> #font.monospace  : Bitstream Vera Sans Mono, Andale Mono, Nimbus 
>> Mono L, Courier New, Courier, Fixed, Terminal, monospace
>>   So, Computer Modern is not listed there.
>>
>> However, Computer Modern is used in mathtext, so I suppose there is a 
>> way to use it also in plain text, but I can't figure it...
>>
>> I tried :
>> /mpl.rc('font', family = 'serif', serif = 'computer modern roman')/
>> but it did not work.
>>
>> Thanks a lot,
>>
>> Nicolas P.
>> 
>>
>> --
>>  
>>
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
>> is a gathering of tech-side developers & brand creativity 
>> professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, 
>> & iPhoneDevCamp as they present alongside digital heavyweights like 
>> Barbarian Group, R/GA, & Big Spaceship. 
>> http://p.sf.net/sfu/creativitycat-com 
>> 
>>
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>   
>

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Vertical and horizontal lines width

2009-06-03 Thread Nicolas Pourcelot

Hi,

I noticed that vertical and horizontal lines with a line width < 1 are 
displayed with a line width of 1 on WxAgg with recent version of matplotlib.


I use matplotlib 0.98.5.2 on Windows XP, and Ubuntu Linux 9.04.

For example :

>>> import pylab
>>> pylab.plot([0,0],[0,1],linewidth=*0.5*)
[]
>>> pylab.show()

and

>>> import pylab
>>> pylab.plot([0,0],[0,1],linewidth=*1*)
[]
>>> pylab.show()

produce the same result.

The same bug occurs when I export the figure as a png (but not on pdf 
export). It did not occur on earlier matplotlib releases (at least, not 
on 0.91.2).


Sorry if this is a known bug, or even an already corrected one, but I 
couldn't find any mention of it on Sourceforge last changelog, nor 
elsewhere.


Nicolas
--
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] [ANN] glumpy 0.2.0

2011-09-17 Thread Nicolas Rougier

Hi folks,

I am pleased to announce a new release of glumpy, a small python library for 
the (very) fast vizualization of numpy arrays, (mainly two dimensional) that 
has been designed with efficiency in mind. If you want to draw nice figures for 
inclusion in a scientific article, you’d better use matplotlib but if you want 
to have a sense of what’s going on in your simulation while it is running, then 
maybe glumpy can help you.


Download and screenshots at: http://code.google.com/p/glumpy/

Nicolas--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] [ANN] glumpy 0.2.0

2011-09-17 Thread Nicolas Rougier

Hi folks,

I am pleased to announce a new release of glumpy, a small python library for 
the (very) fast vizualization of numpy arrays, (mainly two dimensional) that 
has been designed with efficiency in mind. If you want to draw nice figures for 
inclusion in a scientific article, you’d better use matplotlib but if you want 
to have a sense of what’s going on in your simulation while it is running, then 
maybe glumpy can help you.


Download and screenshots at: http://code.google.com/p/glumpy/

Nicolas--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [ANN] glumpy 0.2.0

2011-09-18 Thread Nicolas Rougier


The interactive plot has been done using the AntTweakBar library and is not 
really user friendly. You can view the source from the demos directory:

http://code.google.com/p/glumpy/source/browse/demos/atb.py

Also, note that glumpy is not a replacement for matplotlib but rather a testbed 
for a future OpenGL backend to be integrated into matplotlib.

Nicolas


On Sep 18, 2011, at 14:00 , Stef Mientki wrote:

> hi Nicolas,
> 
> looks very interesting.
> 
> I was considering to move from MatPlotLib to guiqwt,
> because of it's easy interactive plots.
> But I see glumpy has it too.
> Can show the source code for the interactive plot in your examples ?
> 
> thanks,
> stef
> 
> 
> On 17-09-2011 19:22, Nicolas Rougier wrote:
>> 
>> 
>> Hi folks,
>> 
>> I am pleased to announce a new release of glumpy, a small python library for 
>> the (very) fast vizualization of numpy arrays, (mainly two dimensional) that 
>> has been designed with efficiency in mind. If you want to draw nice figures 
>> for inclusion in a scientific article, you’d better use matplotlib but if 
>> you want to have a sense of what’s going on in your simulation while it is 
>> running, then maybe glumpy can help you.
>> 
>> 
>> Download and screenshots at: http://code.google.com/p/glumpy/
>> 
>> Nicolas
>> 
>> 
>> --
>> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
>> http://p.sf.net/sfu/rim-devcon-copy2
>> 
>> 
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> --
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> http://p.sf.net/sfu/rim-devcon-copy2___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] data free margin

2011-11-22 Thread Nicolas Rougier

Is that what you want ?

No ticks, no labels:

import matplotlib.pyplot as plt
plt.plot(np.arange(10), np.arange(10))
plt.ylim(0,10)
plt.yticks(np.linspace(3,10,8))
plt.show()


Ticks but no labels:

import matplotlib.pyplot as plt
plt.plot(np.arange(10), np.arange(10))
plt.ylim(0,10)
plt.yticks(np.linspace(0,10,11), ['']*3 + ['%d' % i for i in linspace(3,10,8)])
plt.show()



Nicolas


On Nov 22, 2011, at 20:13 , C M wrote:

> What's the best way in Matplotlib to have a y axis that doesn't have 
> ticks/axis numbers near the bottom of the graph?  I don't know if it would be 
> specified as the bottom 1/10th of the graph or x amount of pixels or inches 
> or whatever...just need a bit of extra "y-less" space there to plot values 
> that have an x value but no y value.  I'm assuming this would be done with a 
> Formatter or Locator, but wasn't sure how to go about it.
> 
> See attached image
> 
> Thanks,
> Che
> --
> All the data continuously generated in your IT infrastructure 
> contains a definitive record of customers, 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-novd2d___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, 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-novd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hardware rendering with tricontourf

2012-01-29 Thread Nicolas Rougier


Thanks for posting the link to glumpy.

As Benjamin explained, glumpy servers as a testbed for various technics that 
could be implemented later in matplotlib. The main problem today is that if you 
want to benefit from hardware acceleration, you have to use some GL features 
that are not compatible with he whole matplotlib framework (and we need to 
ensure some degree of compatibilty). I do not have yet a clean solution and I'm 
still experimenting.

For your tricontourf problem, I think it might be solved quite easily with the 
proper GL shader  but I would need a complete (and basic) matplotlib script 
example to check if this is actually the case.


Nicolas
 


On Jan 27, 2012, at 23:12 , Benjamin Root wrote:

> On Fri, Jan 27, 2012 at 10:06 AM, Howard  wrote:
> On 1/27/12 3:39 AM, Ian Thomas wrote:
>> 
>> On 26 January 2012 19:36, Howard  wrote: 
>> I'm rendering some images with about 3.5 million triangles into a 512x512 
>> png file using tricontourf. I'm running this in a virtual machine, and I'm 
>> pretty sure that there is no graphics rendering hardware being used. Is it 
>> possible, assuming the hardware was available, to make tricontourf use the 
>> rendering hardware?  Will that happen by default?
>> 
>> You are correct, there is no graphics hardware rendering.  Rendering is 
>> controlled by the various matplotlib backends, and to my knowledge there are 
>>  no backends currently available that use hardware rendering.
>> 
>> There has been some work done on an OpenGL backend, but I am not sure of the 
>> status of this.  The last time I checked it was pretty experimental.  
>> Perhaps someone involved with it can comment on its current status.
>> 
>> Ian Thomas
> Ian
> 
> Thanks very much for the reply. If it helps whoever is doing the OpenGL 
> backend, I may be able to play with it a bit.
> 
> 
> Howard
> 
> 
> That would be the Glumpy project.
> 
> http://code.google.com/p/glumpy/
> 
> As stated in an email response a while back, glumpy is intended to be a 
> testbed for developing the OpenGL backend for future inclusion into 
> matplotlib.
> 
> Cheers!
> Ben Root
> 
> --
> 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

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

2012-02-23 Thread Nicolas Rougier


I've seen the discussion around the re-organization of the matplotlib gallery.
If that might help, here is a link to a small gallery I made.

The overall organization is simply based on subdirectories so maybe it could be 
a (temporary) solution for the matplotlib gallery (just matter of moving 
examples in the right subdirectory).


http://www.loria.fr/~rougier/coding/gallery/
https://github.com/rougier/gallery



Nicolas
--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib gallery

2012-02-23 Thread Nicolas Rougier


I agree, but the current matplotlib gallery is rather clueless about what the 
examples are related to until you click an image. I'm personally using the 
gallery by looking at an example that match what I've in mind most closely and 
then look at the code. But you're right, some structure(s) would definitely 
help.

Here is an example of a well structured gallery: 
http://www.gigawiz.com/aagraphs.html.

The first-level structure is organized at:

Specialized Scientific Graphing
Scatter Graphs
Contour Charts (2-D, 3-D, and Ternary)
Heatmaps
Voronoi Diagram
Waterfall Charts
Bubble Charts
Spider Charts
Polar Charts
Column and Bar Charts
Area Charts
Line Charts
Combination Charts (Column-Line, Bar-Line, Area-Line)
Diagrams of Multiple, Independent Value-Axes Column, Bar or Area Graphs
High-Low, (Open)-High-Low-Close, and Range Charts
Pie Charts and X-Y Scatter Pie
Vector Charts
Statistical Charts


Maybe we can find/agree on similar structure(s)/sub-structure(s) and adapt it 
to the current gallery ?



Nicolas



On Feb 23, 2012, at 16:59 , Jerzy Karczmarczuk wrote:

>  Nicolas Rougier :
>> I've seen the discussion around the re-organization of the matplotlib 
>> gallery.
>> If that might help, here is a link to a small gallery I made.
>> 
>> The overall organization is simply based on subdirectories so maybe it could 
>> be a (temporary) solution for the matplotlib gallery (just matter of moving 
>> examples in the right subdirectory).
> THANKS, Nicolas.
> 
> This is a nice initiative, but I believe that in the context of a 
> presentation of some software, this is not the way I would have chosen. 
> Why people look-up /such/ galleries? Why I do it myself? What are the 
> needs of my students (about 20 - 30 guys who work with matplotlib week 
> after wek)?
> 
> Often because I want to find a concrete program, which answers a 
> concrete question : how to implement timed animations. How to make 
> multiple plots. How to insert a figure in a GUI with widgets, how to 
> distort an image matrix, etc. etc. So a gallery should contains infos 
> about what the hell the example XYZ is about, what does it show, where 
> is the *concrete* documentation page with the description of the tools 
> used, etc.
> 
> The order of examples should be rational, and as ALWAYS some cross-links 
> would be useful.
> Program-sources without comments are not so useful...
> 
> ==
> 
> But I believe that this is just a start, and I am aware that to 
> criticize is easier than to do something. (Je suis un grognon né, 
> Nicolas, désolé...). So please, continue, my heart is with you!
> 
> 
> Jerzy Karczmarczuk
> Caen, France.
> 
> 
> --
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing 
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] histogram and a line

2012-03-08 Thread Nicolas Rougier


You need to specify the ylim because your height may be larger than your 
histogram and then you cannot see it.

Here is a script that reproduce your screenshot (with random data).


import numpy as np
import matplotlib.pyplot as plt

plt.rc('xtick', direction = 'out')
plt.rc('ytick', direction = 'out')

data = np.random.normal(0,1,100)

fig = plt.figure(figsize=(8,6), dpi=72, facecolor='w')
axes = plt.subplot(111)
axes.axvline(np.mean(data), 0, data.max(), linewidth=2, color='red')
axes.hist(data, bins=50, normed=True)
axes.set_ylim(0, 1)
axes.set_xlim(-3, 3)

axes.spines['right'].set_color('none')
axes.spines['top'].set_color('none')
axes.xaxis.set_ticks_position('bottom')
axes.spines['bottom'].set_position(('data', -0.05))
axes.yaxis.set_ticks_position('left')
axes.spines['left'].set_position(('data',-3.25))

plt.show()




Nicolas



On Mar 8, 2012, at 7:54 , Mic wrote:

> Hi Jerzy,
> Thank you for your answer. With the code below I get only a green line (see 
> attached line.png):
> 
> import numpy as np
> import matplotlib.pyplot as plt
> 
> hist_data = []
> 
> heigth = max(hist_data) + 10
> mean = np.mean(hist_data)
> 
> f = plt.figure()
> h = f.add_subplot(111)
> h.hist(hist_data, bins=50, normed=True)
> h.plot([mean,mean],[0,height])
> f.savefig('myhist.png')
> 
> without h.plot() I get a histogram (see attached matplot_hist.png).
> 
> How can I get the line and the histogram at the same time in the picture? 
> How is it possible to norm the vertical axis in order to get similar results 
> like in this picture (see attached hist.png)?
> 
> Thank you in advance.
> 
> On Wed, Mar 7, 2012 at 6:41 PM, Jerzy Karczmarczuk 
>  wrote:
> Mic:
>> Hello,
>> I am able to draw a histogram with the following code:
>> 
>> ...
>> h.hist(hist_data, bins=50, normed=True)
>> 
>> However, I don't know how to draw a line for median at 249 position like in 
>> attachment.
> Are your axes really matplotlib axes? (I have doubts, since the vertical is 
> not normed, although your histogram is).
> 
> In your real axes, the command plot([249,249],[0,height]) draws a vertical 
> line (there is a primitive vert. line as well), what is the problem??
> 
> Jerzy Karczmarczuk
> 
> 
> 
> --
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> --
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing 
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] tornado chart

2012-06-25 Thread Nicolas Rougier


I did it once and posted it to the list but never found the time to add it to 
the official gallery (my bad):

http://www.loria.fr/~rougier/coding/gallery/showcase/showcase-3-large.png
http://www.loria.fr/~rougier/coding/gallery/


Nicolas





On Jun 23, 2012, at 5:36 , Benjamin Root wrote:

> 
> 
> On Friday, June 22, 2012, John Hunter wrote:
> On Fri, Jun 22, 2012 at 2:48 PM, Alan G Isaac  wrote:
> > On 6/21/2012 10:24 PM, Tony Yu wrote:
> >> Here's an example based off the horizontal bar charts in the gallery.
> >
> > Pretty good, really!
> > More than just a starting point.
> 
> And here is a modified example a little closer visually
> 
> 
> # tornado chart example; inspired by
> # http://www.nytimes.com/imagepages/2007/07/29/health/29cancer.graph.web.html
> # and sample code from Tony Yu
> import numpy as np
> import matplotlib.pyplot as plt
> 
> cancers = [
>'Kidney cancer',
>'Bladder cancer',
>'Esophageal cancer',
>'Ovarian cancer',
>'Liver cancer',
>"Non-Hodgkin's\nlymphoma",
>'Leukemia',
>'Prostate cancer',
>'Pancreatic cancer',
>'Breast cancer',
>'Colorectal cancer',
>'Lung cancer',
>]
> 
> num_cancers = len(cancers)
> 
> # generate some random data for the graphs (TODO; put real data here)
> new_cases_men = np.random.uniform(low=20e3, high=200e3, size=num_cancers)
> new_cases_women = np.random.uniform(low=20e3, high=200e3, size=num_cancers)
> deaths_women = np.random.rand(num_cancers)*new_cases_women
> deaths_men = np.random.rand(num_cancers)*new_cases_men
> 
> # force these values where the labels happen to make sure they are
> # positioned nicely
> new_cases_men[-1] = 120e3
> new_cases_men[-2] = 55e3
> deaths_men[-1] = 80e3
> 
> # bars centered on the y axis
> pos = np.arange(num_cancers) + .5
> 
> # make the left and right axes for women and men
> fig = plt.figure(facecolor='white', edgecolor='none')
> ax_women = fig.add_axes([0.05, 0.1, 0.35, 0.8])
> ax_men = fig.add_axes([0.6, 0.1, 0.35, 0.8])
> 
> ax_men.set_xticks(np.arange(50e3, 201e3, 50e3))
> ax_women.set_xticks(np.arange(50e3, 201e3, 50e3))
> 
> # turn off the axes spines except on the inside y-axis
> for loc, spine in ax_women.spines.iteritems():
>if loc!='right':
>spine.set_color('none') # don't draw spine
> 
> for loc, spine in ax_men.spines.iteritems():
>if loc!='left':
>spine.set_color('none') # don't draw spine
> 
> # just tick on the top
> ax_women.xaxis.set_ticks_position('top')
> ax_men.xaxis.set_ticks_position('top')
> 
> # make the women's graphs
> ax_women.barh(pos, new_cases_women, align='center',
> facecolor='#DBE3C2', edgecolor='None')
> ax_women.barh(pos, deaths_women, align='center', facecolor='#7E895F',
> height=0.5, edgecolor='None')
> ax_women.set_yticks([])
> ax_women.invert_xaxis()
> 
> # make the men's graphs
> ax_men.barh(pos, new_cases_men, align='center', facecolor='#D8E2E1',
> edgecolor='None')
> ax_men.barh(pos, deaths_men, align='center', facecolor='#6D7D72',
> height=0.5, edgecolor='None')
> ax_men.set_yticks([])
> 
> # we want the cancer labels to be centered in the fig coord system and
> # centered w/ respect to the bars so we use a custom transform
> import matplotlib.transforms as transforms
> transform = transforms.blended_transform_factory(
>fig.transFigure, ax_men.transData)
> for i, label in enumerate(cancers):
>ax_men.text(0.5, i+0.5, label, ha='center', va='center',
> transform=transform)
> 
> # the axes titles are in axes coords, so x=0, y=1.025 is on the left
> # side of the axes, just above, x=1.0, y=1.025 is the right side of the
> # axes, just above
> ax_men.set_title('MEN', x=0.0, y=1.025, fontsize=12)
> ax_women.set_title('WOMEN', x=1.0, y=1.025, fontsize=12)
> 
> # the fig suptile is in fig coords, so 0.98 is the far right; we right
> align the text
> fig.suptitle('July 29, 2007', x=0.98, ha='right')
> 
> # now add the annotations
> ax_men.annotate('New Cases', xy=(0.95*new_cases_men[-1], num_cancers-0.5),
>xycoords='data',
>xytext=(20, 0), textcoords='offset points',
>size=12,
>va='center',
>arrowprops=dict(arrowstyle="

Re: [Matplotlib-users] Accelerating PDF saved plots

2012-07-05 Thread Nicolas Rougier


Your files do not seem to be readable:

http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.py
http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.pdf


Nicolas


On Jul 4, 2012, at 19:17 , Gökhan Sever wrote:

> Hello,
> 
> I am working on creating some distribution plots to analyze cloud droplet and 
> drop features.  You can see one such plot at 
> http://atmos.uwyo.edu/~gsever/data/rf06_1second/rf06_belowcloud_SurfaceArea_1second.pdf
> This file contains 38 pages and each page has 16 panels created via MPL's 
> AxesGrid toolkit. I am using PdfPages from pdf backend profile to construct 
> this multi-page plot. The original code that is used to create this plot is 
> in 
> http://code.google.com/p/ccnworks/source/browse/trunk/parcel_drizzle/rf06_moments.py
> 
> The problem I am reporting is due to the lengthier plot creation times. It 
> takes about 4 minutes to create such plot in my laptop. To better demonstrate 
> the issue I created a sample script which you can use to reproduce my timing 
> results --well based on pseudo/random data points. All my data points in the 
> original script are float64 so I use float64 in the sample script as well.
> 
> The script is at http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.py 
> I also included 2 pages output running the script with nums=2 setting 
> http://atmos.uwyo.edu/~gsever/data/matplotlib/test_speed.pdf
> Comparing my original output, indeed cloud particles are not from a normal 
> distribution :) 
> 
> Joke aside, running with nums=2 for 2 pages
> 
> time run test_speed.py
> CPU times: user 12.39 s, sys: 0.10 s, total: 12.49 s
> Wall time: 12.84 s
> 
> when nums=38, just like my original script, then I get similar timing to my 
> original run
> 
> time run test.py
> CPU times: user 227.39 s, sys: 1.74 s, total: 229.13 s
> Wall time: 234.87 s
> 
> In addition to these longer plot creation times, 38 pages plot creation 
> consumes about 3 GB memory.  I am wondering if there are tricks to improve 
> plot creation times as well as more efficiently using the memory. Attempting 
> to create two such distributions blocks my machine eating 6 GB of ram space.
> 
> Using Python 2.7, NumPy 2.0.0.dev-7e202a2, IPython 0.13.beta1, matplotlib 
> 1.1.1rc  on Fedora 16 (x86_64)
> 
> Thanks.
> 
> -- 
> Gökhan
> --
> 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


--
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] Additional line styles - comparison excel chart

2012-07-16 Thread Nicolas Rougier


Here is a quick example that might help you:

http://www.loria.fr/~rougier/coding/gallery/showcase/showcase-10-large.png
http://www.loria.fr/~rougier/coding/gallery/showcase/showcase-10.py



Nicolas


On Jul 16, 2012, at 11:27 , Daπid wrote:

> On Mon, Jul 16, 2012 at 11:09 AM, Benjamin Jonen  wrote:
>> 2) The coloring and the way the lines curve around looks very nice to
>> me. I remember that the Excel charts did not have this nice look
>> before Excel 2007. Can I achieve similar effects with matplotlib? I'm
>> not really sure what creates this nice look, so this question is of
>> course a little fuzzy.
> 
> Maybe you are thinking about the smoothness of the curves. Even you
> have spaced points, they don't do sharp edges. In my opinion, for
> scientific research, they shouldn't be concealed in the general case,
> and this is, I think, the main target of MPL.
> 
> Nevertheless, if in your case it makes sense and you want them to be
> smooth, you can do it through SciPy, applying a interpolation scheme.
> 
> tck=scipy.interpolate(datax, datay)
> datax_n=np.arange(datax.min(), datax.max(), len(datax)*20)
> datay_n=sicpy.interpolate(splev(datax_n,tck,der=0)
> 
> And then you plot datax_n and datay_n.
> 
> http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html#spline-interpolation-in-1-d-procedural-interpolate-splxxx
> 
> --
> 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


--
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] need an icon for a new featureH

2012-07-18 Thread Nicolas Rougier


What size/format do you need and would that be an option to transform/use Tango 
icons ?

http://tango.freedesktop.org/
http://commons.wikimedia.org/wiki/Tango_icons


Tango (for fullscreen but might suit tight-layout)

<>

<>

<>

<>
<>



Nicolas


On Jul 19, 2012, at 0:47 , Benjamin Root wrote:

> Hello all!
> 
> I have just about completed a PR that would add a new button to the 
> navigation toolbar for the tight_layout() action.  I am hardly an artist and 
> have no clue how to graphically represent the tight_layout action in a tiny 
> icon.  I would greatly welcome any graphics artist out there who could 
> provide such an icon for matplotlib.
> 
> Thanks!
> Ben Root
> --
> 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

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


[Matplotlib-users] New tutorial (beginner level)

2012-08-10 Thread Nicolas Rougier


Hi all,


I've just finished a new introductory tutorial for incoming Euroscipy 2012. You 
can find it here:

http://www.loria.fr/~rougier/teaching/matplotlib/


It is based on Mike Müller tutorial from scipy lecture notes 
(http://scipy-lectures.github.com/intro/matplotlib/matplotlib.html)

Sources are available from: 
https://github.com/rougier/scipy-lecture-notes/tree/euroscipy-2012


If you've any comments or see errors...



Nicolas
--
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] New tutorial (beginner level)

2012-08-10 Thread Nicolas Rougier

Thank you all, I will try to correct that.
I developed it in full screen mode and did not paid attention to the layout.

Nicolas


On Aug 10, 2012, at 15:33 , Fabrice Silva wrote:

> Le vendredi 10 août 2012 à 14:19 +0100, Damon McDougall a écrit :
>> On Fri, Aug 10, 2012 at 09:10:15AM -0400, Benjamin Root wrote:
>>> 
>>> Nice work.  I haven't read through all of it yet, but I did notice a layout
>>> issue in firefox (using 10.0.4).  Many of the code snippets are being
>>> placed on top of the example image.
>> 
>> I see this behaviour too, on Chrome, version 20.0.1132.57.
> 
> Same on epiphany 3.4.2 (webkit 1.8.1)
> 
> -- 
> Fabrice Silva
> 
> 
> --
> 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


--
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] New tutorial (beginner level)

2012-08-10 Thread Nicolas Rougier

Thanks, just forgot about the license. It will be the same as the scipy lecture 
notes which is a 

Creative Commons Attribution 3.0 United States License (CC-by)
http://creativecommons.org/licenses/by/3.0/us

Would that be ok or is a BSD one more suited ?


Nicolas


On Aug 10, 2012, at 15:10 , Benjamin Root wrote:

> 
> 
> On Fri, Aug 10, 2012 at 8:23 AM, Nicolas Rougier  
> wrote:
> 
> 
> Hi all,
> 
> 
> I've just finished a new introductory tutorial for incoming Euroscipy 2012. 
> You can find it here:
> 
> http://www.loria.fr/~rougier/teaching/matplotlib/
> 
> 
> It is based on Mike Müller tutorial from scipy lecture notes 
> (http://scipy-lectures.github.com/intro/matplotlib/matplotlib.html)
> 
> Sources are available from: 
> https://github.com/rougier/scipy-lecture-notes/tree/euroscipy-2012
> 
> 
> If you've any comments or see errors...
> 
> 
> 
> Nicolas
> 
> Nice work.  I haven't read through all of it yet, but I did notice a layout 
> issue in firefox (using 10.0.4).  Many of the code snippets are being placed 
> on top of the example image.
> 
> What is the license for this tutorial?  You should also place some copyright 
> info at the bottom as well.
> 
> Cheers!
> Ben Root
> 


--
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] New tutorial (beginner level)

2012-08-10 Thread Nicolas Rougier


Not at all of course. Glad this might be of some help for matplolib.


Nicolas


On Aug 10, 2012, at 16:03 , Michael Droettboom wrote:

> Very nice.  I'm thinking of some ideas to revamp the 
> documentation/website, and one thing I would like to do is to link to 
> some of these external resources.  Do you have any objections to me 
> linking to this?
> 
> Mike
> 
> On 08/10/2012 08:23 AM, Nicolas Rougier wrote:
>> 
>> Hi all,
>> 
>> 
>> I've just finished a new introductory tutorial for incoming Euroscipy 2012. 
>> You can find it here:
>> 
>> http://www.loria.fr/~rougier/teaching/matplotlib/
>> 
>> 
>> It is based on Mike Müller tutorial from scipy lecture notes 
>> (http://scipy-lectures.github.com/intro/matplotlib/matplotlib.html)
>> 
>> Sources are available from: 
>> https://github.com/rougier/scipy-lecture-notes/tree/euroscipy-2012
>> 
>> 
>> If you've any comments or see errors...
>> 
>> 
>> 
>> Nicolas
>> --
>> 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
> 
> 
> --
> 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


--
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] New tutorial (beginner level)

2012-08-11 Thread Nicolas Rougier

Thanks Fernando !

By the way, I suspect the simple plot part may well suited for the ipython 
notebook !
I'll give it a try.


Nicolas



On Aug 11, 2012, at 4:55 , Fernando Perez wrote:

> On Fri, Aug 10, 2012 at 5:23 AM, Nicolas Rougier
>  wrote:
>> 
>> I've just finished a new introductory tutorial for incoming Euroscipy 2012. 
>> You can find it here:
>> 
>> http://www.loria.fr/~rougier/teaching/matplotlib/
> 
> Wow!  Other than the rendering glitches already mentioned, this is
> *awesome*.  We're teaching a python workshop at UC Berkeley in 2 weeks
> (http://register.pythonbootcamp.info) and I just suggested we use this
> for our mpl intro.
> 
> It's the best one I've seen so far, and the reference info at the
> bottom as well as the mini-gallery will make it a very useful resource
> even for seasoned users.
> 
> Fantastic job, Nicolas (and Mike M.), and thanks for sharing this
> great resource!
> 
> Cheers,
> 
> f


--
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] New tutorial (beginner level)

2012-08-11 Thread Nicolas Rougier


Fantastic ! This is very valuable teaching material.
Really great job and big thanks to all the ipython developers.

Matthias, hope to see you at Euroscipy (and see some ipython demos).
In fact, I've also some questions around ipython/webgl for you...


Nicolas


On Aug 11, 2012, at 9:17 , Fernando Perez wrote:

> On Sat, Aug 11, 2012 at 12:09 AM, Nicolas Rougier
>  wrote:
>> By the way, I suspect the simple plot part may well suited for the ipython 
>> notebook !
>> I'll give it a try.
> 
> Actually in the notebook it is now possible to enable exercises,
> hints, reveal-boxes, etc.  I'm cc'ing here Matthias Bussonnier b/c I'm
> not sure if he's on the mpl list.  He's one of our recent core devs
> who is behind a lot of our new JS magic in the notebook, and he's also
> a French scientist who will be at Euroscipy, so you guys could perhaps
> touch bases (I'm unfortunately not going to make it this year).
> 
> Ultimately we'd like to make it very easy to write tutorials such as
> yours directly as notebooks, so that when used in the classroom
> students can work straight off them, and yet also publish then with
> clean and customizable HTML on the web like you did.  Lots of the
> pieces are in place, though not quite all yet :)
> 
> Cheers,
> 
> f


--
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] How to start when you don't know what to do

2013-01-15 Thread Nicolas Rougier


I do exactly that from time to time (copying a graphic) and I always start 
looking at the matplotlib gallery (http://matplotlib.org/gallery.html) for what 
is the most similar figure and starts from here (after removing what is not 
necessary). Most important is identifying the kind of axis necessary 
(cartesian, log, polar, ...)

Some examples at: http://www.loria.fr/~rougier/coding/gallery/

Some really nice graphics (but difficult) to try to copy at:

http://www.improving-visualisation.org/visuals



Nicolas


On Jan 15, 2013, at 20:52 , Steven Boada wrote:

> Heyya list.
> 
> I must admit that my matplotlib-foo is only so so. One of the biggest 
> problems that I face is seeing cool stuff around the net, and thinking, 
> "that's pretty neat, I'd like to copy it." In reality, I have no idea 
> how I would go about creating something like that.
> 
> Here's an example: http://imgur.com/JdkR4
> 
> Just a little circular histogram thing with some annotations. Obviously, 
> I'd need the annotate command for the words, but what about the arcs? No 
> idea, off hand. So my question is, how do you decode (read: what to 
> think about) figures that you see, and turn them into actual python? 
> Sure I could post on stack exchange or email all you people every time, 
> but I want to be *better* at this. And while some people are going to 
> scoff and reply "that's easy, silly" it's not so for some. I just hate 
> to admit it's me.
> 
> Thanks for the advice.
> 
> -- 
> 
> Steven Boada
> 
> Doctoral Student
> Dept of Physics and Astronomy
> Texas A&M University
> bo...@physics.tamu.edu
> 
> 
> --
> Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
> and more. Get SQL Server skills now (including 2012) with LearnDevNow -
> 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
> SALE $99.99 this month only - learn more at:
> http://p.sf.net/sfu/learnmore_122512
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib pnpoly-example-results-in-error

2013-05-10 Thread Nicolas Rougier

>From the matplotlib page, you can reach:
http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html

and just translates the function:

def inside_polygon(p, vertices):
vx,vy = vertices[:,0], vertices[:,1]
x,y = p
c = 0
j = len(vertices)-1
for i in xrange(len(vertices)):
if( ((vy[i] > y) != (vy[j] > y)) and (x < (vx[j]-vx[i]) * (y-vy[i]) / 
(vy[j]-vy[i]) + vx[i]) ):
c = 1-c
j = i
return c

Of course this would be slower than the corresponding C implementation.

Nicolas


On May 9, 2013, at 21:55 , algotr8der wrote:

> I tried to execute the following code:
> 
> http://matplotlib.org/faq/howto_faq.html#test-whether-a-point-is-inside-a-polygon
> 
> However I get errors I describe here:
> 
> http://stackoverflow.com/questions/16452509/matplotlib-pnpoly-example-results-in-error
> 
>>>> import numpy as np
>>>> import matplotlib.nxutils as nx
>>>> verts = np.array([ [0,0], [0, 1], [1, 1], [1,0]], float)
>>>> nx.pnpoly(0.5, 0.5, verts)
> 
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "C:\Python27\lib\site-packages\matplotlib\nxutils.py", line 26, in
> pnpoly
>return p.contains_point(x, y)
>  File "C:\Python27\lib\site-packages\matplotlib\path.py", line 289, in
> contains_point
>transform = transform.frozen()
> AttributeError: 'float' object has no attribute 'frozen'
> 
>>>> nx.pnpoly(0.5, 1.5, verts)
> 
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "C:\Python27\lib\site-packages\matplotlib\nxutils.py", line 26, in
> pnpoly
>return p.contains_point(x, y)
>  File "C:\Python27\lib\site-packages\matplotlib\path.py", line 289, in
> contains_point
>transform = transform.frozen()
> AttributeError: 'float' object has no attribute 'frozen'
> 
> Apparently, nxutils is deprecated, which to me means it should still work
> but a user on stackoverflow pointed out that there may be some code rot.
> That said, the documentation on matplotlib.path.Path.contains_point is weak
> (see below). Does anyone have an example of how I can do the exact same
> thing in the code in the howto_faq but using the suggested function
> (contains_point)?
> 
> http://matplotlib.org/1.2.1/api/path_api.html?highlight=contains_point#matplotlib.path.Path.contains_point
> 
> contains_point(point, transform=None, radius=0.0)
> 
>Returns True if the path contains the given point.
>If transform is not None, the path will be transformed before performing
> the test.
>radius allows the path to be made slightly larger or smaller.
> 
> contains_points(points, transform=None, radius=0.0)
> 
>Returns a bool array which is True if the path contains the
> corresponding point.
>If transform is not None, the path will be transformed before performing
> the test.
>radius allows the path to be made slightly larger or smaller.
> 
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://matplotlib.1069221.n5.nabble.com/re-matplotlib-pnpoly-example-results-in-error-tp41028.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
> 
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and 
> their applications. This 200-page book is written by three acclaimed 
> leaders in the field. The early access version is available now. 
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contourf() for "proper plotting purpose"

2013-05-22 Thread Nicolas Rougier


You can use the 'origin' keyword:

pl.controuf(Matrix, origin='lower')
or
pl.controuf(Matrix, origin='upper')


Nicolas


On May 23, 2013, at 7:27 AM, Bakhtiyor Zokhidov  
wrote:

> Hi,
> 
> I have following code:
> 
> import numpy as np
> import pylab as pl
> 
> Matrix(10,10) = 
> np.array([[ 4.5, 4.5, 4.5, 3.4, 2.5, 3.9, 3.4, 3.4, 2.2, 3.9],
> [ 3.9, 4.5, 5.2, 4.5, 3.4, 3.4, 2.2, 2.9, 3.4, 3.4],
> [ 3.9, 3.9, 2.5, 2.2, 1.9, 1.2, 1.2, 1.4, 2.5, 2.9],
> [ 3.4, 3.9, 2.9, 2.2, 1.2, 1.4, 1.7, 1.4, 1.9, 2.2],
> [ 2.5, 3.4, 2.2, 1.4, 1.2, 1.2, 1.7, 0.8, 1.9, 1.7],
> [ 2.5, 2.2, 2.5, 1.2, 1.2, 0.9, 1.7, 1.7, 1.4, 1.9],
> [ 2.2, 2.2, 3.4, 1.7, 0.9, 0.9, 0.9, 1.2, 1.7, 1.9],
> [ 2.9, 1.9, 1.9, 1.4, 1.1, 0.9, 1.2, 1.1, 1.7, 1.9],
> [ 2.9, 1.7, 2.2, 1.4, 1.1, 0.9, 1.1, 0.8, 1.1, 1.9],
> [ 2.5, 1.9, 1.7, 1.2, 1.4, 0.8, 1.1, 0.8, 1.4, 1.7]])
> 
> pl.contourf(Matrix)
> pl.show()
> 
> The problem is that that plots reversely, in other words top values are 
> below, bottom values are top!!
> 
> How can I plot it properly?
> 
> 
> -- 
> Bakhtiyor Zokhidov
> --
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service 
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! 
> http://p.sf.net/sfu/newrelic_d2d_may___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Graph ticks label missing !

2013-07-08 Thread Nicolas Mailhot
Hi,

Following an hardware failure I had to move some matplotlib scripts from
an ancient (but updated) Debian box to a clean RHEL 6 VM. As a result my
matplotlib version changed from 1.2.0 (as present in Debian instable) to
1.2.1 (some of the code wanted matplotlib ≥ 1.0, so I rebuilt an 1.2.1
packaged based on the Fedora 1.2.0 one. 1.3.0-rc2 / 1.3.0git gave me so
many dependencies griefs I gave up on it)

Anyway the result seems to work fine so far, except for a few scores of
time graphs where some tick labels gone missing. Those graphs are supposed
to show weekly data, with:
– ticks on month ends,
– subticks on week ends,
– week numbers in the middle of each week (top) and
– month numbers on the middle of each month (bottom).

With the new installation months numbers got missing.

Here is an extract of the relevant code :

%<---
  subplot.set_xticks([dd.monthstart(m) for m in months])
  subplot.set_xticks([w.gmticks() for w in weeks], minor=True)
  subplot.set_xticklabels([])
  plt.xlim(dd.monthstart(min(months)),dd.monthend(max(months)))

  subplot1 = subplot.twiny()
  mmonths = [m for i,m in enumerate(months)
if operator.mod(i,1+(len(months)-1)/12) == 0]
  subplot1.set_xticks([dd.monthmiddle(m) for m in mmonths])
  subplot1.set_xticklabels(mmonths)
  subplot1.tick_params(labelsize='6.5',labelbottom=True, labeltop=False)
  plt.xlim(dd.monthstart(min(months)),dd.monthend(max(months)))

  subplot2 = subplot.twiny()
  mweeks = [w for i,w in enumerate(weeks)
if operator.mod(i,1+(len(weeks)-1)/53) == 0]
  subplot2.set_xticks([dd.weekmiddle(w)   for w in mweeks])
  subplot2.set_xticklabels([w.iso_week[1] for w in mweeks])
  subplot2.tick_params(labelsize='5',labelbottom=False, labeltop=True,pad=3)
  plt.xlim(dd.monthstart(min(months)),dd.monthend(max(months)))

  subplot2.xaxis.set_ticks_position('none')
  subplot1.xaxis.set_ticks_position('none')
  subplot.xaxis.set_ticks_position('both')
%<---

I've tried to move the
subplot1.tick_params(labelsize='6.5',labelbottom=True, labeltop=False)
line to the end of the block, but it seems matplotlib is confusing
subplot1 and subplot2, and that results in the displaying of week numbers
(not month numbers) to the bottom of the plot (and the week numbers
disappear from the top of the graph).

Any idea how to restore the previously working behaviour ?

Regards,

-- 
Nicolas Mailhot


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] [Patch] Patch for fontmanager crash

2013-07-08 Thread Nicolas Mailhot
Hi,

In matplotlib 1.2.1, the  get_name function is not garding against none
self (unlike other functions); Unfortunately it seems I have a workload
that makes matplotlib call get_name with None (wasn't the case in 1.2.0).
I couldn't isolate the exact trigger, when I reduce the volume of data
processed the problem goes away so I have to simple shareable reproducer.

Anyway, the following patch makes it all work for me, could it (or
something similar) be merged?

diff -uNr matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py
matplotlib-1.2.1/lib/matplotlib/font_manager.py
--- matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py2013-03-26
14:04:37.0 +0100
+++ matplotlib-1.2.1/lib/matplotlib/font_manager.py 2013-07-08
14:49:37.791845661 +0200
@@ -721,6 +721,8 @@
 Return the name of the font that best matches the font
 properties.
 """
+if self._family is None:
+  return rcParams['font.family']
 return ft2font.FT2Font(str(findfont(self))).family_name

 def get_style(self):

Regards,

-- 
Nicolas Mailhot


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [Patch] Patch for fontmanager crash

2013-07-09 Thread Nicolas Mailhot

Le Lun 8 juillet 2013 18:18, Martin Mokrejs a écrit :
> Nicolas Mailhot wrote:
>> Hi,
>>
>> In matplotlib 1.2.1, the  get_name function is not garding against none
>> self (unlike other functions); Unfortunately it seems I have a workload
>> that makes matplotlib call get_name with None (wasn't the case in
>> 1.2.0).
>> I couldn't isolate the exact trigger, when I reduce the volume of data
>> processed the problem goes away so I have to simple shareable
>> reproducer.
>>
>> Anyway, the following patch makes it all work for me, could it (or
>> something similar) be merged?
>>
>> diff -uNr matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py
>> matplotlib-1.2.1/lib/matplotlib/font_manager.py
>> --- matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py
>> 2013-03-26
>> 14:04:37.0 +0100
>> +++ matplotlib-1.2.1/lib/matplotlib/font_manager.py 2013-07-08
>> 14:49:37.791845661 +0200
>> @@ -721,6 +721,8 @@
>>  Return the name of the font that best matches the font
>>  properties.
>>  """
>> +if self._family is None:
>> +  return rcParams['font.family']
>>  return ft2font.FT2Font(str(findfont(self))).family_name
>>
>>  def get_style(self):
>>
>> Regards,
>>
>
> Could you instead just test for "if not self._family"? Tests for equality
> are more expensive (that means self._family == 0 or self._family == False
> will also trigger your return).

I can test if it works. However, all the other tests in that file are
already of the if Foo is None form, and I didn't want to change the coding
style

Regards,

-- 
Nicolas Mailhot


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [Patch] Patch for fontmanager crash

2013-07-09 Thread Nicolas Mailhot

Le Mar 9 juillet 2013 15:14, Nicolas Mailhot a écrit :
>
> Le Lun 8 juillet 2013 18:18, Martin Mokrejs a écrit :

>> Could you instead just test for "if not self._family"? Tests for
>> equality
>> are more expensive (that means self._family == 0 or self._family ==
>> False
>> will also trigger your return).
>
> I can test if it works. However, all the other tests in that file are
> already of the if Foo is None form, and I didn't want to change the coding
> style

And I can confirm the following patch also fixes my workload

diff -uNr matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py
matplotlib-1.2.1/lib/matplotlib/font_manager.py
--- matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py2013-03-26
14:04:37.0 +0100
+++ matplotlib-1.2.1/lib/matplotlib/font_manager.py 2013-07-08
14:49:37.791845661 +0200
@@ -721,6 +721,8 @@
 Return the name of the font that best matches the font
 properties.
 """
+if not self._family:
+  return rcParams['font.family'][0]
 return ft2font.FT2Font(str(findfont(self))).family_name

 def get_style(self):

Now could something similar be merged?

Regards,

-- 
Nicolas Mailhot


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Vectorization

2010-07-02 Thread Nicolas Bigaouette
Hi all,

I don't really know where to ask, so here it is.

I was able to vectorize the normalization calculation in quantum mechanics:
. Basically it's a volume integral of a scalar field. Using:

> norm = 0.0
> for i in numpy.arange(len(dx)-1):
> for j in numpy.arange(len(dy)-1):
> for k in numpy.arange(len(dz)-1):
> norm += psi[k,j,i]**2 * dx[i] * dy[j] * dz[k]
>
if dead slow. I replaced that with:

> norm = (psi**2 *
> dx*dy[:,numpy.newaxis]*dz[:,numpy.newaxis,numpy.newaxis]).sum()
>
which is almost instantanious.

I want to do the same for the calculation of the kinetic energy:
/2m. There is a laplacian in the volume integral which
complicates things:

> K = 0.0
> for i in numpy.arange(len(dx)-1):
> for j in numpy.arange(len(dy)-1):
> for k in numpy.arange(len(dz)-1):
> K += -0.5 * m * phi[k,j,i] * (
>   (phi[k,j,i-1] - 2.0*phi[k,j,i] + phi[k,j,i+1]) / dx[i]**2
> + (phi[k,j-1,i] - 2.0*phi[k,j,i] + phi[k,j+1,i]) / dy[j]**2
> + (phi[k-1,j,i] - 2.0*phi[k,j,i] + phi[k+1,j,i]) / dz[k]**2
> )
>

My question is, how would I vectorize such loops? I don't know how I would
manage the "numpy.newaxis" code-foo with neighbours dependency... Any idea?

Thanx!
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow() and a transparent colormap?

2010-10-02 Thread Nicolas Bigaouette
On Fri, Oct 1, 2010 at 5:38 PM, Stan West  wrote:

>  *From:* Nicolas Bigaouette [mailto:nbigaoue...@gmail.com]
> *Sent:* Thursday, September 30, 2010 18:00
>
> What I would like to do it have a colormap which is transparent for lower
> values of data and opaque for high values, so the blue on the figure would
> appear white/transparent.
>
> Would it suffice for the colormap to be light or white for low values but
> still opaque? There are several built-in maps [1] with a light color at one
> end; if it's light at the high end, append "_r" to the colormap name to get
> the reversed version.
>
> [1]
> http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html
>
I guess it's the best solution for now. Thanks ;)
--
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


[Matplotlib-users] RuntimeError: CGContextRef is NULL

2010-10-04 Thread Nicolas Rougier


I'm trying to have animated plots using draw_artist on mac os x and I got an 
error with the following script:

import numpy as np
import matplotlib.pyplot as plt

plt.ion()
plt.figure()
subplot = plt.subplot(1,1,1)
axis = plt.imshow(np.random.random((10,10)))
plt.draw()
subplot.draw_artist(axis)
plt.show()

The traceback is:

Traceback (most recent call last):
  File "matplotlib-bug.py", line 8, in 
subplot.draw_artist(axis)
  File "/Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/axes.py", 
line 1946, in draw_artist
a.draw(self._cachedRenderer)
  File "/Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/artist.py", 
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File "/Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/image.py", 
line 338, in draw
gc = renderer.new_gc()
  File 
"/Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py",
 line 105, in new_gc
self.gc.save()
RuntimeError: CGContextRef is NULL


Is there something wrong in my script (it seems to be working on linux) ?


Information:
matplotlib version: 1.0.0
python version 2.7
macosx version: 10.6.4


Nicolas
--
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] RuntimeError: CGContextRef is NULL

2010-10-04 Thread Nicolas Rougier


Thanks. Unfortunately wx and tk backends are broken on my machine (but they may 
be easier to fix).
I will file a bug report for the native backend bug. 

Nicolas


On Oct 4, 2010, at 22:27 , Friedrich Romstedt wrote:

> 2010/10/4 Nicolas Rougier :
>> I'm trying to have animated plots using draw_artist on mac os x and I got an 
>> error with the following script:
>> 
>> import numpy as np
>> import matplotlib.pyplot as plt
>> 
>> plt.ion()
>> plt.figure()
>> subplot = plt.subplot(1,1,1)
>> axis = plt.imshow(np.random.random((10,10)))
>> plt.draw()
>> subplot.draw_artist(axis)
>> plt.show()
>> 
>> The traceback is:
>> 
>> Traceback (most recent call last):
>>  File "matplotlib-bug.py", line 8, in 
>>subplot.draw_artist(axis)
>>  File "/Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/axes.py", 
>> line 1946, in draw_artist
>>a.draw(self._cachedRenderer)
>>  File 
>> "/Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/artist.py", line 
>> 55, in draw_wrapper
>>draw(artist, renderer, *args, **kwargs)
>>  File "/Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/image.py", 
>> line 338, in draw
>>gc = renderer.new_gc()
>>  File 
>> "/Volumes/Data/Local/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py",
>>  line 105, in new_gc
>>self.gc.save()
>> RuntimeError: CGContextRef is NULL
>> 
>> 
>> Is there something wrong in my script (it seems to be working on linux) ?
> 
> I don't know what it is, and it looks like some problem with the
> Mac-native backend, but I believe you can sort it out by just
> switching the backend to e.g. TkAgg.
> 
> Friedrich


--
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] automatically choose different line markers

2010-11-08 Thread Nicolas Bigaouette
>
> How can I automatically cycle through distinctive line markers?
>>
>> I want a semilog plot, composed of a number of lines.  Each line should
>> have
>> a different color and marker.
>
>
I simply use:

colors = ['b', 'r', 'c', 'm', 'k', 'g', 'y']
symbols = ['-', '--', '-.', ':']
nc = len(colors)
ns = len(symbols)
cs = 0
cc = 0
for i in numpy.arange(len(parameters_list)):
plt.plot(x, y, colors[cc%nc] + symbols[cs%ns], label=r'$\Delta x_{min} =
' + str(dxmin[j]) + ', N = ' + str(Ns[i]) + r'$')
cc += 1
if (cc == nc):
cc = 0
cs += 1

This will cycle through symbols when colors run out. You can indent or not
"cs" to cycle through symbols too.
--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to get axes from a user click?

2010-11-16 Thread Nicolas Bigaouette
Hi all,

I have defined some shortcuts I often use using pylab.ginput(). I normally
do:

> fig = pylab.figure()

fig.canvas.mpl_connect('key_press_event', on_key)

with my "on_key" function being (simplified):

> def on_key(event):

if (event.key == 'q'):

sys.exit(0)

elif (event.key == 'w'):

pylab.close(pylab.gcf())

elif (event.key == 'd'):

print "Please click two points to get the distance and slope."

points = pylab.ginput(n=2, show_clicks=True)

[...]

pylab.plot([points[0][0], points[1][0]], [points[0][1],
> points[1][1]],  '+r', lw=1.0)

pylab.plot([points[0][0], points[1][0]], [points[0][1],
> points[1][1]],  '--r', lw=1.0)

pylab.draw()


I'm plotting two markers where the user clicked and a line between them.

This works fine, except when there is multiple subplots. I can correctly
select points and get their position, but the plot commands will put the
markers+line in the last subplot. I tried using "pylab.gca().plot()" but
gca() always returns the last axes.

My question is, how can I plot on the axes the user clicked on?

Thank you!

N
--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Use a marker symbol in a text string

2010-11-23 Thread Nicolas Bigaouette
Why not just use latex?
plt.text(0.05, 0.95, r"This is the square marker: $\Box$ Subscript: $_\Box$
superscript: $^\Box$", fontsize=20)
--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] [mplot3d] remove background

2010-11-28 Thread Nicolas Pinto
Dear all,

I'm trying to get rid of the mplot3d background (in vain, see below),
how can I do this?

Thanks for your help.

Best,

Nicolas

demo:

from mpl_toolkits.mplot3d import axes3d, axis3d
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = axes3d.Axes3D(fig)

for axis in ax.w_xaxis, ax.w_yaxis, ax.w_zaxis:
for elt in axis.get_ticklines() + axis.get_ticklabels():
elt.set_visible(False)

myAXINFO = {
'x': {'i': 0, 'tickdir': 1, 'juggled': (1, 0, 2),
  'color': (0, 0, 0, 0, 0)},
'y': {'i': 1, 'tickdir': 0, 'juggled': (0, 1, 2),
  'color': (0, 0, 0, 0, 0)},
'z': {'i': 2, 'tickdir': 0, 'juggled': (0, 2, 1),
  'color': (0, 0, 0, 0, 0)},
}

ax.w_xaxis._AXINFO = myAXINFO
ax.w_yaxis._AXINFO = myAXINFO
ax.w_zaxis._AXINFO = myAXINFO

plt.show()

--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [mplot3d] remove background

2010-11-28 Thread Nicolas Pinto
Thanks for the quick reply Ben. Let me know how I can help.

Regards,

N

On Sun, Nov 28, 2010 at 6:54 PM, Benjamin Root  wrote:
> On Sunday, November 28, 2010, Nicolas Pinto  wrote:
>> Dear all,
>>
>> I'm trying to get rid of the mplot3d background (in vain, see below),
>> how can I do this?
>>
>> Thanks for your help.
>>
>> Best,
>>
>> Nicolas
>>
>> demo:
>>
>> from mpl_toolkits.mplot3d import axes3d, axis3d
>> import matplotlib.pyplot as plt
>> import numpy as np
>>
>> fig = plt.figure()
>> ax = axes3d.Axes3D(fig)
>>
>> for axis in ax.w_xaxis, ax.w_yaxis, ax.w_zaxis:
>>     for elt in axis.get_ticklines() + axis.get_ticklabels():
>>         elt.set_visible(False)
>>
>> myAXINFO = {
>>     'x': {'i': 0, 'tickdir': 1, 'juggled': (1, 0, 2),
>>           'color': (0, 0, 0, 0, 0)},
>>     'y': {'i': 1, 'tickdir': 0, 'juggled': (0, 1, 2),
>>           'color': (0, 0, 0, 0, 0)},
>>     'z': {'i': 2, 'tickdir': 0, 'juggled': (0, 2, 1),
>>           'color': (0, 0, 0, 0, 0)},
>>     }
>>
>> ax.w_xaxis._AXINFO = myAXINFO
>> ax.w_yaxis._AXINFO = myAXINFO
>> ax.w_zaxis._AXINFO = myAXINFO
>>
>> plt.show()
>>
>> --
>> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
>> Tap into the largest installed PC base & get more eyes on your game by
>> optimizing for Intel(R) Graphics Technology. Get started today with the
>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
>> http://p.sf.net/sfu/intelisp-dev2dev
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
> Unfortunately, I doubt you will be able to in the current state of
> mplot3d's code. The background objects get remade at every change of
> viewing angle or change in the figure window.  I am working on some
> refactoring, but it will be a while before I tackle the drawing
> behavior.
>
> Let me take a look in the next couple of days on a possible workaround
>
> Ben Root
>



-- 
Nicolas Pinto
Ph.D. Candidate, Brain & Computer Sciences
Massachusetts Institute of Technology, USA
http://web.mit.edu/pinto

--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Bug in NonUniformImage?

2010-12-13 Thread Nicolas Bigaouette
Hi all,

I'm using matplotlib.image.NonUniformImage() to plot a 2D rectilinear grid
(non uniform spacing between points):

> im = matplotlib.image.NonUniformImage(grid, extent=extent, origin='lower',
> cmap = matplotlib.cm.jet, interpolation = "nearest")

im.set_data(x, y, z)

ax.images.append(im)

ax.set_xlim(extent_x)

ax.set_ylim(extent_z)

I have tried using a different interpolation value as in imshow(), but only
"nearest" and "bilinear" gives expected results. All others ('bicubic',
'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser',
'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc' and 'lanczos')
show garbage instead of my data.

If the other interpolations are not implemented, there should be at least an
assert somewhere...

Thanx
--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] MinorLogTickFormatter and is_decade()

2011-01-28 Thread Nicolas Bigaouette
Hi all,

I have a derived class that I copy-pasted from the web somewhere to hide
some tick labels:

class MinorLogTickFormatter(matplotlib.ticker.LogFormatter):
# Format log scale with 10^ labels. Only if show one label over two.
def __call__(self, val, pos=None):
exponent =
int(numpy.floor(numpy.log(abs(val))/numpy.log(self._base)))
base = int(val / 10.0**exponent)
isDecade = self.is_decade(exponent)
if not isDecade and self.labelOnlyBase:
return ''
if (not (base == 2 or base == 4 or base == 6 or base == 8)): # Only
show these ones.
return ''
label = r"$%d \times 10^{%d}$" % (base, exponent)
return label

pylab.gca().xaxis.set_minor_formatter(MinorLogTickFormatter())

I've beend using this since many months, but with matplotlib 1.0.1 I can't
anymore. It complains about the is_decade() function:
isDecade = self.is_decade(exponent)
AttributeError: MinorLogTickFormatter instance has no attribute 'is_decade'

How can I fix that?

Thanks!

Nicolas
--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Slider: can valmax be updated?

2011-02-15 Thread Nicolas Bigaouette
Hi all,

I'm using a matplotlib.widgets.Slider on my animated figure. Sometime, I
want to refresh the maximum value of the slider (since new values to plot
were generated).

Is it possible to update the "valmax" value of the slider? If not, is it
possible to delete the slider and create a new one?

Thanx!
--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Help in solving a segfault problem?

2011-03-10 Thread Nicolas SCHEFFER
Hi all,
I am stuck on matplotlib generating a segfault when invoking 'plot'.
I've ben trying to solve this problem for a while now but no luck.
I've seen many duplicates of this problem on the web, some with
solutions, some without. The solution must be something more generic
that I'm missing.

Here are some of these pointers to the same problem that I have (the
backtrace, that I pasted further below, has the same properties)
http://old.nabble.com/101-Point-Segmentation-Fault-td27552745.html
http://old.nabble.com/weird-error-with-gcc-4.4,-gomp,-cython,-and-matplotlib-td27351399.html
http://bugs.gentoo.org/show_bug.cgi?id=338513

So here's my specific setup and backtrace. I hope I can find some help!
I'm using the 'agg' backend that's it, and the build and install dir
were cleaned up.

Thanks so much!

===
Solaris10, 64bits, Python 2.7, numpy 1.5.1, gcc 4.4.1 #all compiled from source

backtrace:

gdb python
(gdb) run -c 'import pylab;pylab.clf(); pylab.plot([4])'
Starting program: python -c 'import pylab;pylab.clf(); pylab.plot([4])'
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
terminate called after throwing an instance of 'std::exception'
terminate called recursively

Program received signal SIGABRT, Aborted.
[Switching to Thread 1 (LWP 1)]
0xfd7fff0ae88a in _lwp_kill () from /lib/64/libc.so.1


#0  0xfd7fff0ae88a in _lwp_kill () from /lib/64/libc.so.1
#1  0xfd7fff0a98b3 in thr_kill () from /lib/64/libc.so.1
#2  0xfd7fff0577e9 in raise () from /lib/64/libc.so.1
#3  0xfd7fff03a7d0 in abort () from /lib/64/libc.so.1
#4  0xfd7ff46d1a56 in __gnu_cxx::__verbose_terminate_handler () at
../../../../../libstdc++-v3/libsupc++/vterminate.cc:48
#5  0xfd7ff46cef6a in __cxxabiv1::__terminate (handler=0x1) at
../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38
#6  0xfd7ff46cefb3 in std::terminate () at
../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
#7  0xfd7ff46cf03e in __cxxabiv1::__cxa_rethrow () at
../../../../../libstdc++-v3/libsupc++/eh_throw.cc:116
#8  0xfd7ff46d1af6 in __gnu_cxx::__verbose_terminate_handler () at
../../../../../libstdc++-v3/libsupc++/vterminate.cc:78
#9  0xfd7ff46cef6a in __cxxabiv1::__terminate (handler=0x1) at
../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38
#10 0xfd7ff46cefb3 in std::terminate () at
../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
#11 0xfd7ff46cf0b6 in __cxxabiv1::__cxa_throw (obj=, tinfo=, dest=)
at ../../../../../libstdc++-v3/libsupc++/eh_throw.cc:83
#12 0xfd7ff4a22fd8 in py_to_agg_transformation_matrix
(obj=0x774380, errors=) at
src/agg_py_transforms.cpp:22
#13 0xfd7ff4a32e7c in _path_module::update_path_extents
(this=, args=...) at src/path.cpp:380
#14 0xfd7ff4a34d90 in
Py::ExtensionModule<_path_module>::invoke_method_varargs (this=,
method_def=, args=...) at
./CXX/Python2/ExtensionModule.hxx:184
#15 0xfd7ff4a209b7 in Py::method_varargs_call_handler
(_self_and_name_tuple=, _args=)
at CXX/Python2/cxx_extensions.cxx:1714
#16 0x004a6071 in call_function (f=0x2024770, throwflag=)
at /usr/local/src/lang/Python-2.7.1/Python/ceval.c:4012
#17 PyEval_EvalFrameEx (f=0x2024770, throwflag=)
at /usr/local/src/lang/Python-2.7.1/Python/ceval.c:2665
#18 0x004a79c1 in PyEval_EvalCodeEx (co=0x124e230,
globals=, locals=,
args=0x2024910,
argcount=, kws=0x3, kwcount=2,
defs=0x155c888, defcount=3, closure=0x0)

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help in solving a segfault problem?

2011-03-13 Thread Nicolas SCHEFFER
Hi,
I didn't get much reply on this issue, so I'm just trying to resurrect
the question.
If there's no easy answer, could someone help me by giving me a
pointer, a method to resolve the problem, or any other quick
advice...?

Thanks much!


On Thu, Mar 10, 2011 at 12:29 AM, Nicolas SCHEFFER
 wrote:
> Hi all,
> I am stuck on matplotlib generating a segfault when invoking 'plot'.
> I've ben trying to solve this problem for a while now but no luck.
> I've seen many duplicates of this problem on the web, some with
> solutions, some without. The solution must be something more generic
> that I'm missing.
>
> Here are some of these pointers to the same problem that I have (the
> backtrace, that I pasted further below, has the same properties)
> http://old.nabble.com/101-Point-Segmentation-Fault-td27552745.html
> http://old.nabble.com/weird-error-with-gcc-4.4,-gomp,-cython,-and-matplotlib-td27351399.html
> http://bugs.gentoo.org/show_bug.cgi?id=338513
>
> So here's my specific setup and backtrace. I hope I can find some help!
> I'm using the 'agg' backend that's it, and the build and install dir
> were cleaned up.
>
> Thanks so much!
>
> ===
> Solaris10, 64bits, Python 2.7, numpy 1.5.1, gcc 4.4.1 #all compiled from 
> source
>
> backtrace:
>
> gdb python
> (gdb) run -c 'import pylab;pylab.clf(); pylab.plot([4])'
> Starting program: python -c 'import pylab;pylab.clf(); pylab.plot([4])'
> [Thread debugging using libthread_db enabled]
> [New Thread 1 (LWP 1)]
> terminate called after throwing an instance of 'std::exception'
> terminate called recursively
>
> Program received signal SIGABRT, Aborted.
> [Switching to Thread 1 (LWP 1)]
> 0xfd7fff0ae88a in _lwp_kill () from /lib/64/libc.so.1
>
>
> #0  0xfd7fff0ae88a in _lwp_kill () from /lib/64/libc.so.1
> #1  0xfd7fff0a98b3 in thr_kill () from /lib/64/libc.so.1
> #2  0xfd7fff0577e9 in raise () from /lib/64/libc.so.1
> #3  0xfd7fff03a7d0 in abort () from /lib/64/libc.so.1
> #4  0xfd7ff46d1a56 in __gnu_cxx::__verbose_terminate_handler () at
> ../../../../../libstdc++-v3/libsupc++/vterminate.cc:48
> #5  0xfd7ff46cef6a in __cxxabiv1::__terminate (handler=0x1) at
> ../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38
> #6  0xfd7ff46cefb3 in std::terminate () at
> ../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
> #7  0xfd7ff46cf03e in __cxxabiv1::__cxa_rethrow () at
> ../../../../../libstdc++-v3/libsupc++/eh_throw.cc:116
> #8  0xfd7ff46d1af6 in __gnu_cxx::__verbose_terminate_handler () at
> ../../../../../libstdc++-v3/libsupc++/vterminate.cc:78
> #9  0xfd7ff46cef6a in __cxxabiv1::__terminate (handler=0x1) at
> ../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38
> #10 0xfd7ff46cefb3 in std::terminate () at
> ../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
> #11 0xfd7ff46cf0b6 in __cxxabiv1::__cxa_throw (obj= optimized out>, tinfo=, dest= out>)
>    at ../../../../../libstdc++-v3/libsupc++/eh_throw.cc:83
> #12 0xfd7ff4a22fd8 in py_to_agg_transformation_matrix
> (obj=0x774380, errors=) at
> src/agg_py_transforms.cpp:22
> #13 0xfd7ff4a32e7c in _path_module::update_path_extents
> (this=, args=...) at src/path.cpp:380
> #14 0xfd7ff4a34d90 in
> Py::ExtensionModule<_path_module>::invoke_method_varargs (this= optimized out>,
>    method_def=, args=...) at
> ./CXX/Python2/ExtensionModule.hxx:184
> #15 0xfd7ff4a209b7 in Py::method_varargs_call_handler
> (_self_and_name_tuple=, _args= out>)
>    at CXX/Python2/cxx_extensions.cxx:1714
> #16 0x004a6071 in call_function (f=0x2024770, throwflag= optimized out>)
>    at /usr/local/src/lang/Python-2.7.1/Python/ceval.c:4012
> #17 PyEval_EvalFrameEx (f=0x2024770, throwflag=)
> at /usr/local/src/lang/Python-2.7.1/Python/ceval.c:2665
> #18 0x004a79c1 in PyEval_EvalCodeEx (co=0x124e230,
> globals=, locals=,
> args=0x2024910,
>    argcount=, kws=0x3, kwcount=2,
> defs=0x155c888, defcount=3, closure=0x0)
>

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help in solving a segfault problem?

2011-03-13 Thread Nicolas SCHEFFER
Thanks much for the reply!
I'll try your advice as soon as I can.

BTW, I don't think this is a Solaris-related problem.
If you look at the pointers in my original post, the same error can
happen on other arch (I confess it can be for other reasons though).

-n

On Sun, Mar 13, 2011 at 1:03 PM, Jouni K. Seppänen  wrote:
> Nicolas SCHEFFER  writes:
>
>> I didn't get much reply on this issue, so I'm just trying to resurrect
>> the question.
>
> Probably not many devs using Solaris, so no-one has been able to
> reproduce this.
>
>>> #12 0xfd7ff4a22fd8 in py_to_agg_transformation_matrix
>>> (obj=0x774380, errors=) at
>>> src/agg_py_transforms.cpp:22
>>> #13 0xfd7ff4a32e7c in _path_module::update_path_extents
>>> (this=, args=...) at src/path.cpp:380
>
> So it's in transforms-related code, but we can't see the locals. First
> I'd try to recompile without optimizations and (hoping it still crashes)
> inspect the local variables in these frames in gdb. Or maybe make the
> functions print out their arguments and any other relevant locals.
>
> --
> Jouni K. Seppänen
> http://www.iki.fi/jks
>
>
> --
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help in solving a segfault problem?

2011-03-19 Thread Nicolas SCHEFFER
Hi all,
So I tried what was advised to me.
python -c 'import pylab; pylab.plot([4]);'
terminate called after throwing an instance of 'std::exception'
terminate called recursively
Abort

which happens here:
 14 agg::trans_affine
 15 py_to_agg_transformation_matrix(PyObject* obj, bool errors = true)
 16 {
 17 PyArrayObject* matrix = NULL;
 18
 19 try
 20 {
 21 if (obj == Py_None)
 22 throw std::exception();

Since I compiled w/o optimization flags I have this now:
#11 0xfd7ff46cf0b6 in __cxxabiv1::__cxa_throw (obj=, tinfo=,
dest=) at
../../../../../libstdc++-v3/libsupc++/eh_throw.cc:83
#12 0xfd7ff4a3c708 in py_to_agg_transformation_matrix
(obj=0x774380, errors=false) at src/agg_py_transforms.cpp:22
#13 0xfd7ff4a4132e in _path_module::update_path_extents
(this=0x144e230, args=...) at src/path.cpp:380
#14 0xfd7ff4a537ce in
Py::ExtensionModule<_path_module>::invoke_method_varargs
(this=0x144e230, method_def=0x14009b0,
args=...) at ./CXX/Python2/ExtensionModule.hxx:184
#15 0xfd7ff4a389df in Py::method_varargs_call_handler
(_self_and_name_tuple=0x1244170, _args=0x1977fb0)
at CXX/Python2/cxx_extensions.cxx:1714
#16 0x004a6071 in call_function (f=0x201e980, throwflag=)
at /usr/local/src/lang/Python-2.7.1/Python/ceval.c:4012
#17 PyEval_EvalFrameEx (f=0x201e980, throwflag=)
at /usr/local/src/lang/Python-2.7.1/Python/ceval.c:2665
#18 0x004a79c1 in PyEval_EvalCodeEx (co=0x123a130,
globals=, locals=,
args=0x201eb20, argcount=, kws=0x3,
kwcount=2, defs=0x12467e8, defcount=3, closure=0x0)
at /usr/local/src/lang/Python-2.7.1/Python/ceval.c:3252

The function has now obj=0x774380 as an argument instead of 

So what is generating a PyNull object is in src/path.cpp:380
but this file doesn't exist! If I look in _path.cpp though this is
where it fails:
360 ::get_path_extents(path, trans, &extents_data[0],
&extents_data[1],
361&extents_data[2], &extents_data[3],
&xm, &ym);

I have no idea how to debug this since it seems the problem are in the
CXX extensions (calls to ceval.c)

Any idea how I can narrow down the problem?

Thanks!


On Sun, Mar 13, 2011 at 6:18 PM, Nicolas SCHEFFER
 wrote:
> Thanks much for the reply!
> I'll try your advice as soon as I can.
>
> BTW, I don't think this is a Solaris-related problem.
> If you look at the pointers in my original post, the same error can
> happen on other arch (I confess it can be for other reasons though).
>
> -n
>
> On Sun, Mar 13, 2011 at 1:03 PM, Jouni K. Seppänen  wrote:
>> Nicolas SCHEFFER  writes:
>>
>>> I didn't get much reply on this issue, so I'm just trying to resurrect
>>> the question.
>>
>> Probably not many devs using Solaris, so no-one has been able to
>> reproduce this.
>>
>>>> #12 0xfd7ff4a22fd8 in py_to_agg_transformation_matrix
>>>> (obj=0x774380, errors=) at
>>>> src/agg_py_transforms.cpp:22
>>>> #13 0xfd7ff4a32e7c in _path_module::update_path_extents
>>>> (this=, args=...) at src/path.cpp:380
>>
>> So it's in transforms-related code, but we can't see the locals. First
>> I'd try to recompile without optimizations and (hoping it still crashes)
>> inspect the local variables in these frames in gdb. Or maybe make the
>> functions print out their arguments and any other relevant locals.
>>
>> --
>> Jouni K. Seppänen
>> http://www.iki.fi/jks
>>
>>
>> --
>> Colocation vs. Managed Hosting
>> A question and answer guide to determining the best fit
>> for your organization - today and in the future.
>> http://p.sf.net/sfu/internap-sfd2d
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 3d Surface-Contour Plot

2011-03-28 Thread Nicolas Bigaouette
On Mon, Mar 14, 2011 at 9:05 AM, herbie13  wrote:

>
> Hello,
>
> I basically have a Chi-Squared distribution that is dependent on 3
> variables.
> eg. X2(x, y, z)
>
> What I would like to do is be able to plot the chi-squared + 1 surface in
> 3-dimensions.
> eg. I would like to have the three axes as x, y and z. and then have a
> surface (its going to look like a closed blob effectively) that maps the
> chi-squared plus one surface.
>
> I have no idea how to do this though. Is it possible? any ideas?
>

I think matplotlib is relatively limited in its 3D capabilities. I would
suggest trying Mayavi2 with a contour3d[1] or a volume[2,3]. Look here[4]
for many examples.

[1]
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#enthought.mayavi.mlab.contour3d
[2]
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_chemistry.html#example-chemistry
[3]
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_protein.html#example-protein
[4]
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/examples.html
--
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] Bug in xscale? Or wrong way to plot log x-axis scale with negative values?

2011-06-03 Thread Nicolas Bigaouette
Hi all,

I'm plotting data which extent, in x, from -1000 to 1000. But I'm only
interested in the values between x = -1 and 0.

I also want to plot on an x log scale. But since the x-values are negative,
I cannot use xscale("log"). I can use xscale("symlog") though and this is
the behaviour I want.

Unfortunately, "symlog" seems to be broken. I cannot use the linthreshx
argument with a value of less then 2 (the default?). But since I'm
interested in x values from -1 to 0, I have to use that argument and set it
to something like 1e-5 or even smaller.

If I set linthreshx to something smaller then 1, the plot breaks. Here is a
simple example, taken from
http://stackoverflow.com/questions/3305865/what-is-the-difference-between-log-and-symlog

> import numpy
> from matplotlib import pyplot
>
> # Enable interactive mode
> pyplot.ion()
>
> # Draw the grid lines
> pyplot.grid(True)
>
> # Numbers from -50 to 50, with 0.1 as step
> xdomain = numpy.arange(-50,50, 0.1)
>
> # Plots a simple linear function 'f(x) = x'
> pyplot.plot(xdomain, xdomain)
> # Plots 'sin(x)'
> pyplot.plot(xdomain, numpy.sin(xdomain))
>
> pyplot.xscale('symlog', linthreshx=0.1)
>

The problem seems to be that, on the x-axis, 0 is actually 10^0 = 1, not 0.
Putting something smaller then 1 will make the line go back and the axis
values are wrong (when hovering with the mouse and getting the x value).

I might not be using the right tool though, but how to achieve what I want?
I want the x axis to look like:
-10^2-10^1-10^0    -10^-1-10^-2-10^-3   ... [up to my
defined minimum exponent] ... 10^-310^-210^-110^010^1
10^2

Thank you

Nicolas
--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3D surface: Updating data?

2006-12-26 Thread Nicolas Bigaouette
Hi,

I've been using matplotlib for 2D graphing since two years. Data (3D
array) is created with a Fortran program and ploted using imshow() at a
particular plane.

3D data is created at each time iteration and saved in a file. For the
plotting part, a first imshow() is called with zero values to create the
graph and some text is displayed to describe the graph. Then the python
script read the 3D data and update the graphic using set_data(). That
way, only the "background" image is updated and not the entire graph,
resulting in a faster drawing. At each iteration, a png is saved, giving
the possibility to create a movie of the time evolution.

I would like now to replace the 2D imshow() with the 3D surface_plot().
Saddly, I cannot find a 3D equivalent to set_data(). I get the following
error :
> Traceback (most recent call last):
>   File "./src/affichage/affichage_3DE.py", line 450, in updatefig
> im_ez.set_data(Z)
>   File "/usr/lib/python2.4/site-packages/matplotlib/art3d.py", line 47, in 
> __getattr__
> return getattr(self.__dict__['_wrapped'], k)
> AttributeError: PolyCollection instance has no attribute 'set_data'

So my question is:
Is there a equivalent of set_data() for surface_plot()?

Thank you very much.

Nicolas

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 3D surface: Updating data?

2007-01-04 Thread Nicolas Bigaouette
Anyone? :(

 Message original 
Sujet: 3D surface: Updating data?
Date: Thu, 21 Dec 2006 11:28:43 -0500
De: Nicolas Bigaouette <[EMAIL PROTECTED]>
Pour: matplotlib-users@lists.sourceforge.net

Hi,

I've been using matplotlib for 2D graphing since two years. Data (3D
array) is created with a Fortran program and ploted using imshow() at a
particular plane.

3D data is created at each time iteration and saved in a file. For the
plotting part, a first imshow() is called with zero values to create the
graph and some text is displayed to describe the graph. Then the python
script read the 3D data and update the graphic using set_data(). That
way, only the "background" image is updated and not the entire graph,
resulting in a faster drawing. At each iteration, a png is saved, giving
the possibility to create a movie of the time evolution.

I would like now to replace the 2D imshow() with the 3D surface_plot().
Saddly, I cannot find a 3D equivalent to set_data(). I get the following
error :
> Traceback (most recent call last):
>   File "./src/affichage/affichage_3DE.py", line 450, in updatefig
> im_ez.set_data(Z)
>   File "/usr/lib/python2.4/site-packages/matplotlib/art3d.py", line 47, in 
> __getattr__
> return getattr(self.__dict__['_wrapped'], k)
> AttributeError: PolyCollection instance has no attribute 'set_data'

So my question is:
Is there a equivalent of set_data() for surface_plot()?

Thank you very much.

Nicolas

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Subplot order

2007-01-15 Thread Nicolas Bigaouette
Hi,

I want to compare data and I am doing so with subplots. Ideally, I would
like the subplot command to fill the columns before filling the rows as
it is doing right now.
Now:
subpot(221) = 1st row, 1st column
subpot(222) = 1st row, 2nd column
subpot(223) = 2nd row, 1st column
subpot(224) = 2nd row, 2nd column
I'd like :
subpot(221) = 1st row, 1st column
subpot(222) = 2nd row, 1st column
subpot(223) = 1st row, 2nd column
subpot(224) = 2nd row, 2nd column

Anyone knows if this is possible?

Thank you.

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


  1   2   >