I’m trying to make multiple scatter plots involving 100 data (200 by 1). These are to be plotted against just one data (200 by 1), and the whole idea is to check if the plots lie around the 45 degree line. But I realised that only 1 data is displayed in the plot, rather than 100. The code is seen below:
for i = 1:N
figure(1), plot(actual,pred(:,:,i),’or’,'MarkerSize’,15); hold on;
xlim([0.05 0.70]);ylim([0.05 0.70]);
xlabel(‘Actual data’); ylabel(‘Predicted data’);
Please what could be the problem? I’ll appreciate your reply. Thank you.
Take figure(1) and hold on out of the loop (before the loop) and do not do hold off. But this would be slow and untidy way to do it. You should just be able to do scatter(x,y) where x is 200×1 vector y is 200×100 matrix and you would see 100 scatter plots. If y is nominally 3-dimensional but has unitary 1st or 2nd dimension, do squeeze(y).
This reply was modified 8 years, 6 months ago by cK.