Re: [Matplotlib-users] CMYK

2013-01-30 Thread Jae-Joon Lee
I agree with Eric that what we need is a backend that support CMYK color
space.
But matplotlib may need to provide some framework for handling the color
profiles etc.

My limited experience with ps_myck backend (
https://github.com/leejjoon/mpl_ps_cmyk) suggests that, as far as
matplotlib provide some framework for color conversion,
implementing/modifying a backend to support cmyk should not be difficult.

So, yes, we need someone to write a MEP.

Regards,

-JJ



On Thu, Jan 31, 2013 at 4:30 AM, Eric Firing  wrote:

> On 2013/01/30 9:13 AM, Paul Kuin wrote:
> > For what it's worth.
> >
> > While the RGB system is native to monitor devices, since they produce
> > light of certain colours, CMYK is the colour system of printer
> > materials etc. since they absorb the colours, but reflect those we
> > see.  That means designs must be made in CMYK for pronter materials
> > and in RGB for our devices. The response of each medium or device is
> > different. RGB will have part of the colour space not accessible in
> > some devices, while in printed materials it is different again. The
> > basic thing is colour space, while RGB and CMYK can be seen as a map.
> > In the real world you have to look at the product to see if the
> > colours come out right.
> >
> > Not sure what to make of any implementation of this, but a simple
> > mapping should not be impossible.
>
> Granted, a mapping within the intersection of the two spaces
> respectively accessibly to RGB and CMYK is possible, but I think it
> makes more sense to do it as a separate operation on the ps or pdf file
> than to try to build it into mpl.  If it were to be built in, I think it
> would have to be bolted onto the ps and pdf backends.  I suspect that
> the alpha channel will make this quite complicated, much more so than a
> simple mapping; it will require an intermediate rendering step.
>
> Eric
>
> >
> > Cheers,
> >
> > Paul
> >
> > On Wed, Jan 30, 2013 at 6:38 PM, Eric Firing  wrote:
> >> On 2013/01/30 6:43 AM, Michael Droettboom wrote:
> >>> We don't currently have any support -- and we're still struggling in
> >>> certain areas supporting RGBA consistently across the system.
> >>>
> >>> I think this would take someone writing a MEP (as a preliminary study
> of
> >>> all of the changes that would be involved) and then shepherding it
> >>> through implementation.
> >>
> >> My somewhat vague recollection is that CMYK is fundamentally
> >> output-device dependent, and therefore it really doesn't make much sense
> >> for a plotting library to support it directly.  The conversion from RGBA
> >> should be made by the publisher, knowing what the output device
> >> characteristics are.
> >>
> >> Eric
> >>
> >>>
> >>> Mike
> >>>
> >>> On 01/30/2013 11:10 AM, Ignas Anikevičius wrote:
>  On 29/01/13 03:37:51 -0800, Dieter wrote:
> > I was wondering if anything changed regarding this within the last
> 2.5 years
> > since the last thread. Is there a way to produce CMYK with
> matplotlib?
>  Hello everybody,
> 
>  I would be also interested in how to produce CMYK graphics without
>  external fiddling.
> 
>  Cheers,
>  Ignas
>
>
>
> --
> 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_d2d_jan
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
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_d2d_jan___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] custom_scale_example.py

2013-01-30 Thread ztftom
Something wrong with the figure in the gallery: custom_scale_example.py
  It's
supposed to be a Mercator scale, but the figure shown is just a linear scale
plot.I also attached my plot.

Anyone who could confirm this? Thx!



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/custom-scale-example-py-tp40376.html
Sent from the matplotlib - users mailing list archive at Nabble.com.--
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_d2d_jan___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib.nxutils.pnpoly returns True for some vertexes, and False for others

2013-01-30 Thread Maria Liukis
Ben,

Many thanks! Will try to use shapely package then.

Masha

liu...@usc.edu




On Jan 30, 2013, at 6:59 AM, Benjamin Root wrote:

