Two x-axis for the same plot line

I have a plot of power as a function of a force P(F) with the power P on the y-axis and the force F on the x-axis.
As acceleration is kept constant, is there a way to add another x-axis on top of the plot representing the mass m knowing that F=m·a?
It would be like copying the x-axis multiplied by the value of the constant acceleration as two ways of interpreting the data P(F) and P(m).
It would be like having two units in two different x-axis for the same data.
Thank you!

1 件のコメント

Rik
Rik 2017 年 11 月 20 日
I know there is a method to add a second y axis, but a second x would be new to me. Why not just add the second unit in the text of the xticklabels?

サインインしてコメントする。

回答 (1 件)

KL
KL 2017 年 11 月 20 日

0 投票

If you have R2014b or later, just like utilizing both sides of the y axis, you can also use top and bottom side of x axis.

1 件のコメント

Mohamed Abdelhamid
Mohamed Abdelhamid 2019 年 10 月 1 日
FYI: This method only works with 'line' function. It doesn't work with 'plot'.

サインインしてコメントする。

カテゴリ

質問済み:

2017 年 11 月 20 日

コメント済み:

2019 年 10 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by