Proper Labeling of X & Y values Contour Plot
21 views (last 30 days)
Show older comments
Alex Pettit
on 25 May 2022
Commented: Star Strider
on 25 May 2022
Is there a way to use arrays for labeling the X&Y values of a Contour Plot ..
In this case, Y would be Frequency and X Time ( radio telescope data acq sequence )
1 Comment
DGM
on 25 May 2022
How are you using contour? If you're calling contour() with three arguments, it should have ticks and tick labels on both axes already.
Accepted Answer
Star Strider
on 25 May 2022
Use the tick label properties to change the tick labels. Any new tick values have to be in the ranges of the current tick values, so changing them is not likely to produce the desired results.
[X,Y,Z] = peaks(50);
figure
[c,h] = contourf(X, Y, Z);
Ax = gca; % Axes Handle
xt = Ax.XTick % Tick Values
Ax.YTickLabel = xt*pi; % New Tick Labels
yt = Ax.YTick % Tick Values
Ax.XTickLabel = yt-min(yt); % New Tick Labels
xlabel('Time (units)')
ylabel('Frequency (units)')
.
3 Comments
Star Strider
on 25 May 2022
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
More Answers (0)
See Also
Categories
Find more on AI for Signals 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!