0
$\begingroup$

I was using the code as DensityPlot[Sin[x + y], {x, 0, 2}, {y, 1, 3}, PlotLegends -> Automatic, ColorFunction -> "Rainbow", ImageSize -> Small] which gives the output as enter image description here

And another code is DensityPlot[Sin[x - y], {x, 0, 2}, {y, 1, 3}, PlotLegends -> Automatic, ColorFunction -> "Rainbow", ImageSize -> Small] which gives the output as enter image description here

We can see that the BarLagends for both images are not at the equal footing here, but I need these legends on equal footing so that I would be able to compare them. Is it possible to do so? Or can we mark the ticks on legends manually? Please help me!

Actually, first I made a 3D-plot of these two functions, Sin[x+y] and Sin[x-y], in a single frame. So it was easy to compare them but due to some reasons I can't use a 3D plot in my work. Then I thought it would be another good option to compare them.

$\endgroup$
4
  • $\begingroup$ Define "footing." $\endgroup$ Commented Feb 11, 2019 at 8:44
  • $\begingroup$ @DavidG.Stork By the word "footing", I mean to say that first figure is having range from {-1.0,1.0} and the other one is with {-1.0,0.8}, i.e. not matching the previous one. $\endgroup$
    – user176263
    Commented Feb 11, 2019 at 8:48
  • $\begingroup$ I should have used scaling or range of plots in the place of footing. Sorry for the confusion. $\endgroup$
    – user176263
    Commented Feb 11, 2019 at 9:07
  • $\begingroup$ Although this answer concerns ArrayPlot rather than DensityPlot, you may find its exposition of plot and legend scaling helpful. $\endgroup$
    – m_goldberg
    Commented Feb 11, 2019 at 10:18

0

Browse other questions tagged or ask your own question.