Can I make the plot skip jumps in data?
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
OG
el 17 de Abr. de 2021
Comentada: OG
el 18 de Abr. de 2021
I have a plot of data, where the y values are bounded from -pi to pi. After a value goes above pi, it starts at the bottom of the plot with a value of pi. However, when plotted this means there is a line connecting the jump in value. Is there a way to plot the data without the lines connecting the values at each jump point?

2 comentarios
Respuesta aceptada
Atsushi Ueno
el 18 de Abr. de 2021
Similar Q&A: Matlab: discontinuous plot - Stack Overflow
The idea is replacing discontinus part by NaN values.
x = 1:0.1:pi*10;
y = mod(x,pi*2)-pi;
y(abs(diff(y))>2) = NaN;
plot(x,y);
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!