필터 지우기
필터 지우기

Running two very similar scripts, getting different resolution figures when exported.

조회 수: 2 (최근 30일)
Hello all,
I am running into an odd figure problem that I've been debugging all day. I have two scripts (code A and code B) that are doing the exact same thing: they are creating box plots with almost identical data. I have not specified the resolution on the images, and I even copied and pasted the figure code between scripts to ensure that it isn't the figure code, however the output image for both codes is very different in resolution. I manually checked the preferences for both code A and code B, and the preferences for exporting images are the same. I've attached images of the difference in resolution.
I can manually set the resolution of figure B, however, when I do that, it has a weird affect in adobe which I would like to avoid.
has any else seen this? I have been working on this all day and cannot find a solution online or in my lab.

채택된 답변

Jan
Jan 2022년 9월 13일
It looks like one of the figures uses painters and the other one OpenGL as renderer. OpenGL is enabled automatically, if a more than a certain number of elements is displayed.
Set the renderer of the figure manually to avoid this.
  댓글 수: 1
nines
nines 2022년 9월 13일
for anyone in the future looking for crisp figure, here is the code:
set(gcf, 'DefaultFigureRenderer', 'painters');

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

추가 답변 (0개)

카테고리

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