Hi
It has been reported in
http://matplotlib.1069221.n5.nabble.com/How-to-properly-use-path-Path-contains-point-td40718.htmlbut
I do not see anything has happened after this.
Following code illustrates the problem, when polygon defined in one
direction, I can check if point is inside it, if other direction, I can
not.

from matplotlib.patches import Polygon

poly1=Polygon([[0.,0.],[1.,0.],[1.,1.],[0.,1.]],facecolor='none')
print(poly1.contains_point([0.5,0.5]))

poly2=Polygon([[0.,0.],[0.,1.],[1.,1.],[1.,0.]],facecolor='none')
print(poly2.contains_point([0.5,0.5]))
print(poly2.contains_point([-0.5,-0.5]))

I do not see an obvious reason why polygons should be defined in one
direction only.

I have tried the code with several versions of matplotlib, newest is 1.3.1
with numpy 1.8 and python 3.2.3 and all newer versions do not work as I
would accept them. Only the oldest version, python2.6.6 with matplotlib
0.99.1.1 gives me correct answer.

I have digged in the source code and ended up in file _path.cpp where the
function point_in_path_impl seems to do the actual job, but understanding
it completely seems to take more time than I have at the moment.

Any feedback appreciated.

Andres
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to