[Top][All Lists]

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

Re: Coloarbar

From: Markus Mützel
Subject: Re: Coloarbar
Date: Tue, 20 Oct 2020 12:58:38 +0200

Am 20. Oktober 2020 um 12:18 Uhr schrieb "Mishal0488":
> Hi Guys
> Is there anyway the set bounds for the "colorbar" function?
> Have a look at the attached plot, the yellow region and blue (maybe purple)
> regions don't have numerical values to them. Can these be added in?
> My code is below
> figure(5)
> hold on
> title('Resultant Stress Due to Moments');
> contourf(X,Y,Combined_Mx_My,50,'LineStyle','none')
> colorbar
> #contour(X,Y,Resultant_shear)
> fill(Mx1,My1,'w','linestyle','none')
> fill(Mx2,My2,'w','linestyle','none')
> fill(Mx3,My3,'w','linestyle','none')
> fill(Mx4,My4,'w','linestyle','none')
> fill(Mx5,My5,'w','linestyle','none')
> hold off <>

Your example code is incomplete and doesn't run for me.

See this part of the documentation of colorbar (doc colorbar):
> Implementation Note: A colorbar is created as an additional axes object with 
> the "tag" property set to "colorbar". The created object has the extra 
> property "location" which controls the positioning of the colorbar.

So you could change the axes ticks like so:
hcb = colorbar();
set(hcb, "ytick", -250:50:250);  # <- set here where you want to show ticks on 
the colorbar


reply via email to

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