Creating plot with double x axis
Show older comments
Hi everyone,
I want to plot graph with two x axis. One is at the base level other one is at the uppermost level.
I plot u1 wrt y-axis also I want add u2 wrt to y-axis.
I write code below . How I add u2 datas as an second x-axis on the upper level ? Thanks for answer.
Simialr to this example

clear
clc
y = [2 3 4 5 6 7 8 9 10 15 20 25 30 40 50 60 80 100 150 200 280]
u1 =[6.76 7.11 7.48 7.79 8.03 8.30 8.49 8.72 8.91 9.70 10.16 10.44 10.53 10.71 10.76 10.81 10.90 11.0 11.07 11.1 11.02]
u2 =[19.0 18.1 17.0 16.2 15.8 15.4 15.1 14.4 14.1 12.8 13.2 12.5 11.8 11.1 10.5 10.5 9.3 9.2 8.5 7.9 7.3]
plot(u1,y,'p-','LineWidth',1,'Marker','square','LineStyle','none'); xlabel('u1 (m/s)'); ylabel('y (mm)');
Accepted Answer
More Answers (0)
Categories
Find more on Line Plots 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!