How to plot colorbar and plot size different?
3 views (last 30 days)
Show older comments
Nisar Ahmed on 12 Sep 2022
Commented: Star Strider on 15 Sep 2022
When I plot colorbar, it reduces the size of my actual plot. I have 5 subplot and each has a separate colorbar. How to fix this issue?
I want to plot colorbar for each subplot and next to subplot. how can i solve it?
how can I adjust the ticks on colorbar (interval between colorbar ticks)?
Star Strider on 12 Sep 2022
One option would be to stretch the figure by adjusting the 'Position' property. It is possible to re-position it and stretch (or compress) it vertically as well, depending on what you want as the result. See the documentation on the Position property for a full description and details.
x = 0:999;
y = (1:5:25).'+sin((1:5:25).'*2*pi*x/20);
for k = 1:5
for k = 1:5
pos = get(gcf, 'Position');
set(gcf,'Position',pos+[-50 0 250 0]) % Shift Slightly Left & Stretch To Right
More Answers (0)
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!