Skip to content Skip to sidebar Skip to footer

Matplotlib Path Contains_point

I've just discovered the matplotlib path functionality and I'm using it with path.contains_point to check whether points are found within a region defined by 2 bezier curves. I'm

Solution 1:

You have an open path (extra moveto command). Once you comment it out, it works fine.

path_data = [
    (mplPath.Path.MOVETO, (2, 10)),
    (mplPath.Path.CURVE4, (0, 100)),
    (mplPath.Path.CURVE4, (20, 100)),
    (mplPath.Path.CURVE4, (40, 150)),
  #  (mplPath.Path.MOVETO, (40, 150)),
    (mplPath.Path.CURVE4, (42, 45)),
    (mplPath.Path.CURVE4, (20, 30)),
    (mplPath.Path.CURVE4, (2, 10))
    ]

Post a Comment for "Matplotlib Path Contains_point"