How do I plot a line against the y axis?

 Accepted Answer

I am not certain what you want to do.
Perhaps —
x = linspace(0, 2*pi);
y = sin(x);
subplot(2,1,1)
plot(x, y)
grid
ylim([-1 1]*1.1)
subplot(2,1,2)
plot(y, x)
grid
xlim([-1 1]*1.1)
Experiment to get different results.
.

More Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Products

Release

R2020b

Asked:

AAS
on 8 Sep 2021

Answered:

on 8 Sep 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!