How to change the order in a combined plot
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello!
Im having trouble with this plot, i want the isolines to be at front.
I have tried with parent, and uistack but nothing works :(
My code is the following;
iso=dlmread('ISO.csv',',',1,0);
I=plot(iso(:,2:5),'k--','LineWidth',1.5)
xlim([1, 16]);
hold on
scatter3( Tp, Hs, P, [], P(:),'filled');
view(2)
colorbar
I also tried changing the order of the plots (ploting first the scatter and next the isolines but didn´t work)
I hope someone can help me
Thanks
:)
0 commentaires
Réponse acceptée
Star Strider
le 21 Oct 2019
Modifié(e) : Star Strider
le 21 Oct 2019
It would be easier with your data.
You are plotting a 3D scatter plot, so to put the isolines on top of it, you have to use plot3 instead of plot, with the appropriate x and y vectors, and with the z-vector being ‘ones(size(iso(:,2:5)))*max(P(:))*max(P(:))’.
I am guessing that the plot3 call would be something like this:
plot3(repmat(0:size(iso(:,2:5),1)-1, size(iso(:,2:5),2), 1)', iso(:,2:5), ones(size(iso(:,2:5)))*max(P(:)), '-k')
A version of that worked when I used my simulated data.
Experiment to get the result you want.
EDIT —
Corrected ‘iso’ reference to include desired columns.
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Scatter Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!