> 
> 
> On Tue, Jan 29, 2013 at 5:55 PM, Maria Liukis  wrote:
> Hello,
> 
> I tested the following code on my Mac laptop and our production Linux server 
> both running matplotlib V1.0.1. Both machines observe the same output from 
> the code, so I was wondering if somebody is aware of the problem or if it's 
> some undocumented feature of "pnpoly()" function from matplotlib.nxutils?
> 
> I use matplotlib.nxutils.pnpoly() function from matplotlib to determine if 
> point belongs to the polygon. 
> The following code:
> 
> >>> import numpy as np
> >>> import matplotlib.nxutils as nx
> >>> coords = np.array([[4.0, 1.0], [4.0, 4.0], [5.0, 5.0], [6.0, 4.0], [5.0, 
> >>> 0.0]])
> 
> >>> nx.pnpoly(4.0, 1.0, coords)
> 1
> >>> nx.pnpoly(4.0, 4.0, coords)
> 1
> >>> nx.pnpoly(5.0, 5.0, coords)
> 0
> >>> nx.pnpoly(6.0, 4.0, coords)
> 0
> >>> nx.pnpoly(5.0, 0.0, coords)
> 0
> 
> The question is why first two vertexes are considered to be inside of defined 
> polygon, and last 3 vertexes are not? My guess, it's treating the polygon as 
> a semi-open set, and I wonder if it can be changed to make all vertexes 
> inclusive?
> 
> Any help would be greatly appreciated.
> 
> Many thanks,
> Masha
> 
> The documentation for pnpoly() for that version states:
> 
> """
> A point on the boundary may be treated as inside or outside.
> See `pnpoly 
> `_
> """
> 
> Note that in version 1.2.0, the nxutils module was deprecated.  pnpoly() and 
> points_inside_poly() are now merely wrappers around the polygon's 
> implementations of point-testing, which differs from the nxutils' 
> implementation, so you may get slightly different results.
> 
> Do note that the point-testing algorithm in matplotlib was more geared for 
> visualization purposes rather than for strict geometric needs.  If you need a 
> more well-behaved point-tester (and faster if the polygon is "prepared"), use 
> the shapely package instead.
> 
> I hope that clears things up!
> 
> Cheers!
> Ben Root
> 

--
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_d2d_jan___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Problem with PatchCollection and FancyArrowPatch?

2013-01-30 Thread Skipper Seabold
Hi,

Trying to figure out why these two do not create the same plot. Bug or user
error?

import matplotlib.pyplot as plt
from matplotlib.patches import FancyArrowPatch
from matplotlib.collections import PatchCollection

def correct_patch(pos):
fig, ax = plt.subplots()
for src, dst in pos:
arrow = FancyArrowPatch(posA=src, posB=dst,
color='k', arrowstyle='-|>',
mutation_scale=30, connectionstyle="arc3")
ax.add_patch(arrow)
return fig

def patch_collection_problem(pos):
fig, ax = plt.subplots()
pos = [[(.5, .5), (.25, .25)],
   [(.1, .5), (.2, .75)]]
arrows = []
for src, dst in pos:
arrows.append(FancyArrowPatch(posA=src, posB=dst,
color='k', arrowstyle='-|>',
mutation_scale=30, connectionstyle="arc3"))
collection = PatchCollection(arrows, match_original=True)

ax.add_collection(collection, autolim=False)
return fig

pos = [[(.5, .5), (.25, .25)],
  [(.1, .5), (.2, .75)]]

correct_patch(pos)
patch_collection_problem(pos)
--
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_d2d_jan___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK

2013-01-30 Thread Eric Firing
On 2013/01/30 9:13 AM, Paul Kuin wrote:
> For what it's worth.
>
> While the RGB system is native to monitor devices, since they produce
> light of certain colours, CMYK is the colour system of printer
> materials etc. since they absorb the colours, but reflect those we
> see.  That means designs must be made in CMYK for pronter materials
> and in RGB for our devices. The response of each medium or device is
> different. RGB will have part of the colour space not accessible in
> some devices, while in printed materials it is different again. The
> basic thing is colour space, while RGB and CMYK can be seen as a map.
> In the real world you have to look at the product to see if the
> colours come out right.
>
> Not sure what to make of any implementation of this, but a simple
> mapping should not be impossible.

Granted, a mapping within the intersection of the two spaces 
respectively accessibly to RGB and CMYK is possible, but I think it 
makes more sense to do it as a separate operation on the ps or pdf file 
than to try to build it into mpl.  If it were to be built in, I think it 
would have to be bolted onto the ps and pdf backends.  I suspect that 
the alpha channel will make this quite complicated, much more so than a 
simple mapping; it will require an intermediate rendering step.

Eric

