Matlab doesn't change MarkerSize
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi all,
I know this is a basic one, but for some reason when I plot a figure, certain markers don't change their Size. The code that I use is the following:
plot(datos(index,i+1),headers(1,i+1),'sk','MarkerSize',4,'LineWidth',.25,'MarkerFaceColor',[R G B]);
or
plot(datos(index,i+1),headers(1,i+1),'pk','MarkerSize',4.5,'LineWidth',.25,'MarkerFaceColor',[R G B]);
When I set the MarkerSize for a square or pentagram shape they always end up in a size 2.9x2.9 (squares) or size 4.2x4.06 (pentagram). I'm saving the figure as a PDF with "print(fig1,saveString,'-dpdf','-fillpage');" don't know if that matters but I thought of mentioning it.
Thanks in advanced,
Carlos TM
댓글 수: 2
Walter Roberson
2018년 6월 3일
Is the difficulty occurring even on the displayed images, or only in the PDF ?
채택된 답변
Greg
2018년 6월 3일
편집: Greg
2018년 6월 3일
The unit of 'MarkerSize' is 'points' which is typically 1/72 inch. Depending on your OS, there are usually 96 pixels per inch. If you do the math on various marker sizes - and assume that apparent size of a marker is floor of its pixel size - the following sheds a little light:
pts = 4:.1:5;
in = pts./72;
pix = in.*96;
[pts;in;pix]
ans =
4.0000 4.1000 4.2000 4.3000 4.4000 4.5000 4.6000 4.7000 4.8000 4.9000 5.0000
0.0556 0.0569 0.0583 0.0597 0.0611 0.0625 0.0639 0.0653 0.0667 0.0681 0.0694
5.3333 5.4667 5.6000 5.7333 5.8667 6.0000 6.1333 6.2667 6.4000 6.5333 6.6667
This would make me believe that 4.5 looks larger than 4.0-4.4, but it could be a little round-off error in MATLAB's calculation vs. my assumed algorithm above. Try 4.6 for your 'MarkerSize' and see if that helps.
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!