How to make color axis ticklabes with two end limits ([cmin cmax]) only?
Show older comments
Suppose, I have subplots of 4 times 3 or higher and I cant change clim of each plot using property inspector. I tried
clim([cmin cmax])
but that shows a full range instead of two ticklabels (with auto ticks) only. is there a way to fix two end limits with ticklabes on the color axis. Thanks.
Edited:syntax for ticklabes (not ticks) as cmin and cmax .
2 Comments
Mathieu NOE
on 3 Feb 2025
I am not sure to understand how the result should look like
you want only two colors to be displayed ?
Anil
on 4 Feb 2025
Answers (1)
Star Strider
on 3 Feb 2025
0 votes
One problem may be that your clim call (at least as posted) needs parentheses.
This call to clim:
cl = clim;
should return the limits as a 2-element vector.
If you want to set them, use:
clim([-5 5])
or some such, depending on what you want.
.
11 Comments
My pleasure!
The result you are getting does not seem to be correct, and does not correspond to the clim documentation. You may have a variable named ‘clim’ somewhere in your workspace.
Run this in a script or your Command Window —
which clim -all
It should produce only results similar to what is displayed here.
.
Anil
on 4 Feb 2025
Star Strider
on 4 Feb 2025
I have no idea what that is.
On my own computer, I only get:
C:\Program Files\MATLAB\R2024b\toolbox\matlab\graphics\graphics\clim.m
Include the URL of this thread in your message to them, so they know what you already did to troubleshoot this.
.
Anil
on 4 Feb 2025
Star Strider
on 4 Feb 2025
I don’t know how MATLAB on a Mac (that I have no experience with) is different from MATLAB on Windows or Linux machines (both the same in my experience, with differences in directtory assignments).
I have never seen the sort of result you’ve gotten as a response to the which call. That’s the reason I suggest that you Contact Support.
Please post back here with the solution that MathWorks suggests. I would like to know the solution (and what the initial problem is and the reason you’re having problems), and others might as well.
.
Anil
on 4 Feb 2025
Walter Roberson
on 4 Feb 2025
/Applications/MATLAB_R2024a.app/toolbox/matlab/graphics/clim.m looks fine for MacOS.
Star Strider
on 4 Feb 2025
@Anil — Thank you. I would like to know what this problem turned ou8t to be, and what the solution is.
@Walter Roberson — Thank you. I have no experience with Mac computers. (The last Apple machine I used was an Apple ][, purchased from a store owned by one of the engineers who designed the computer, when I was in a fellowship at UCSF.)
Anil
on 5 Feb 2025
Edited: Walter Roberson
on 8 Feb 2025
Star Strider
on 5 Feb 2025
Interesting.
I wasn’t aware of the context.
Categories
Find more on Line Plots 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!