Patch object in logarithmic scale

25 次查看(过去 30 天)
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'
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