Hello dear members
I am new to matlab and i want to plot in such away that x axis has 2 or more ticklabels like time and latitude are both on x axis with the names "time" and "lat" are on the bottom left only.
like this time 1 2 3 4 55 .........
latitude 1 2 3 4 5 6 ......
thanks in advance

답변 (1개)

Githin George
Githin George 2022년 7월 22일

0 개 추천

Hi,
You could try doing a hold on plot if the time data and latitude are somewhat to scale
time = 1:25;
latitude = 1:35;
yTime = rand(1,25) .* 100;
yLat = rand(1,35) .* 100;
plot(time,yTime);
hold on
plot(latitude, yLat);
xlabel("Time/ Latitude")
hold off
But if your time scale and latitude scale are very different I would suggest going with Multi-axis plot. You can take a look at the documentation here

댓글 수: 1

danel james
danel james 2022년 7월 22일
Thank you. But
I need to have plots exactly like this...

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

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

질문:

2022년 7월 22일

댓글:

2022년 7월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by