>
> Cheers,
>
> Paul
>
> On Wed, Jan 30, 2013 at 6:38 PM, Eric Firing  wrote:
>> On 2013/01/30 6:43 AM, Michael Droettboom wrote:
>>> We don't currently have any support -- and we're still struggling in
>>> certain areas supporting RGBA consistently across the system.
>>>
>>> I think this would take someone writing a MEP (as a preliminary study of
>>> all of the changes that would be involved) and then shepherding it
>>> through implementation.
>>
>> My somewhat vague recollection is that CMYK is fundamentally
>> output-device dependent, and therefore it really doesn't make much sense
>> for a plotting library to support it directly.  The conversion from RGBA
>> should be made by the publisher, knowing what the output device
>> characteristics are.
>>
>> Eric
>>
>>>
>>> Mike
>>>
>>> On 01/30/2013 11:10 AM, Ignas Anikevičius wrote:
 On 29/01/13 03:37:51 -0800, Dieter wrote:
> I was wondering if anything changed regarding this within the last 2.5 
> years
> since the last thread. Is there a way to produce CMYK with matplotlib?
 Hello everybody,

 I would be also interested in how to produce CMYK graphics without
 external fiddling.

 Cheers,
 Ignas


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


Re: [Matplotlib-users] CMYK

2013-01-30 Thread Paul Kuin
For what it's worth.

While the RGB system is native to monitor devices, since they produce
light of certain colours, CMYK is the colour system of printer
materials etc. since they absorb the colours, but reflect those we
see.  That means designs must be made in CMYK for pronter materials
and in RGB for our devices. The response of each medium or device is
different. RGB will have part of the colour space not accessible in
some devices, while in printed materials it is different again. The
basic thing is colour space, while RGB and CMYK can be seen as a map.
In the real world you have to look at the product to see if the
colours come out right.

Not sure what to make of any implementation of this, but a simple
mapping should not be impossible.

Cheers,

   Paul

On Wed, Jan 30, 2013 at 6:38 PM, Eric Firing  wrote:
> On 2013/01/30 6:43 AM, Michael Droettboom wrote:
>> We don't currently have any support -- and we're still struggling in
>> certain areas supporting RGBA consistently across the system.
>>
>> I think this would take someone writing a MEP (as a preliminary study of
>> all of the changes that would be involved) and then shepherding it
>> through implementation.
>
> My somewhat vague recollection is that CMYK is fundamentally
> output-device dependent, and therefore it really doesn't make much sense
> for a plotting library to support it directly.  The conversion from RGBA
> should be made by the publisher, knowing what the output device
> characteristics are.
>
> Eric
>
>>
>> Mike
>>
>> On 01/30/2013 11:10 AM, Ignas Anikevičius wrote:
>>> On 29/01/13 03:37:51 -0800, Dieter wrote:
 I was wondering if anything changed regarding this within the last 2.5 
 years
 since the last thread. Is there a way to produce CMYK with matplotlib?
>>> Hello everybody,
>>>
>>> I would be also interested in how to produce CMYK graphics without
>>> external fiddling.
>>>
>>> Cheers,
>>> Ignas
>>>
>>> --
>>> 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_d2d_jan
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>> --
>> 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_d2d_jan
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
> --
> 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_d2d_jan
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users



-- 

* * * * * * * * http://www.mssl.ucl.ac.uk/~npmk/ * * * *
Dr. N.P.M. Kuin  (n.k...@ucl.ac.uk)
phone +44-(0)1483 (prefix) -204256 (work) -276110 (home)
mobile +44(0)7806985366  skype ID: npkuin
Mullard Space Science Laboratory  – University College London  –
Holmbury St Mary – Dorking – Surrey RH5 6NT–  U.K.

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


Re: [Matplotlib-users] FigureCanvasQTAgg clean up

2013-01-30 Thread Benjamin Root
On Wed, Jan 30, 2013 at 1:46 PM, Mads Ipsen  wrote:

