Re: [matplotlib-devel] Interpolation in a triangular mesh (tri.Triangulation)

2012-10-29 Thread Ian Thomas
Hi Geoffroy

This will certainly be very useful.  I need to spend some time looking at
it and seeing how it would best fit within the matplotlib framework,
particularly as only a few days ago I committed to writing a triangular
grid interpolator for quad grids and it would be sensible to group these
interpolators together in some way.

I'll get back to you when I've had time to look at it.

Thanks for your efforts!
Ian


On 28 October 2012 20:17, GBillotey  wrote:

>Hi!
>
>
> I had recently to develop interpolators for a function defined at the nodes
> of a user-specified triangular mesh.
> (Beside interpolation, it can help producing higher-quality tricontour
> plots, using interpolation on a refined mesh and matplotlib tricontour
> function.)
>
> Being a regular user of matplotlib, I would be happy if it can be useful to
> others...
> The code is hosted here:
> https://github.com/GBillotey/trimesh-interpolator.git
>
>
> Please let me know if it this dev. can be useful and if the code needs some
> cleaning (I am not a computer scientist, only a mechanical engineer)
>
>
> Cheers,
> Geoffroy.
>
--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Test Failure: AttributeError: incompatible shape for a non-contiguous array

2012-10-29 Thread Benjamin Root
On Mon, Oct 29, 2012 at 1:51 AM, Patrick Marsh wrote:

> Greetings,
>
> I've banged my head against this problem for 2 days and have given up on
> figuring it out on my own…
>
> After updating numpy and matplotlib to the latest versions from github
> Saturday morning, I keep getting "AttributeError: incompatible shape for a
> non-contiguous array" errors all over the place when plotting. When I run
> tests on numpy, everything passes. When I run tests on matplotlib, I get 51
> errors, with a vast majority of them (possibly all) being the
> non-contiguous array errors. (Sample below)
>
> Any suggestions here? I'm totally stumped.
>
>
> PTM
>
>
>
I am guessing this is a problem introduced with NumPy.  I just tried the
tests with an older NumPy branch, and all seemed fine.  Now testing with
the most recent branch.

Ben Root
--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Test Failure: AttributeError: incompatible shape for a non-contiguous array

2012-10-29 Thread Benjamin Root
On Mon, Oct 29, 2012 at 9:16 AM, Benjamin Root  wrote:

>
>
> On Mon, Oct 29, 2012 at 1:51 AM, Patrick Marsh 
> wrote:
>
>> Greetings,
>>
>> I've banged my head against this problem for 2 days and have given up on
>> figuring it out on my own…
>>
>> After updating numpy and matplotlib to the latest versions from github
>> Saturday morning, I keep getting "AttributeError: incompatible shape for a
>> non-contiguous array" errors all over the place when plotting. When I run
>> tests on numpy, everything passes. When I run tests on matplotlib, I get 51
>> errors, with a vast majority of them (possibly all) being the
>> non-contiguous array errors. (Sample below)
>>
>> Any suggestions here? I'm totally stumped.
>>
>>
>> PTM
>>
>>
>>
> I am guessing this is a problem introduced with NumPy.  I just tried the
> tests with an older NumPy branch, and all seemed fine.  Now testing with
> the most recent branch.
>
> Ben Root
>

