2
$\begingroup$

I want to combine the features of the functions DensityPlot and ParametricPlot. That is, I have three functions $f(x,y)$, $g(x,y)$ and $h(x,y)$. I want to create a density plot that shows a color representing the magnitude of $h(x,y)$ at a point described by $(f(x,y), g(x,y))$ for some range of the input parameters x and y.

I have all the data analytically, so I would rather not like to use ListDensityPlot, since it takes a long time to create enough data for a useful plot and there is also some annoying extrapolation going on. (See also here.)

Is there anything built in I have overlooked? Is there an easy way to implement what I'm trying to do? Thanks for all suggestions!

$\endgroup$
3
  • $\begingroup$ DensityPlot[h[f[x, y], g[x, y]], {x, -4, 4}, {y, -4, 4}]? $\endgroup$
    – kglr
    Commented Apr 5, 2018 at 13:41
  • $\begingroup$ No, that's not what I meant. I want to evaluate all the functions at {x,y} but plot the corresponding point at the position {f[x,y], g[x,y]}. I should say that while I have the functions in an analytical form, I don't want to invert them as that is going to be messy for sure. $\endgroup$ Commented Apr 5, 2018 at 13:46
  • $\begingroup$ then, perhaps, DensityPlot[h[x, y], {x, -4, 4}, {y, -4, 4}] /. GraphicsComplex[a_, b___] :> GraphicsComplex[a /. {x_, y_} :> {f[x, y], g[x, y]}, b]? $\endgroup$
    – kglr
    Commented Apr 5, 2018 at 13:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.