Why don't my stem graph vertical lines appear?

14 views (last 30 days)
Hello! I'm currently facing a problem using Matlab r2015a. When I draw a stem graph, the lines that are supposed to connect the points and the horizontal axis, do not appear. How can I make them appear? Thank you for your time.
  3 Comments
Nuno Fernandes
Nuno Fernandes on 16 Feb 2016
Edited: Image Analyst on 16 Feb 2016
Well, it's just a normal plot of a graphic. Something like:
x = linspace(-2*pi,2*pi,100);
y = 4*pi*randn(1,100)-2*pi;
figure;
subplot(2,1,1), plot(x,y,'-r.')
subplot(2,1,2), stem(x,y)
Abubakar Essel
Abubakar Essel on 11 Jun 2024
Type opengl('save','software') at the MATLAB command prompt. Then, restart MATLAB.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 16 Feb 2016
It worked for me. I get vertical lines. Try this, changing the 'LineWidth' property:
x = linspace(-2*pi,2*pi,100);
y = 4*pi*randn(1,100)-2*pi;
figure;
subplot(2,1,1);
plot(x,y,'-r.')
grid on;
subplot(2,1,2);
stem(x,y, 'LineWidth', 3)
grid on;
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Get rid of tool bar and pulldown menus that are along top of figure.
set(gcf, 'Toolbar', 'none', 'Menu', 'none');
% Give a name to the title bar.
set(gcf, 'Name', 'Stem Test', 'NumberTitle', 'Off')
  4 Comments
Nuno Fernandes
Nuno Fernandes on 17 Feb 2016
Edited: Nuno Fernandes on 17 Feb 2016
Unfortunetely it didn't work. Thank you anyway :)
Edit: I made it work. I just changed the anti-aliasing settings on my AMD Catalyst Control Center (GPU drivers).
infotech
infotech on 31 Aug 2016
How changes can be made in anti-aliasing settings on AMD Catalyst Control Center (GPU drivers)

Sign in to comment.

More Answers (0)

Categories

Find more on Programmatic Model Editing 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!