How to make scatter

3 ビュー (過去 30 日間)
Agnes Diza Fahira
Agnes Diza Fahira 2021 年 7 月 24 日
コメント済み: dpb 2021 年 7 月 24 日
i want to make scatter but like this, how can i do this???
i want that graph is have two y axis and two x axis with same scale
in the picture I edited it using pain to add line on the top and right of the graph
i want to do this with matlab
thanks before and sorry for my bad english
  8 件のコメント
Image Analyst
Image Analyst 2021 年 7 月 24 日
Well, I probably shouldn't say. Just trust me on this. You'll find out eventually when you get enough points. Thanks for moving though.
dpb
dpb 2021 年 7 月 24 日
Well, I'll never get to your or Walter's stratospheric levels, so I'll not be holding my breath... :) But, I can't complain re: my treatment from TMW to date, in fact, I'm very grateful.
And being at point that "I no longer buy green bananas" is beginning to not be so far off, odds aren't necessarily in my favor... :)

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

採用された回答

dpb
dpb 2021 年 7 月 24 日
Per IA's direction...with a correction for the data variables--dpb :)
You don't need two axes for that, just hold on
hold on
hSc(1)=scatter(xTrain,yTrain);
hSc(2)=scatter(xTest,yTest);
hL=plot([0 10],[0 10],'k-');
box on
legend(hSc,'Training','Testing')
with the other parameters of color, marker style, etc., etc., ... as you wish.

その他の回答 (1 件)

KSSV
KSSV 2021 年 7 月 24 日
  1. Fit striaght line to the given data using polyfit.
  2. Plot the line using plot function.
  3. Use hold on
  4. Plot the given data using scatter.
  5. To put a legend use legend.
Also have a look on the function plotregression.
  1 件のコメント
dpb
dpb 2021 年 7 月 24 日
NB:
Re: 1. above, the line isn't the OLS fit of the data but the 1:1 45 of the input:output that would be the perfect correlation.

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

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by