Plotting with a handle stored in a variable
2 views (last 30 days)
Show older comments
This may be an obvious question but it is proving exceedingly frustrating for me right now. Is there a way to store a location to be used in the future for plotting as a variable?
For example: plotloc='handles.smallgraph' and then later on after defining x and y: plot(plotloc,x,y)
When I try this I get the error: Error using plot, invalid first data argument.
Thoughts?
0 Comments
Answers (1)
Tom
on 11 Jun 2012
you don't need to use the apostrophes, or even really the plotloc variable, you can just write
plot(handles.smallgraph,x,y)
That is, assuming handles has been passed into your function.
See Also
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!