>  On 01/30/2013 05:03 PM, Benjamin Root wrote:
>
>
>
> On Tue, Jan 29, 2013 at 5:12 PM, Mads Ipsen  wrote:
>
>>  Hi,
>>
>> I spend some time writing up the question below on Stackoverflow which
>> immediately was closed as a duplicate of other posts. To my best knowledge,
>> these posts did not answer my questions - so I'll try my luck here instead:
>>
>> I am using the qt backengine for setting up a QWidget that embeds a
>> matplotlib scene. When the widget is closed it appears that many of the
>> matplotlib objects that were part of the plot still are alive in Python
>> space.
>>
>> My question is basically the following: What actions should I take to
>> clean up the figure and axes objects etc. that were part of the plot
>> widget? The qt backend comes with a figure manager, but it appears a little
>> unclear how it should be used.
>>
>> I have attached a small unit test example that sets up a plot. When the
>> plot appears, just close it, and the test will garbage collects the plot,
>> and then display info of the matplotlib objects that are still alive in
>> Python space. Clearly both the path of the plot, and several Bbox objects
>> are still referenced.
>>
>> Our current unit test suite contains almost 1 GUI tests and its
>> imperative that proper object space clean up is done after each test. Any
>> help is much appreciated.
>>
>> Best regards,
>>
>> Mads
>>
>
> Would "fig.clf()" do what you need?
>
> Ben Root
>
>   Thanks for the feedback.
>
> The trick is to get this done automatically when the widget is closed. If
> you look in backend_qt4.py in the constructor of FigureCanvasQT you'll find
>
>   QtCore.QObject.connect(self, QtCore.SIGNAL('destroyed()'),
> self.close_event)
>
> which should perform the steps below when close_event is called
>
>   event = CloseEvent(s, self, guiEvent=guiEvent)
>   self.callbacks.process(s, event)
>
> If I insert print statements, the signal is ignored with matplotlib 1.1.0,
> but called with 1.2.0 (which uses a lambda function in the above
> connection). But inspecting pythons objects after the close() method is
> called on the widget, it seems that - at least - the paths associated with
> plot actually still exist.
>
> So I'm just a bit worried if there already is existing functionality in
> the FigureCanvasQTAgg object that can do these things for me. And if so,
> how to use them?
>
> Best regards,
>
> Mads
>
>
Actually, now I am starting to recall a bug fix that came shortly after the
1.2.0 release related to properly setting up the destruction signal of the
QT figure object.  Could you test your code-base with the maintenance
branch (1.2.x)? or master?

Cheers!
Ben Root
--
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_d2d_jan___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plot with a shared y axis with two different x axes oriented in opposite directions.

2013-01-30 Thread Jonathan Slavin
Hi Darhas,

How did you invert the axis?  I find that it works for me to do:
ax.plot(x1,y1)
ax2 = ax.twiny()
ax2.plot(x2,y2)
ax2.invert_xaxis()

Jon

On Wed, 2013-01-30 at 16:45 +, Dharhas Pothina wrote:
> Hi All,
> 
> 
> I'm trying to recreate some plots from a old 1970's era report. This
> is a single plot with an elevation-capacity curve and an
> elevation-area curve overlaid on top of each other.
> 
> 
> The plot needs to have a shared y-axis (elevation). The
> elevation-capacity curve has an x-axis along the bottom that goes left
> to right. The elevation-area curve has a x-axis with a different scale
> that goes right to left along the top.
> 
> 
> I've tried using twiny and reversing the second x axis but that ends
> up reversing both. Any help would be appreciated. I've attached a low
> res image of one of the original plots for reference.
> 
> 
> Thanks,
> 
> 
> - dharhas



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


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


Re: [Matplotlib-users] FigureCanvasQTAgg clean up

2013-01-30 Thread Mads Ipsen

On 01/30/2013 05:03 PM, Benjamin Root wrote:



On Tue, Jan 29, 2013 at 5:12 PM, Mads Ipsen > wrote:


Hi,

I spend some time writing up the question below on Stackoverflow
which immediately was closed as a duplicate of other posts. To my
best knowledge, these posts did not answer my questions - so I'll
try my luck here instead:

I am using the qt backengine for setting up a QWidget that embeds
a matplotlib scene. When the widget is closed it appears that many
of the matplotlib objects that were part of the plot still are
alive in Python space.

My question is basically the following: What actions should I take
to clean up the figure and axes objects etc. that were part of the
plot widget? The qt backend comes with a figure manager, but it
appears a little unclear how it should be used.

I have attached a small unit test example that sets up a plot.
When the plot appears, just close it, and the test will garbage
collects the plot, and then display info of the matplotlib objects
that are still alive in Python space. Clearly both the path of the
plot, and several Bbox objects are still referenced.

