How to create horizontal grid lines?

15 views (last 30 days)
Atiqah Zakirah
Atiqah Zakirah on 23 May 2017
Answered: KSSV on 23 May 2017
Hi there. Can anyone help me figure out why my code isn't creating horizontal grid lines? Thank you in advance!
%%create grid
N = 100;
xgrid = linspace(103.6,104,N);
ygrid = linspace(1.25,1.5,N);
[X,Y] = meshgrid(xgrid,ygrid);
figure
hold on
plot(X,Y,'r');
plot(Y,X,'r');
xlim([103.6 104])
ylim([1.25 1.5])

Accepted Answer

KSSV
KSSV on 23 May 2017
%%create grid
N = 100;
xgrid = linspace(103.6,104,N);
ygrid = linspace(1.25,1.5,N);
[X,Y] = meshgrid(xgrid,ygrid);
figure
hold on
plot(X,Y,'r');
plot(X',Y','r');
xlim([103.6 104])
ylim([1.25 1.5])

More Answers (0)

Categories

Find more on Fourier Analysis and Filtering 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!