フィルターのクリア

only one plot line is showing

1 回表示 (過去 30 日間)
Anthony Sirico
Anthony Sirico 2022 年 12 月 20 日
コメント済み: Anthony Sirico 2022 年 12 月 20 日
%%plot1
subplot(1,2,1)
gscatter(labels_sorted, 1:N, binary); hold on
line([label_25 label_25], [0 n_25], 'Color', 'k')
line([0 label_25], [n_25 n_25], 'Color','k')
line([label_50 label_50], [round(N*0.5) round(N*0.5)])
xlabel('Performance')
ylabel('Circuit')
ha1 = gca;
ha1.XScale = 'log';
ha1.XAxis.Color = bcolor;
ha1.YAxis.Color = bcolor; % change the y axis color to black (not a dark grey)
ha1.XAxis.FontSize = fonttick; % change x tick font size
ha1.YAxis.FontSize = fonttick; % change y tick font size
ha1.XAxis.Label.FontSize = fontlabel; % change x label font size
ha1.YAxis.Label.FontSize = fontlabel; % change y label font size
ha1.Layer = 'top';
subplot(1,2,2)
gscatter(complexity_sorted, labels_sorted, binary)
xlabel('Complexity')
ylabel('Performance')
ha2 = gca;
ha2.YScale = 'log';
ha2.XAxis.Color = bcolor;
ha2.YAxis.Color = bcolor; % change the y axis color to black (not a dark grey)
ha2.XAxis.FontSize = fonttick; % change x tick font size
ha2.YAxis.FontSize = fonttick; % change y tick font size
ha2.XAxis.Label.FontSize = fontlabel; % change x label font size
ha2.YAxis.Label.FontSize = fontlabel; % change y label font size
ha2.Layer = 'top';
in plot 1, i am trying to add lines to denote quadrants, it plots the first line but not the rest.
  1 件のコメント
Anthony Sirico
Anthony Sirico 2022 年 12 月 20 日
The small point vice using 0 worked, thanks. As for the plotting of the point, is draws a line between the two points.
thanks for the help

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

採用された回答

Bora Eryilmaz
Bora Eryilmaz 2022 年 12 月 20 日
編集済み: Bora Eryilmaz 2022 年 12 月 20 日
There are two issues with your code. First,
line([label_50 label_50], [round(N*0.5) round(N*0.5)])
is a point, not a line. So you probably won't be able to see it.
Second, since you are setting the x-axis scale to logarithmic, the left end of the line that starts from x=0
line([0 label_25], [n_25 n_25], 'Color','k')
will map to -inf and that line won't show up anymore on the plot. You can use a small x value instead to be able to see it. Something like:
line([0.1 label_25], [n_25 n_25], 'Color','k')

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by