How to scatter plot differnet curves on a same figure
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
Say I have two tables with five columns in each of them. Let's name them T1Col1, T2Col2, ..... in table 1. And T2Col1, T2Col2,....in table 2. I want to analyze the curves between T1Col1 vs T2Col1, T1Col2 vs T2Col2, T1Col3 vs T2Col3 and so on. And I want to do them in a single plot. I want the X-axis to have the range of T1Col1 to T1Col5 and I want to plot the corresponding T2Col1 to T2Col5. I want something exactly similar to this piece of code.
plot(T1Col1, T2Col1,'g',T1Col2, T2Col2,'b',T1Col3, T2Col3,'r'). I can plot it but cannot scatter plot it.
Its not the hold on and hold off code. Its not the plot(1,1,1) concept either. My problem is easily solved if I plot them. But I am NOT able to scatter plot them.
A similar matlab documentation is here: https://www.mathworks.com/help/matlab/creating_plots/combine-multiple-plots.html - (The first example) But again, the axis here is clearly 'X' fixed.
댓글 수: 0
채택된 답변
Walter Roberson
2020년 7월 29일
plot(T1Col1, T2Col1, '*g', T1Col2, T2Col2,'+b', T1Col3, T2Col3, 'rs')
When you specify a marker without specifying a line style, then plot only uses the marker.
This would not be good enough for the case that you want your scatter plots to have a different size or different color for each point.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!