[matplotlib-devel] mplot3d contour patch on tracker

2009-06-29 Thread Ryan Wagner
Hi, I submitted a new patch on the tracker. When I was playing with the contour 
routine in mplot3d and using the extend3d keyword it would error out. I've 
attached a sample program to display the error as well as the dataset I was 
using. Please feel free to contact me if there are any questions regarding this.

Ryan Wagner
Support/Consulting Engineer
Visual Numerics Inc.
[email protected]<mailto:[email protected]>


--
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Adding Shades Keyword to 3D routines.

2009-08-06 Thread Ryan Wagner
Ok, I forgot my attachments would be stripped. Links:

Output of surface3d_demo.py (should explain why I want this patch)
http://static.ryanjwagner.com/mpl_patches/lightSource.png
Example code
http://static.ryanjwagner.com/mpl_patches/surface3d_demo.py
Edited mpl source... just proof of concept... still has to be cleaned up.
http://static.ryanjwagner.com/mpl_patches/axes3d.py


Also, upon looking at colors.LightSource, I think this doesn't really need to 
be changed for 3D except it would only work for regularly spaced data... might 
be a nice enhancement to supply the X and Y arrays as well as Z so it can 
calculate gradients for irregularly spaced grids.
-Ryan


--
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Adding Shades Keyword to 3D routines.

2009-08-06 Thread Ryan Wagner
Hi Mike and John,
   I've got a question about the functionality about axes3d.plot_surface:
When I set the linewidths to 0 (in the patch I'm working on) I get an image 
looking like this:

http://static.ryanjwagner.com/mpl_patches/lw0.png

I don't think this looks correct to me, as I can still see the grid. I have a 
workaround in place so if linewidth=0 then the image looks like this:

http://static.ryanjwagner.com/mpl_patches/lw0_fix.png

Would you agree that this should be the expected functionality or should I 
leave this alone, or should it be a new keyword?


WRT to the previous conversation about the gradients, I have been wishing for 
that for a while myself, but I understand the difficulty in doing the 
interpolations. In my own work I end up interpolating the data much finer and 
it looks better since the polygons are so small you can't notice the single 
colored polys:

http://static.ryanjwagner.com/mpl_patches/animation.gif

But I think this looks even better now that I'm able to do it without the 
visible wiremesh.

-Ryan

--
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Adding Shades Keyword to 3D routines.

2009-08-06 Thread Ryan Wagner

> On Thu, Aug 6, 2009 at 4:11 PM, Ryan Wagner wrote:
>> When I set the linewidths to 0 (in the patch I'm working on) I get an image 
>> looking like this:
>>
>> http://static.ryanjwagner.com/mpl_patches/lw0.png
>>
>> I don't think this looks correct to me, as I can still see the grid. I have 
>> a workaround in place so if linewidth=0 then the image looks like this:
>>

>Does your workaround work for all supported backends, and with alpha
>less than 1?  If so, what is it?

I believe it will... it is to set the edgecolors (RGBA) of the polygons to that 
of the facecolors. I will certainly test it on all backends and with several 
test cases before submitting anything, but it looks promising so far!

>> http://static.ryanjwagner.com/mpl_patches/lw0_fix.png
>>
>> Would you agree that this should be the expected functionality or should I 
>> leave this alone, or should it be a new keyword?
>
> Perhaps leaving it as it is today for lw=0, but having your behavior
> be the result for lw=None?  I can see people wanting the very fine
> grid that lw=0 gives today, and lw=None to me seems to be very
> explicitly saying 'no lines'.

>Except that in typical mpl usage, None means use a default.
>For colors, 'none' (a string) means no color, so a line should not be
>drawn.  Elsewhere in mpl, lw=0 also means "don't draw it at all", so it
>seems right to me that it should do the same for 3-D.

Seems like we need more discussion about this... anyone else want to chime in? 
I do like Fernando's idea if only to not break backwards compatability...

>Eric

>
> Just an idea...
>
> Cheers,
>
> f
>
> ps - Congrats to all on the release!  You've all done an absolutely
> terriffic job, and the benefits are already becoming obvious with
> these new ideas and contributions.  We'll have to celebrate at scipy
> :)
>
> --
> 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-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


--
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Adding Shades Keyword to 3D routines.

2009-08-07 Thread Ryan Wagner
Wow, no kidding John, what a difference! Great work Mike!

-Original Message-
From: John Hunter [mailto:[email protected]] 
Sent: Friday, August 07, 2009 12:54 PM
To: Michael Droettboom
Cc: Reinier Heeres; Ryan Wagner; [email protected]
Subject: Re: [matplotlib-devel] Adding Shades Keyword to 3D routines.

On Fri, Aug 7, 2009 at 1:39 PM, Michael Droettboom wrote:

> I'm not sure if Gouraud triangles (as supported by Agg, PDF and PS) are
> really sufficient for drawing interpolated quad meshes, because of the
> effect described here:
>
> http://books.google.com/books?id=19SpFYj82owC&lpg=PA280&ots=r3gnxKn9As&dq=shading%20quadrilaterals%20with%20gouraud%20triangles&pg=PA281#v=onepage&q=&f=false
>
> Running quadmesh_demo.py, you can see some sharp edges between triangles in
> the same quad, but it's not too bad in all places.  If anyone has any ideas
> about how to ameliorate that effect, feel free to have a crack at it.  I
> just wanted to get a proof-of-concept starting point in before heading on
> vacation for a few days.

Wow -- hat tip to you!  With productivity like this, how can we afford
to lose you for a few days to vacation :-)

