help on some details of scatterplot

1 次查看(过去 30 天)
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

采纳的回答

Image Analyst
Image Analyst 2020-7-7
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by