필터 지우기
필터 지우기

semilog plot with a self defined x-axis range

조회 수: 4 (최근 30일)
jie hu
jie hu 2023년 12월 5일
댓글: Dyuman Joshi 2023년 12월 5일
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?

답변 (1개)

Walter Roberson
Walter Roberson 2023년 12월 5일
이동: Walter Roberson 2023년 12월 5일
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
jie hu
jie hu 2023년 12월 5일
thanks very much!.
Dyuman Joshi
Dyuman Joshi 2023년 12월 5일
You can also use semilogx.
And another function available from R2023b onwards - xscale

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by