필터 지우기
필터 지우기

only one plot line is showing

조회 수: 2 (최근 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 CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by