When plotting a line with dashed style and the vector to be plotted contains very large number of points ,the resulted output line looks like continuous line style ...so is there any method to keep the dashes appearing whatever the length of the data points???

댓글 수: 4

Kelly Kearney
Kelly Kearney 2020년 12월 16일
Are you adding markers to the line? The dashes in a dashed lines shouldn't vary based on number of points.
ahmed ali
ahmed ali 2021년 7월 10일
No I don't add markers... I just used a dashed line style. But as the number of data points is very large , the dashed line appears as a continuous line.
Scott MacKenzie
Scott MacKenzie 2021년 7월 10일
There might be some workarounds, such as downsampling your data. Perhaps post your data and code, so we can see what's going on and perhaps explore some options.
Mathieu NOE
Mathieu NOE 2021년 7월 12일
hello
yes , downsampling is the way to go, make sure the plotted data does not exceed length 500 to 1000 (test it)

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

답변 (1개)

Guru Kumaresan
Guru Kumaresan 2021년 7월 13일

0 개 추천

Hi Ahmed,
You are trying to plot the data that is very large when compared to the resolution of your monitor. This is the reason for you seeing the points as a continuous line. This is just a visualisation issue as the data is discrete. Try performing the following steps to have a proper visualisation:
  • Try downsampling your data because such a large data cannot be visualised as separate points because of the resolution issue.
  • One more way is to try reducing the markersize, which in turn will make the plot appear as you wanted.
If you need to modify the Markersize you can do as shown below:
plot(x,'MarkerSize',1);
For more information regarding plotting of data check Plot.
You can also refer stem documentation which plots the discrete sequence data.

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

질문:

2020년 12월 16일

답변:

2021년 7월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by