3

Lets say I want to plot a 2D contour, with a set of points that do not form a rectangle necessarily (a trapezoid for instance, or a quadrilateral element). the shape is defined through a set of points with coordinates (X,Y,Z), in which X and Y define the shape and Z defines the contour value.

X and Y define the shape, Z is contour value

How should I do it using a matplotlib module?

tmdavison
  • 64,360
  • 12
  • 187
  • 165
user3252955
  • 81
  • 1
  • 10
  • 1
    here's an example that masks portions of a contour plot: http://matplotlib.org/examples/pylab_examples/contour_corner_mask.html – Paul H Feb 20 '17 at 00:08
  • @PaulH Thank you for your respond. But it did not answer my question. I do not want to mask anything. I want to not plot excessive things since I want to generalize it for numerous elements. – user3252955 Feb 20 '17 at 00:23
  • 1
    you need to create a minimum working example of your data and what you've tried. I recommend browsing the image examples of the matplotlib documentation as they show how to clip images to arbitrary boundaries. I imaging the technique is similar for contours. – Paul H Feb 20 '17 at 03:17
  • 1
    so if I understand correctly, your data (x,y,z) tuples only provide information about the values *along* the boundaries. So the main question is how do you infer the values (colors) in the interior of the shape? – hitzg Feb 20 '17 at 13:18
  • @hitzg: Actually, the shape (both boundary and interiors) are available in the form of (x,y,z). lets say a set of 1,000 points define the geometry of the problem. – user3252955 Feb 21 '17 at 00:42
  • Are you saying that (x,y,z) define the values and shape, but you give an extra flag indicating which values are at the boundary? – divenex Mar 22 '17 at 18:44

0 Answers0