I had to run the example with mpl99 to appreciate the changes, since
you decreased the n from 56 to 12 to show off the effects of the
interpolation, and the interpolation with n=12 is about as visually
good as the grid w/o with n=56.  Very nice.

I don't have time to dig into the code now since I have some pressing
work stuff, but I look forward to doing a read-through over the
weekend.  Enjoy your vacation, but don't forget your computer graphics
texts and laptop -- I think lighting, shadows and several shaders
should get you through a few days on the beach  

BTW, it looks like the edges of the polys are aliased in the "masked"
side of the figure.  Have you noticed this?

JDH

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


Re: [matplotlib-devel] Adding Shades Keyword to 3D routines.

2009-08-07 Thread Ryan Wagner
Mike, do you see this on your side?

r...@ubuntu-desktop:~/matplotlib/examples/mplot3d$ python surface3d_demo.py 
*** glibc detected *** python: free(): invalid pointer: 0xbffb3d10 ***

-Original Message-
From: Michael Droettboom [mailto:[email protected]] 
Sent: Friday, August 07, 2009 1:00 PM
To: John Hunter
Cc: Reinier Heeres; Ryan Wagner; [email protected]
Subject: Re: [matplotlib-devel] Adding Shades Keyword to 3D routines.

John Hunter wrote:
>
> BTW, it looks like the edges of the polys are aliased in the "masked"
> side of the figure.  Have you noticed this?
>   
Yeah -- the right hand side is still using the old code path, which is 
aliased by default.

Cheers,
Mike

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


--
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Adding Shades Keyword to 3D routines.

2009-08-07 Thread Ryan Wagner
Works for me :)

--
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Support for Python 2.7?

2010-05-17 Thread Ryan Wagner
Does anyone know if/when MPL will be supported on Python 2.7? Thanks!
-Ryan

--

___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] HTML5 Matplotlib Backend

2010-07-19 Thread Ryan Wagner
(Michael Droettboom)

>> The display at the bottom that says "Cursor at: X, Y" is in pixels, not in

>> data units. ?It would be great if this could display data units, though

>> being general enough to support custom scales (eg. log) and projections (eg.

>> polar) may be tricky without making a round-trip to the server.



(Simon Ratcliffe)

>As you mentioned, the trick is in giving the client some view on how

>pixels should map to data values without fetching these for each mouse

>movement. For simple cartesian plots this is probably pretty

>straightforward. It is something we need to get working for our

>internal use so it should get solved at some stage.

I have accomplished this in one of my applications as follows:

Axes =figure.get_axes()
#The transform used in this axis is Composite Generic Transform, so get the two 
affine transformation matricies
MatrixA  = axes[0].transData.inverted()._a.get_matrix()
MatrixB  = axes[0].transData.inverted()._b.get_matrix()

I use an Ajax or WebSockets call to get MatrixA and MatrixB to the client 
(javascript) side, and then do the affine transform in the mousemove callback:

function ev_mousemove(ev){
if(affineMatrixPopulated){
   //First convert the browser coordinates to the form MPL uses
   var x, y, x2, y2;
   x = ev.clientX - canvas.offsetLeft;
   y = canvas.height - (ev.clientY - canvas.offsetTop);
  //Now it's just a couple matrix multiplications:
  // I flattened the Matrix when transferring from the server 
process, so affineMatrixA[2] is MatrixA[0,2]
  //  affineMatrixA[4] is MatrixA[1,1] etc...
   x2 = affineMatrixA[0] * x + affineMatrixA[1] * y + 
affineMatrixA[2];
   y2 = affineMatrixA[3] * x + affineMatrixA[4] * y + 
affineMatrixA[5];
   x2 = affineMatrixB[0] * x2 + affineMatrixB[1] * y2 + 
affineMatrixB[2];
   y2 = affineMatrixB[3] * x2 + affineMatrixB[4] * y2 + 
affineMatrixB[5];
   document.getElementById('cursor_info').innerText = "Cursor at: " 
+ x2 + "," + y2;
}
}

The simple affine transformation can be accomplished by leaving off the MatrixB 
part. Non affine will probably be similar to the above followed by a log or 
exponential operation.

Ryan Wagner  | Senior Technical Support Engineer |
Rogue Wave Software, Inc.
5500 Flatiron Parkway, Suite 200, Boulder, CO 80301
[email protected]<mailto:[email protected]>
www.roguewave.com

--
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel