help on some details of scatterplot

1 visualizzazione (ultimi 30 giorni)
I would like that the last graph shows the 4 legends (that I put wrongly). Indeed I don't want any legend for line(Total_Matrix(:,1),Total_Matrix(:,2))
I would like also that the x coordinate on Total_Matrix(12,1) will appear not like a number (that is a number) but like the string 'adults'
Obviously Total_matrix is only a dobule matrix
subplot(3,2,1)
scatter(Total_Matrix(1:4,1),Total_Matrix(1:4,2),'r','filled')
legend '<= 1 y.o'
hold on
scatter(Total_Matrix(5:11,1),Total_Matrix(5:11,2),'g','filled')
legend '<= 2 y.o.'
scatter(Total_Matrix(12,1),Total_Matrix(12,2),'k','filled')
legend 'adults'
line(Total_Matrix(:,1),Total_Matrix(:,2))
hline = refline([0 0.68]);
legend 'ST ideal' %refers to refline
hline.Color = 'y';
ylabel ST
xlabel AGE

Risposta accettata

Image Analyst
Image Analyst il 7 Lug 2020
legend(subset,___) only includes items in the legend for the data series listed in subset. Specify subset as a vector of graphics objects. You can specify subset before specifying the labels or with no other input arguments.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by