I'm constructing a single contour showing the points in a plane that satisfy a function. The general form is
ContourPlot[f[x, y] == 0, {x, 0, .5}, {y, 0.2, .5}]
The function f
is an explicit but complicated formula that was generated from operations involving analytic integration and differentiation applied to a large algebraic function. It evaluates quite rapidly though, given values of its arguments.
My problem is that the plot takes an unduly long time to generate, perhaps 5 to 10 minutes. Also, and this may be related, the graphic object that it produces has a very large amount of data associated with it -- if I copy it as text and paste it into Word, it exceeds 10,000 pages! The text looks like it is describing how the function is evaluated (it includes function calls that are part of the definition of f), rather than a simple list of data points and formatting information. If I try to Show the output, to combine it with other graphics, it takes a long time to generate, as if it is recomputing the graph again. Also, I get a "Reformatting notebook" message any time I touch the object (e.g., to select it), and this takes maybe 15 or 20 seconds to go away. The plot itself isn't particularly complicated:
I can make a ContourPlot of a simple function (e.g., x^2+y^2==1
) and it plots quickly, and cut/paste it as text into Word occupies less than two pages.
f
, then? I'm not sure how someone can help withoutf
. PerhapsListContourPlot
? Welcome to mathematica.stackexchange, btw. $\endgroup$Evaluated -> True
to the plot, or if you defineg[x_, y_] = Simplify[f[x, y]]
and plot it instead? (Note, that's=
, not:=
.) $\endgroup$Simplify
to finish, and just used assignment off
tog
). Neither that norEvaluated->True
helped. I've now turned toListContourPlot
and I think that will work for me. I can make a grid of values sufficiently quickly and the ListContour provides a good representation of the contour I want. $\endgroup$ContourPlot
produces a correct contour for this function, so something is working correctly. I was hoping with this question to get insight into how Mma represents graphics, and what would cause it to represent it in terms of anything but the computed data and the associated formatting $\endgroup$