only one plot line is showing

5 visualizaciones (últimos 30 días)
Anthony Sirico
Anthony Sirico el 20 de Dic. de 2022
Comentada: Anthony Sirico el 20 de Dic. de 2022
%%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 comentario
Anthony Sirico
Anthony Sirico el 20 de Dic. de 2022
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

Iniciar sesión para comentar.

Respuesta aceptada

Bora Eryilmaz
Bora Eryilmaz el 20 de Dic. de 2022
Editada: Bora Eryilmaz el 20 de Dic. de 2022
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')

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by