|
From: T J <tj...@gm...> - 2012-10-16 07:04:47
|
I'm interested in clipping the result of plt.contour (and plt.contourf) to a patch. However, QuadContourSet does not have a set_clip_path() method. Is there a way to do this? Here is an example plot that I have generated. http://imgur.com/pybIf For the curious, it plots contours of a function on the 2-simplex. The way I've gone about computing this is, unfortunately, convoluted. I generate a regular grid in 2D and treat each point as a projection of a 3D probability vector into 2D. Then, I invert the projection so that I have "distributions" and then compute the Z value for each point. The contours are then calculated, but now, I need to clip everything outside the triangle, as only points within the triangle correspond to actual distributions. Is there a more direct way to calculate contours on a restricted set? Thanks. |