Scatter Plot only Non-Zero Set of Points
Ältere Kommentare anzeigen
Hi,
I suppose... Let's say, once you make two tables of values and you decide create a scatter plot, where the row values of one table is plotted against the row values the other... how can you use scatter to plot only the non-zero points in the tables?
For instance,
I had:
x1 = tt5{:,6}
y1 = ss5{:,6}
scatter(x1,y1,'b')
hold on
where
ss5 column 6:
0
1
0
0
1
0
0
0
tt5 column 6:
0
7
6
5
18
6
4
5
So, I would only want to plot (7,1) and (18,1)
6 Kommentare
Rik
am 5 Mai 2020
Your code would be a lot easier to read if you had written it very differently. If you find yourself having more than two nearly identical blocks of code you should consider making it a loop, or use a function.
You should not be using numbered variables like this. If you had put the results in an array it would probably be a lot easier to solve your question.
CMatlabWold
am 5 Mai 2020
Rik
am 5 Mai 2020
If you edit away code, can you at least not remove the formatting?
CMatlabWold
am 5 Mai 2020
Bearbeitet: CMatlabWold
am 5 Mai 2020
Rik
am 5 Mai 2020
Either will do ;)
It is just a bit frustrating to apply formatting to your question, and then having to do it again because you removed everything including the formatting. The edit controls are right there when you edit you posts, please use them.
CMatlabWold
am 5 Mai 2020
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Scatter Plots finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