Our current unit test suite contains almost 1 GUI tests and
its imperative that proper object space clean up is done after
each test. Any help is much appreciated.

Best regards,

Mads


Would "fig.clf()" do what you need?

Ben Root


Thanks for the feedback.

The trick is to get this done automatically when the widget is closed. 
If you look in backend_qt4.py in the constructor of FigureCanvasQT 
you'll find


  QtCore.QObject.connect(self, QtCore.SIGNAL('destroyed()'), 
self.close_event)


which should perform the steps below when close_event is called

  event = CloseEvent(s, self, guiEvent=guiEvent)
  self.callbacks.process(s, event)

If I insert print statements, the signal is ignored with matplotlib 
1.1.0, but called with 1.2.0 (which uses a lambda function in the above 
connection).But inspecting pythons objects after the close() method is 
called on the widget, it seems that - at least - the paths associated 
with plot actually still exist.


So I'm just a bit worried if there already is existing functionality in 
the FigureCanvasQTAgg object that can do these things for me. And if so, 
how to use them?


Best regards,

Mads




--
+-+
| Mads Ipsen  |
+--+--+
| Gåsebæksvej 7, 4. tv |  |
| DK-2500 Valby| phone:  +45-29716388 |
| Denmark  | email:  mads.ip...@gmail.com |
+--+--+

--
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_d2d_jan___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK

2013-01-30 Thread Eric Firing
On 2013/01/30 6:43 AM, Michael Droettboom wrote:
> We don't currently have any support -- and we're still struggling in
> certain areas supporting RGBA consistently across the system.
>
> I think this would take someone writing a MEP (as a preliminary study of
> all of the changes that would be involved) and then shepherding it
> through implementation.

My somewhat vague recollection is that CMYK is fundamentally 
output-device dependent, and therefore it really doesn't make much sense 
for a plotting library to support it directly.  The conversion from RGBA 
should be made by the publisher, knowing what the output device 
characteristics are.

Eric

>
> Mike
>
> On 01/30/2013 11:10 AM, Ignas Anikevičius wrote:
>> On 29/01/13 03:37:51 -0800, Dieter wrote:
>>> I was wondering if anything changed regarding this within the last 2.5 years
>>> since the last thread. Is there a way to produce CMYK with matplotlib?
>> Hello everybody,
>>
>> I would be also interested in how to produce CMYK graphics without
>> external fiddling.
>>
>> Cheers,
>> Ignas
>>
>> --
>> 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_d2d_jan
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> --
> 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_d2d_jan
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>


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


Re: [Matplotlib-users] CMYK

2013-01-30 Thread Michael Droettboom
We don't currently have any support -- and we're still struggling in 
certain areas supporting RGBA consistently across the system.

I think this would take someone writing a MEP (as a preliminary study of 
all of the changes that would be involved) and then shepherding it 
through implementation.

Mike

On 01/30/2013 11:10 AM, Ignas Anikevičius wrote:
> On 29/01/13 03:37:51 -0800, Dieter wrote:
>> I was wondering if anything changed regarding this within the last 2.5 years
>> since the last thread. Is there a way to produce CMYK with matplotlib?
> Hello everybody,
>
> I would be also interested in how to produce CMYK graphics without
> external fiddling.
>
> Cheers,
> Ignas
>
> --
> 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_d2d_jan
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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


Re: [Matplotlib-users] CMYK

2013-01-30 Thread Ignas Anikevičius
On 29/01/13 03:37:51 -0800, Dieter wrote:
> I was wondering if anything changed regarding this within the last 2.5 years
> since the last thread. Is there a way to produce CMYK with matplotlib?

Hello everybody,

I would be also interested in how to produce CMYK graphics without
external fiddling.

Cheers,
Ignas

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


Re: [Matplotlib-users] FigureCanvasQTAgg clean up

2013-01-30 Thread Benjamin Root
On Tue, Jan 29, 2013 at 5:12 PM, Mads Ipsen  wrote:

