Combining multiple plot statements.
Show older comments
I want to combine multiple plot statements into one, for example, how could I write the following code using one plot statement?
plot(1,-1,'k*')
plot(1,(1/3),'k*')
plot(1,1,'k*')
plot(1,-5,'rv', 'MarkerFaceColor', 'r')
plot((1+sqrt(5)),0,'g^', 'MarkerFaceColor', 'g')
plot((1-sqrt(5)),0,'g^', 'MarkerFaceColor', 'g')
Thank you.
4 Comments
Rik
on 6 Oct 2019
Why do you want to merge them? That would make your code very difficult to understand.
Mughees Asif
on 6 Oct 2019
Stephen23
on 6 Oct 2019
"I just wanted to reduce reusing the same statements to make it a bit cleaner?"
Merging them will be much more confusing. Your current code is clear, legible, and easy to debug, I don't see any reason to change it.
Mughees Asif
on 6 Oct 2019
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!