How can I choose which data correspond to the X and Y axes using EZPLOT in MATLAB (R2013a)?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 25 Oct 2013
Answered: MathWorks Support Team
on 25 Oct 2013
I would like to plot a function of two variables 'x' and 'y', but would prefer to have control as to which variable corresponds to which axis. For example, I would like to have the Y-data on the horizontal (X) axis. How can I do that?
Accepted Answer
MathWorks Support Team
on 25 Oct 2013
EZPLOT plots the variables in string expressions alphabetically. To avoid this ambiguity, you would specify the order using an anonymous function:
>> subplot(1,2,1)
>> ezplot('1./y - log(y) + log(-1+y) + x - 1')
>> subplot(1,2,2),
>> ezplot(@(y,x)1./y - log(y) + log(-1+y) + x - 1)
0 Comments
More Answers (0)
See Also
Categories
Find more on Axis Labels 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!