How to change the colorbar limits in a previously saved fig file
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ricardo Duarte
il 11 Ott 2021
Commentato: Ricardo Duarte
il 14 Ott 2021
Hello,
I have a figure containing a colorbar that I saved in a .fig format.
Now I need to open it and change the limits of the color bar. Im using
caxis([inferior_limit superior_limit])
.
However, when I do this nothing happens.
What Im doing wrong?
Thank you
0 Commenti
Risposta accettata
Walter Roberson
il 11 Ott 2021
figfilename = 'AppropriateFile.fig';
fig = openfig(figfilename);
cb = findobj(fig, 'type', 'Colorbar');
cb.Limits = [inferior_limit superior_limit];
After that you might want to save the figure indicates in fig into a new file.
7 Commenti
Walter Roberson
il 13 Ott 2021
imagesc() sets the image 'CDataMapping', 'scaled' . If a non-empty scale range is provided, then it also sets the axes CLim property to that range; if "hold" was off then it also sets the axes CLimMode to 'auto'
This is almost the same calling imagesc() without a range and then calling caxis() yourself; the difference is just in whether CLimMode is set to 'auto' or not (caxis does not set it.)
If you still have your figure up but you want to change the caxis and save again while it is still up, then referring to your previous code,
caxis(ax1, [inferior_limit superior_limit]);
savefig(SPLfigure, 'teste.fig')
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!