How can I plot only a color bar, e.g. jet from -1 to 1, in Matlab? I need to save it as an image.
Running colorbar
also plots an empty axis next to the color bar.
what about this:
colorbar
axis off
If you want to fully control the width and position of the colorbar then you can do something like:
fig1=figure;
left=100; bottom=100 ; width=20 ; height=500;
pos=[left bottom width height];
axis off
colorbar([0.1 0.1 0.7 0.8]);
set(fig1,'OuterPosition',pos)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With