Plot lines are broken in default view and appers when I zoom in or out on the figure.

조회 수: 10 (최근 30일)
I'm using following code to plot a graph, I have about 25000 data points.
plot(Ts,[Y0;Ys],'LineWidth', 2);
The default view of my figure looks like this (notice the broken lines): Default view.
When I zoom in or out of the plot the broken lines appear or disappear (see below):
I'm using Ryzen 5700G (Integrated Graphics) processor without any dedicated graphics.
Following are my Software version details:
MATLAB Version: (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
Pushkal Purohit
Pushkal Purohit 2022년 2월 8일
No. There are no Nan or Inf. Ts =0:0.001:25;
And please see that it is not that the graph is not plotting, it is getting plotted perfectly, just not showing properly on screen, unless I zoom in/out and at some point it shows it.
The same program works fine on my other system even though it has older processor and less RAM.

댓글을 달려면 로그인하십시오.

답변 (1개)

Srija Kethiri
Srija Kethiri 2023년 1월 17일
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!
  댓글 수: 1
Pushkal Purohit
Pushkal Purohit 2023년 1월 17일
Thanks for the answer.
I updated to MATLAB 2022a and Windows 11, and I have not faced this problem since then.
And I also use define figure 'Renderers' as 'painters', this also solved the problem for me.
Still, I did not find anything related to 'EdgeDetailLimit' either in property editor or online. How can I change it?

댓글을 달려면 로그인하십시오.


Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기




Community Treasure Hunt

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

Start Hunting!

Translated by