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: James Watts (Contractor)
Subject: RE: How to change the scale on a contour plot colorbar
Date: Tue, 18 Feb 2020 17:18:53 +0100 (CET)

Oops sorry.
Anyway, thank you for fixing it.

James.

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
From: Nicholas Jankowski <address@hidden>
Sent: 18 February 2020 15:37
To: James Watts (Contractor) <address@hidden>
Cc: Help GNU Octave <address@hidden>
Subject: Re: How to change the scale on a contour plot colorbar

On Tue, Feb 18, 2020 at 10:09 AM James Watts (Contractor) 
<address@hidden> wrote:
It doesn’t appear to be.  I can set the limits and value range for each 
color
( You can see I have – the peak value is 17 and each color is worth 4),
but I can’t make the numbers (in this case 15, 10, 5) line up with the color 
changes on the bar – so I’d like the change from red to yellow to be marked 
‘13’, and the change from yellow to green to be marked ‘9’

Please reply to the entire group, I'm just one volunteer who doesn't know 
much about figure/graphics objects

-----Original Message-----
From: "Markus Mützel" <address@hidden>
Sent: 18 February 2020 15:43
To: James Watts (Contractor) <address@hidden>
Cc: Help GNU Octave <address@hidden>
Subject: RE: How to change the scale on a contour plot colorbar

Am 18. Februar 2020 um 16:27 Uhr schrieb "James Watts (Contractor)":
> Markus,
> Thanks - I just tried your code and it works for me too -  I didn't
> think to try manipulating the 'y' axis for the colorbar.
> All the best, James.

Please, keep the mailing list in CC so that others might also benefit.

Markus

> -----Original Message-----
> From: "Markus Mützel"
> Sent: 18 February 2020 15:18
> To: James Watts (Contractor)
> Cc: address@hidden
> Subject: Re: How to change the scale on a contour plot colorbar
>
> 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
>
>
> -- IMPORTANT NOTICE:
>
> The contents of this email and any attachments are confidential and may 
> also be privileged. If you are not the intended recipient, please notify 
> the sender immediately and do not disclose the contents to any other 
> person, use it for any purpose, or store or copy the information in any 
> medium. Thank you.
>


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be 
privileged. If you are not the intended recipient, please notify the sender 
immediately and do not disclose the contents to any other person, use it for 
any purpose, or store or copy the information in any medium. Thank you.

reply via email to

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