semilog plot with a self defined x-axis range

I have a time series data and I would like to plot them in the semilogx ranging from [10^(-4) to 10^2] as the attached figure. May I know how to do that?

Antworten (1)

Walter Roberson
Walter Roberson am 5 Dez. 2023
Verschoben: Walter Roberson am 5 Dez. 2023
T = readtable('data.xlsx', 'VariableNamingRule', 'preserve');
whos T
Name Size Bytes Class Attributes T 42x2 1905 table
T.Properties.VariableNames
ans = 1×2 cell array
{'return period (year)'} {'surge'}
plot(T, "return period (year)", "surge");
set(gca, 'XScale', 'log')
xlim([10^-4, 10^2])

2 Kommentare

jie hu
jie hu am 5 Dez. 2023
thanks very much!.
You can also use semilogx.
And another function available from R2023b onwards - xscale

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Exploration finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 5 Dez. 2023

Kommentiert:

am 5 Dez. 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by