Confirming the bug (and it appears to be happening at a spot that I updated
a couple years ago to catch exactly these sort of situations where
reshaping would result in a copy when we didn't want a copy).

I am presuming that it is a NumPy bug and will report it as such to the
numpy list.

Cheers!
Ben Root
--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Misalignment imshow vs. grid lines

2012-10-29 Thread Nicolas Rougier
Hi,I tried to plot a grid over a small image (24x24) and some grid lines are mis-aligned, can anybody confirm the behavior ?Here is a sample script:import numpy as npimport matplotlib.pyplot as pltn = 16fig = plt.figure(figsize=(10,10))Z = np.array(([0,1]*(n//2) + [1,0]*(n//2))*(n//2)).reshape(n,n)plt.imshow(Z, interpolation='nearest', cmap=plt.cm.gray, extent=[0,n,0,n], alpha=.25)plt.xticks(np.arange(0,n), [])plt.yticks(np.arange(0,n), [])plt.grid(ls='solid')plt.show()Here is a sample output (it's worse on screen):Nicolas--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Misalignment imshow vs. grid lines

2012-10-29 Thread jules hummon
Nicolas

I get that too, (with your script and various things in my work).
But if you zoom in, the lines are in the right place.   Is it
some kind of screen aliasing?

Jules

--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Test Failure: AttributeError: incompatible shape for a non-contiguous array

2012-10-29 Thread Patrick Marsh
Just a follow up for historical sake:

This is a bug in numpy and was introduced in this commit:
https://github.com/numpy/numpy/commit/c48156dfdc408f0a1e59ef54ac490cccbd6b8d73

I've filed a ticket with Numpy and those interested can follow up here:
https://github.com/numpy/numpy/issues/2700


PTM

---
Patrick Marsh
Ph.D. Candidate / Liaison to the HWT
School of Meteorology / University of Oklahoma
Cooperative Institute for Mesoscale Meteorological Studies
National Severe Storms Laboratory
http://www.patricktmarsh.com



On Mon, Oct 29, 2012 at 8:46 AM, Benjamin Root  wrote:

>
>
> On Mon, Oct 29, 2012 at 9:16 AM, Benjamin Root  wrote:
>
>>
>>
>> On Mon, Oct 29, 2012 at 1:51 AM, Patrick Marsh 
>> wrote:
>>
>>> Greetings,
>>>
>>> I've banged my head against this problem for 2 days and have given up on
>>> figuring it out on my own…
>>>
>>> After updating numpy and matplotlib to the latest versions from github
>>> Saturday morning, I keep getting "AttributeError: incompatible shape for a
>>> non-contiguous array" errors all over the place when plotting. When I run
>>> tests on numpy, everything passes. When I run tests on matplotlib, I get 51
>>> errors, with a vast majority of them (possibly all) being the
>>> non-contiguous array errors. (Sample below)
>>>
>>> Any suggestions here? I'm totally stumped.
>>>
>>>
>>> PTM
>>>
>>>
>>>
>> I am guessing this is a problem introduced with NumPy.  I just tried the
>> tests with an older NumPy branch, and all seemed fine.  Now testing with
>> the most recent branch.
>>
>> Ben Root
>>
>
> Confirming the bug (and it appears to be happening at a spot that I
> updated a couple years ago to catch exactly these sort of situations where
> reshaping would result in a copy when we didn't want a copy).
>
> I am presuming that it is a NumPy bug and will report it as such to the
> numpy list.
>
> Cheers!
> Ben Root
>
>
--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Misalignment imshow vs. grid lines

2012-10-29 Thread Nicolas Rougier


Thanks for testing.

If I zoom at any line cross, the lines are definitely at the wrong place for me.
As for screen aliasing I'm not sure since both the png and pdf seems to be 
wrong in my case.
Weird !


Nicolas


On Oct 29, 2012, at 15:40 , jules hummon wrote:

> Nicolas
> 
> I get that too, (with your script and various things in my work).
> But if you zoom in, the lines are in the right place.   Is it
> some kind of screen aliasing?
> 
> Jules
> 
> --
> The Windows 8 Center - In partnership with Sourceforge
> Your idea - your app - 30 days.
> Get started!
> http://windows8center.sourceforge.net/
> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
> ___
> Matplotlib-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Misalignment imshow vs. grid lines

2012-10-29 Thread Benjamin Root
On Mon, Oct 29, 2012 at 11:25 AM, Nicolas Rougier
wrote:

>
>
> Thanks for testing.
>
> If I zoom at any line cross, the lines are definitely at the wrong place
> for me.
> As for screen aliasing I'm not sure since both the png and pdf seems to be
> wrong in my case.
> Weird !
>
>
>
Which version of matplotlib are you using, just for reference.

Ben Root
--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Misalignment imshow vs. grid lines

2012-10-29 Thread Nicolas Rougier


matplotlib 1.2.x
python 2.7.2
osx10.7.5


Nicolas

On Oct 29, 2012, at 16:29 , Benjamin Root wrote:

> 
> 
> On Mon, Oct 29, 2012 at 11:25 AM, Nicolas Rougier  
> wrote:
> 
> 
> Thanks for testing.
> 
> If I zoom at any line cross, the lines are definitely at the wrong place for 
> me.
> As for screen aliasing I'm not sure since both the png and pdf seems to be 
> wrong in my case.
> Weird !
> 
> 
> 
> Which version of matplotlib are you using, just for reference.
> 
> Ben Root
> 


--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Delaying rc3 (again)

2012-10-29 Thread Michael Droettboom
Just a quick note: Given the severe weather approaching this area, I 
won't have a chance to test and get out an 1.2.0rc3 candidate until at 
least Thursday.

Mike

--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Misalignment imshow vs. grid lines

2012-10-29 Thread gary ruben
I also see this in mpl 1.1.0, python 2.7.2 with the iPython Qt console
and also with the WXAgg backend

Gary R.

On 30 October 2012 03:16, Nicolas Rougier  wrote:
>
>
> matplotlib 1.2.x
> python 2.7.2
> osx10.7.5
>
>
> Nicolas
>
> On Oct 29, 2012, at 16:29 , Benjamin Root wrote:
>
>>
>>
>> On Mon, Oct 29, 2012 at 11:25 AM, Nicolas Rougier  
>> wrote:
>>
>>
>> Thanks for testing.
>>
>> If I zoom at any line cross, the lines are definitely at the wrong place for 
>> me.
>> As for screen aliasing I'm not sure since both the png and pdf seems to be 
>> wrong in my case.
>> Weird !
>>
>>
>>
>> Which version of matplotlib are you using, just for reference.
>>
>> Ben Root
>>
>
>
> --
> The Windows 8 Center - In partnership with Sourceforge
> Your idea - your app - 30 days.
> Get started!
> http://windows8center.sourceforge.net/
> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
> ___
> Matplotlib-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Misalignment imshow vs. grid lines

2012-10-29 Thread Jae-Joon Lee
On Tue, Oct 30, 2012 at 12:25 AM, Nicolas Rougier
 wrote:
>
>
> Thanks for testing.
>
> If I zoom at any line cross, the lines are definitely at the wrong place for 
> me.

As  jules hummon commented, I see lines in right places when I zoom in.

> As for screen aliasing I'm not sure since both the png and pdf seems to be 
> wrong in my case.

It still can be some aliasing-related issue. Note that with
interpolation="nearest", the images are rasterized with given dpi even
if you save the figure as pdf.
The agg backend tries to adjust the location of lines and images so
that they are well-aligned with the pixels, and the issue seems to be
related with that behavior.

In my case, using interpolation="none" worked out okay. So give it a try.

Regards,

-JJ


> Weird !
>
>
> Nicolas
>
>
> On Oct 29, 2012, at 15:40 , jules hummon wrote:
>
>> Nicolas
>>
>> I get that too, (with your script and various things in my work).
>> But if you zoom in, the lines are in the right place.   Is it
>> some kind of screen aliasing?
>>
>> Jules
>>
>> --
>> The Windows 8 Center - In partnership with Sourceforge
>> Your idea - your app - 30 days.
>> Get started!
>> http://windows8center.sourceforge.net/
>> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
>> ___
>> Matplotlib-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
>
> --
> The Windows 8 Center - In partnership with Sourceforge
> Your idea - your app - 30 days.
> Get started!
> http://windows8center.sourceforge.net/
> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
> ___
> Matplotlib-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Misalignment imshow vs. grid lines

2012-10-29 Thread Nicolas Rougier


You're right. Using 'none' interpolation seems to solve the problem. Good to 
know !

One last question, why is the 'none' interpolation restricted to Agg/PS/pdf ?


Nicolas



On Oct 30, 2012, at 6:53 , Jae-Joon Lee wrote:

> On Tue, Oct 30, 2012 at 12:25 AM, Nicolas Rougier
>  wrote:
>> 
>> 
>> Thanks for testing.
>> 
>> If I zoom at any line cross, the lines are definitely at the wrong place for 
>> me.
> 
> As  jules hummon commented, I see lines in right places when I zoom in.
> 
>> As for screen aliasing I'm not sure since both the png and pdf seems to be 
>> wrong in my case.
> 
> It still can be some aliasing-related issue. Note that with
> interpolation="nearest", the images are rasterized with given dpi even
> if you save the figure as pdf.
> The agg backend tries to adjust the location of lines and images so
> that they are well-aligned with the pixels, and the issue seems to be
> related with that behavior.
> 
> In my case, using interpolation="none" worked out okay. So give it a try.
> 
> Regards,
> 
> -JJ
> 
> 
>> Weird !
>> 
>> 
>> Nicolas
>> 
>> 
>> On Oct 29, 2012, at 15:40 , jules hummon wrote:
>> 
>>> Nicolas
>>> 
>>> I get that too, (with your script and various things in my work).
>>> But if you zoom in, the lines are in the right place.   Is it
>>> some kind of screen aliasing?
>>> 
>>> Jules
>>> 
>>> --
>>> The Windows 8 Center - In partnership with Sourceforge
>>> Your idea - your app - 30 days.
>>> Get started!
>>> http://windows8center.sourceforge.net/
>>> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
>>> ___
>>> Matplotlib-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>> 
>> 
>> --
>> The Windows 8 Center - In partnership with Sourceforge
>> Your idea - your app - 30 days.
>> Get started!
>> http://windows8center.sourceforge.net/
>> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
>> ___
>> Matplotlib-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel