How do I make coloured scales from multiple graphs the same?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Giles
am 22 Sep. 2016
Kommentiert: Giles
am 22 Sep. 2016
My project is a 1 dimensional sediment transport model. My question is not about the model code. From the model I get 3D images and a scale (see attached photo). The scale is colour coded and I want the coloured scale for each graph to be the same no matter what the scales of the graph are. For example, I would like red to equal 80, even if one graph's scale is between 0 and 150 and another graph's scale is between 0 and 250. Thank you for considering my question :) I run R2015b.
I am a grad student working on a project in MATLAB. My abilities in MATLAB are very limited, the script and instructions on how to run the model were provided to me.
0 Kommentare
Akzeptierte Antwort
Kelly Kearney
am 22 Sep. 2016
Just set the color axis limits to be the same on all of them:
ax(1) = subplot(2,2,1); % plot, etc.
ax(2) = subplot(2,2,2); % plot, etc.
set(ax, 'clim', [0 80]);
3 Kommentare
Kelly Kearney
am 22 Sep. 2016
Aaaaaah!
I'm pretty sure plot-relevant stuff is actually in the generate_output script, not any of that code above.
Either attach that file, or cut-and-pase the relevant plotting-related stuff only.
If I had to take a blind guess, though, I'm going to guess that h is a figure handle, and the figure includes one of those subplots from your example image. In which case, add this after the call to generate_output.
hax = findall(h, 'type', 'axes');
set(hax, 'clim', [0 200]); % or whatever your preferred limits are
Unless of course the save-image-to-file step is also done in the generate_output script. In that case, you'll have to change the color limits before the saving is done.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!