I have to sample and plot three functions: $f(x,y)=cos(\pi x /2)$, $g(x,y)=2-x^2$ and $r(x,y)=3x$ in the range x
and y
in [-1;1]
.
I want to make their density plots with a single ColorFunction
to be applied to all: $0<=f(x,y)<=1$, $1<=g(x,y)<=2$, $-3<=r(x,y)<=3$.
All three density plots should be displayed with BarLegend
scaled to [-1,1]
with natural clipping. I have tried to do this in the following way:
F = Table[Cos[k*(Pi/2)], {j, -1.0, 1.0, 0.01}, {k, -1.0, 1.0, 0.01}];
G = Table[2 - k*k, {j, -1.0, 1.0, 0.01}, {k, -1.0, 1.0, 0.01}];
R = Table[3.0*k, {j, -1.0, 1.0, 0.01}, {k, -1.0, 1.0, 0.01}];
ListDensityPlot[F, ColorFunction -> "BlueGreenYellow",
PlotLegends -> Placed[BarLegend[{Automatic, {-1, 1}}], After],
FrameLabel -> {{"x", None}, {"y", None}}, ClippingStyle -> Automatic]
ListDensityPlot[G, ColorFunction -> "BlueGreenYellow",
PlotLegends -> Placed[BarLegend[{Automatic, {-1, 1}}], After],
FrameLabel -> {{"x", None}, {"y", None}}, ClippingStyle -> Automatic]
ListDensityPlot[R, ColorFunction -> "BlueGreenYellow",
PlotLegends -> Placed[BarLegend[{Automatic, {-1, 1}}], After],
FrameLabel -> {{"x", None}, {"y", None}}, ClippingStyle -> Automatic]
But this affects only legend bars and does not affect the color functions of plots. How can I reach the result I need?
Thanks
on stack sites. You can take the site tour by clicking on the ribbon icons at the top-right of the page. $\endgroup$