Plot lines are broken in default view and appers when I zoom in or out on the figure.
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm using following code to plot a graph, I have about 25000 data points.
figure
plot(Ts,[Y0;Ys],'LineWidth', 2);
legend('0','1','2','3','4','5')
title('States')
The default view of my figure looks like this (notice the broken lines): ![Default view.](https://www.mathworks.com/matlabcentral/answers/uploaded_files/886575/Default%20view.png)
![Default view.](https://www.mathworks.com/matlabcentral/answers/uploaded_files/886575/Default%20view.png)
When I zoom in or out of the plot the broken lines appear or disappear (see below): ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/886580/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/886580/image.png)
I'm using Ryzen 5700G (Integrated Graphics) processor without any dedicated graphics.
Following are my Software version details:
MATLAB Version: 9.11.0.1837725 (R2021b) Update 2
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19044)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
4 comentarios
Respuestas (1)
Srija Kethiri
el 17 de En. de 2023
Hi Pushkal,
From my understanding, you are trying to plot 25000 data points. But the lines in the plot are broken.
If you have access to graphics hardware, that would be the best solution. If hardware graphics are not available, another possible workaround is to alter the 'EdgeDetailLimit' of the property of the line to something around 2000 for a standard sized plot.
Edge Detail Limit is basically a threshold where MATLAB Graphics reduces the number of vertices sent to the graphics engine to be nearer the number of pixels available to draw into. This thinning algorithm only works well for monotonically increasing data, but based on the plots you attached, it would probably clear up the issue without visually affecting the line.
Hope this helps!
Ver también
Categorías
Más información sobre Graphics Performance 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!