MATLAB Answers


Plot 2D graph - parameters explanation?

Asked by Faris Hajdarpasic on 19 Oct 2019 at 17:36
Latest activity Commented on by Faris Hajdarpasic on 20 Oct 2019 at 8:38
Hello, I have a few questions about editing my graph in MATLAB.
Questions are:
1) How can I have a grid like this (you can see dots starting at every section on y axis (0.5, and 1), and on x axis)
2) This line of code
does not give me exactly the same output as here in the picture. I can't figure it out why (I tried many combinations, but didn't work)
Thanks in advance


Sign in to comment.

1 Answer

Answer by Sulaymon Eshkabilov on 19 Oct 2019 at 18:51

if I have understood your question correctly, the answer lies in ylim:
ylim([-1.5 1.5])
And this plot is not obtained with stem() alone, but also plot().First, it's been plotted with plot() using: plot(x,y, 'g--', 'linewidth', 8) or like in this around, and then with stem().
Good luck.


Yes, plot is already included. I was just asking for stem.
So how to have grid like this, and what is wrong here
It seems the problem is with resolution. My screen id 1920x1080, and MATLAB resolution is lower, so now I am looking for solution for this problem.

Sign in to comment.