Benjamin Root, on 2011-01-27 13:04, wrote:
I believe he would rather call the core function that contour uses to
do the heavy lifting. This was something that one can do in matlab,
btw. I don't have access to the source right now. What does contour
call to perform this calculation?
matplotlib.contour.QuadContourSet - which in turn uses
ContourSet, and both take ax as a required argument. They use
matplotlib.contour._cntr which is
Daniel Fulger, on 2011-01-27 20:21, wrote:
no, I would like to suppress plotting entirely, avoid changing of
active figure and avoid handling figures or axis completely.
I m only interested in the contourset. I wonder if my post was
somehow sloppy.Yes, there are work-arounds like creating a dummy figure, similar to
your suggestion, and return focus to
the previously active figure. But plotting takes time and memory, is
not needed and requires several code lines. Once might be ok but
speed and memory is important.
Plotting with alpha=0 still requires figure and axis handling.So how can I switch off all figure and axis related actions and
savely call contourset = contour(x,y,...) that does nothing else than
return the contours?
I understand better now, but as far as I could tell from poking
inside the QuadContourSet code, there isn't a simple way to
call the underlying machinery which generates the contours.
You'll have to look at what QuadContourSet._contour_args
does internally to see what what x, y, z should be, and then
create a contour using
C = matplotlib.contour._cntr.Cntr(x,y,z)
and then for each level, do something like what
QuadContourSet._get_allsegs_and_allkinds does
C.trace(..)
best,
···
--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7