How change the axes labels and axes range of each plot of one figure?

3 views (last 30 days)
Let's assume we have the automatically made figure like this, and we want to change every ax labels for both plots,
figure
timeSpectrum(fb,sm,'SpectrumType','density','Normalization','pdf'
when I am using xlable or Ylable just the second plot of the figure is going to change not the first Scalogram.
I can modify by figure property inspector but I want to do it to whole my coding
Thanks for helping

Answers (1)

Image Analyst
Image Analyst on 17 Feb 2021
Try this (untested):
fontSize = 20;
subplot(1, 2, 1);
imshow(yourImage, 'Parent', h1);
title(h1, 'Magnitude Scalogram', 'FontSize', fontSize);
xlabel(h1, 'Time (hours)', 'FontSize', fontSize);
ylabel(h1, 'Period (hours)', 'FontSize', fontSize);
h1 = subplot(1, 2, 1);
imshow(yourImage, 'Parent', h1);
title(h1, 'Magnitude Scalogram', 'FontSize', fontSize);
xlabel('Time (hours)', 'FontSize', fontSize);
ylabel('Period (hours)', 'FontSize', fontSize);
h2 = subplot(1, 2, 2);
semilog(h2, x, y);
title(h2, 'Time Averaged Wavelet Spectrum', 'FontSize', fontSize);
xlabel(h2, 'Density', 'FontSize', fontSize);
ylabel(h2, 'Magnitude', 'FontSize', fontSize);
In general in most functions you can pass in the axis handle to that axes control to have the function operate on only that axes control.
  3 Comments
Sina Zinatlou
Sina Zinatlou on 17 Feb 2021
fb = cwtfilterbank ( 'SignalLength',numel(b),'SamplingFrequency',Fs);
and b is a single row vector including n elements

Sign in to comment.

Categories

Find more on Wavelet Toolbox 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!