# How to plot on two y- axis

조회 수: 3(최근 30일)
Telema Harry 2021년 8월 18일
댓글: Telema Harry 2021년 8월 19일
I am struggling to plot my data on Two y-Axis. Can you someone please help me out.
U wind velocity component for each location and altitude is store in the variable Uw (lon,lat,P) and the V wind velocity component is stored in the variable Vw(lon,lat,P_range).
My desire is to plot the Uw and Vw on different y-axis and the P_rang on the x-axis for any given location.
I have attached the test.mat files containing the variables.

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

### 채택된 답변

Simon Chan 2021년 8월 18일

use function yyaxis yyaxis

##### 댓글 수: 3표시숨기기 이전 댓글 수: 2
Telema Harry 2021년 8월 19일
Thank you @Simon Chan

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

### 추가 답변(1개)

darova 2021년 8월 18일
You have 3D data. How do you want it to plot in 2d?
s = struct with fields:
P_range: [24×1 single] Uw: [86×86×24 double] Vw: [86×86×24 double]
##### 댓글 수: 1표시숨기기 없음
Telema Harry 2021년 8월 18일
Thank you for the feedback @darova
My main objective is to visualize the variable of Uw and Vw at different P_range values.
For example, at Uw(10,20,:) I want to see the different values Uw for all P_range(1:24). and same for Vw.
I understand that I can only do it point by point using this approach.
At the end, I want to acheive the graph shown below.

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

R2021a

### Community Treasure Hunt

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

Start Hunting!

Translated by