>  Hi,
>
> I spend some time writing up the question below on Stackoverflow which
> immediately was closed as a duplicate of other posts. To my best knowledge,
> these posts did not answer my questions - so I'll try my luck here instead:
>
> I am using the qt backengine for setting up a QWidget that embeds a
> matplotlib scene. When the widget is closed it appears that many of the
> matplotlib objects that were part of the plot still are alive in Python
> space.
>
> My question is basically the following: What actions should I take to
> clean up the figure and axes objects etc. that were part of the plot
> widget? The qt backend comes with a figure manager, but it appears a little
> unclear how it should be used.
>
> I have attached a small unit test example that sets up a plot. When the
> plot appears, just close it, and the test will garbage collects the plot,
> and then display info of the matplotlib objects that are still alive in
> Python space. Clearly both the path of the plot, and several Bbox objects
> are still referenced.
>
> Our current unit test suite contains almost 1 GUI tests and its
> imperative that proper object space clean up is done after each test. Any
> help is much appreciated.
>
> Best regards,
>
> Mads
>
>
Would "fig.clf()" do what you need?

Ben Root
--
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_d2d_jan___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib.nxutils.pnpoly returns True for some vertexes, and False for others

2013-01-30 Thread Benjamin Root
On Tue, Jan 29, 2013 at 5:55 PM, Maria Liukis  wrote:

> Hello,
>
> I tested the following code on my Mac laptop and our production Linux
> server both running matplotlib V1.0.1. Both machines observe the same
> output from the code, so I was wondering if somebody is aware of the
> problem or if it's some undocumented feature of "pnpoly()" function from
> matplotlib.nxutils?
>
> I use matplotlib.nxutils.pnpoly() function from matplotlib to determine
> if point belongs to the polygon.
> The following code:
>
> >>> import numpy as np
> >>> import matplotlib.nxutils as nx
> >>> coords = np.array([[4.0, 1.0], [4.0, 4.0], [5.0, 5.0], [6.0, 4.0],
> [5.0, 0.0]])
>
> >>> nx.pnpoly(4.0, 1.0, coords)
> 1
> >>> nx.pnpoly(4.0, 4.0, coords)
> 1
> >>> nx.pnpoly(5.0, 5.0, coords)
> 0
> >>> nx.pnpoly(6.0, 4.0, coords)
> 0
> >>> nx.pnpoly(5.0, 0.0, coords)
> 0
>
> The question is why first two vertexes are considered to be inside of
> defined polygon, and last 3 vertexes are not? My guess, it's treating the
> polygon as a semi-open set, and I wonder if it can be changed to make all
> vertexes inclusive?
>
> Any help would be greatly appreciated.
>
> Many thanks,
> Masha
>

The documentation for pnpoly() for that version states:

"""
A point on the boundary may be treated as inside or outside.
See `pnpoly <
http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html>`_
"""

Note that in version 1.2.0, the nxutils module was deprecated.  pnpoly()
and points_inside_poly() are now merely wrappers around the polygon's
implementations of point-testing, which differs from the nxutils'
implementation, so you may get slightly different results.

Do note that the point-testing algorithm in matplotlib was more geared for
visualization purposes rather than for strict geometric needs.  If you need
a more well-behaved point-tester (and faster if the polygon is "prepared"),
use the shapely package instead.

I hope that clears things up!

Cheers!
Ben Root
--
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_d2d_jan___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] FancyArrowPatch to edge of marker with known size?

2013-01-30 Thread Jae-Joon Lee
On Wed, Jan 30, 2013 at 7:11 AM, Skipper Seabold wrote:

> Say I have a marker with a known size in points and I want to draw an
> arrow to this point. How can I get the ends points for the arrow? As you
> can see in the below, it overlaps the markers. I want to go to the edge. I
> can use shrinkA and shrinkB to do what I want, but I don't see how they're
> related to the points size**.5. Or should I somehow do the transformation
> using the known angle between the two points and the point itself. I don't
> know how to translate a point in data coordinates and the offset it in a
> certain direction by size**.5 points. Can anyone help clear this up?
>

Can you elaborate why you cannot just use shrinkA and shrinkB?

arrows = FancyArrowPatch(posA=(x1, y1), posB=(x2, y2),
 color = 'k',
 arrowstyle="-|>",
 mutation_scale=700**.5,
 shrinkA=(700**.5)*.5, shrinkB=(700**.5)*.5,
 connectionstyle="arc3")

What the problem of doing above?

Note that the unit of shrinkA and shrinkB is points, and they are
independent of mutation_scale, which only affects the size of the arrow.

Regards,

-JJ
--
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_d2d_jan___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users