help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to change the scale on a contour plot colorbar


From: Markus Mützel
Subject: Re: How to change the scale on a contour plot colorbar
Date: Tue, 18 Feb 2020 16:17:31 +0100

Am 18. Februar 2020 um 15:36 Uhr schrieb "James Watts
> Can anyone tell me how to change the numeric scale on the colorbar legend on 
> a contour plot? 
> 
> I have tried various combinations of caxis and zaxis, cticks, zticks, 
> cticklabels, zticklabels and I either see nothing change or I get an error.

The colorbar handle is an axes object in Octave.
I don't know your CLims and where you want to put labels exactly. But the 
following works for me:

hax = axes('CLim', [-12, 12]);
hcb = colorbar('peer', hax);
set(hcb, 'YTick', [-12:3:12], 'YTickLabel', {'a', 'b', 'c', 'd', 'e', 'f', 'g', 
'h', 'i'});

> I can’t find a description of this in the Octave or Matlab documentation.

See the "Implementation Note" at the end of the doc string for colorbar.
 
HTH,
Markus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]