Plots - Two Y-Axis with Different Units
이전 댓글 표시
I need to plot a lot of data from an Excel file. I would like to plot one column of data (flow rate) against the left y-axis and have two columns of data (pressure drops) against the right y-axis. How do I do this?
I thought I could work it out using the help pages, but I have no idea how to code the data. I am importing it from Excel and plotting instead. At the moment the plot looks ridiculous because it is plotting it all against the left y-axis and the values for the pressure drops are small compared to the flow rate.
댓글 수: 6
Rik
2021년 3월 1일
I recovered your deleted content from the Google cache. Deleting content is extremely rude. Please don't do it again.
Rik
2021년 3월 6일
And again. I bet I'm more stubborn than you, so you might as well give up.
Why do you want your questions to be removed? With the original question people could actually stubble upon your question and find the answer. Now the time Raj spent answering you is wasted. That's not a really effective way of showing gratitude.
Rik
2021년 3월 16일
Plots - Two Y-Axis with Different Units
I need to plot a lot of data from an Excel file. I would like to plot one column of data (flow rate) against the left y-axis and have two columns of data (pressure drops) against the right y-axis. How do I do this?
I thought I could work it out using the help pages, but I have no idea how to code the data. I am importing it from Excel and plotting instead. At the moment the plot looks ridiculous because it is plotting it all against the left y-axis and the values for the pressure drops are small compared to the flow rate.
Tony Rankin
2021년 6월 1일
Tony Rankin
2021년 6월 1일
Tony Rankin
2021년 6월 1일
답변 (1개)
Raj
2019년 12월 4일
0 개 추천
Since you have not shared the data, it is not possible to give exact solution to your problem but if you are looking for plotting on both primary (left side) and secondary axis (right side) of a graph, you should use yyaxis command.
See details here:
Hope this helps!
댓글 수: 3
Rik
2021년 3월 1일
Deleted comment (which had a csv attached):
I have attached a sample of the data. It is the final three columns that I would like to plot. Not all the values, but a selection of them where it shows a steady state. One is flow rate in litres per minute and the other two are pressure drops in bar.
The link provided was the one I used when I looked for a solution. Although I understand how to code that first plot, I don't know how to input the data from the Excel sheet. That's the reason I thought importing it would be easier. I basically want that but with the data I have. Then I can tweak a little with the editing tool.
Tony Rankin
2021년 6월 1일
Tony Rankin
2021년 6월 1일
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!