How to plot 3D vectors on a 2D plot?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Loren99
am 24 Mai 2022
Bearbeitet: Loren99
am 25 Mai 2022
Hi everyone! I need to create a 2D plot where the elements that are at z = 1 must be at the same level of the elements at x and y but these elements along z must be highlighted against the background on x and y in order to be distinguished. How can I do it?
1 Kommentar
Star Strider
am 24 Mai 2022
Where are the data?
Uz = unzip('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1009395/Prova_test.zip');
Uz2 = [num2cell((1:numel(Uz))') Uz']
.
Akzeptierte Antwort
Cris LaPierre
am 24 Mai 2022
The solution likely varies depending on your data, but I would probably first look into using imagesc:
This way, the difference in Z is captured in the color displayed in the figure.
imagesc(new_x,new_y,hit);
6 Kommentare
Cris LaPierre
am 24 Mai 2022
Bearbeitet: Cris LaPierre
am 24 Mai 2022
Yes. Use this syntax, where doleg is either 'on' or 'off'.
You can't skip an input, so your code might look like this (empty brackets uses the default value)
gscatter(new_x,new_y,hit,[],[],[],'off');
You can explore these and other optional inputs in the linked documentation page.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!