필터 지우기
필터 지우기

Patch object in logarithmic scale

조회 수: 25 (최근 30일)
Maurizio De Pitta'
Maurizio De Pitta' 2012년 2월 2일
Dear all, when I change the axes scale from linear to log, a colored polygon (usually drawn by patch or fill) is not colored any more. Why and how can I avoid it?
Regards, Maurizio

채택된 답변

Walter Roberson
Walter Roberson 2012년 2월 2일
If I recall correctly, fill creates patches; I am not sure about that.
If a patch object has any point which is 0 or negative on an axis, then when that axis is changed to log scale, the internal patch render algorithms give up trying to color it. This is the case even if the point is not within the current axis limits.
The work-around is not to use a non-negative coordinate -- even if it is eps() or even 1E-100, any non-negative value should do.
You might perhaps also be able to get around the problem by setting the figure rendering property to 'painters' or 'zbuffer'; I only routinely use OpenGL so I am not certain if the problem applies to the other renders.
  댓글 수: 1
Maurizio De Pitta'
Maurizio De Pitta' 2012년 2월 2일
Thanks Walter.
Indeed a work around is to carefully check that data are nonzero (i.e. strictly >0). Indeed mine were not, but I forgot to check them before. Dummy mistake. Sorry about it.
Maurizio.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by