I have the below codes to create contour two plots that I then merge together to show at the same time. They are from mesh maps of above and below a dam so i cannot make the contour plots together or it shows something I do not want. However, I would like the legend to show negative 2 to positive 2 (so that I can make the legend/scale consistent between different data sets). But using my current code (and iterations I have tried) I cannot get this.
I would also like the colors to be consistent between the data sets rather than stretching to the data for each year (so that changes of 0.1 for one data set are the same color as changes of 0.1 from other data sets).
Another small thing I haven't figured out is stopping the graphic from having two scales/legends when I show both sections together. I could just crop out the extra legend when I use it but ideally I would like to remove this step.
Creating one section:
ContourUpstream1921 =
ListContourPlot[Upstreammesh2diff1921, MaxPlotPoints -> 100,
ColorFunction -> (ColorData[{"TemperatureMap", "Reverse"}][#] &),
PlotLegends -> Automatic, PlotRange -> All]
ContourDownstream1921 =
ListContourPlot[Downstreammesh2diff1921, MaxPlotPoints -> 100,
ColorFunction -> (ColorData[{"TemperatureMap", "Reverse"}][#] &),
PlotLegends -> Automatic, PlotRange -> All]
Show[ContourDownstream1921, ContourUpstream1921, PlotRange -> All]
PlotRange->{-2,2}
to choose the range of the color bar, and useFirst
to remove the legend from one of the plots before combining them withShow
, e.g.Show[…, First[…]]
. Alternatively simpliy don't add the legend to one of the plots by dropping thePlotLegends->Automatic
. $\endgroup$Contours -> Range[-2, 2, 0.1]
but it messes up the legend again, making the legend back to the range of the data rather than -2 to 2 $\endgroup$