Why don't my stem graph vertical lines appear?

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 comentarios

Kevin Claytor
Kevin Claytor el 16 de Feb. de 2016
Can you give us an example of your code?
Nuno Fernandes
Nuno Fernandes el 16 de Feb. de 2016
Editada: Image Analyst el 16 de Feb. de 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 el 11 de Jun. de 2024
Type opengl('save','software') at the MATLAB command prompt. Then, restart MATLAB.

Iniciar sesión para comentar.

 Respuesta aceptada

Image Analyst
Image Analyst el 16 de Feb. de 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 comentarios

Nuno Fernandes
Nuno Fernandes el 16 de Feb. de 2016
Well, it shows now. Thank you so much. I just have one question. Will I always have to set the linewidth? In all of my colleagues' PCs, the lines appear without having to do this.
I seem to remember that with R2015a, displaying to an axes that was too small could result in narrow lines effectively vanishing, because the interpolation to a smaller number of pixels might decide they don't contribute enough to show up. That might have been related to anti-aliasing. If so then see if
set(gcf, 'graphicssmoothing', 'off')
makes a difference.
I think they changed the underlying issue for R2015b.
I am not certain on this matter; I could be mis-remembering something I read in the fall.
Nuno Fernandes
Nuno Fernandes el 17 de Feb. de 2016
Editada: Nuno Fernandes el 17 de Feb. de 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 el 31 de Ag. de 2016
How changes can be made in anti-aliasing settings on AMD Catalyst Control Center (GPU drivers)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Preguntada:

el 16 de Feb. de 2016

Comentada:

el 11 de Jun. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by