-->

Matlab: drawing rectangle when using tabpanel

2019-08-01 09:28发布

问题:

I'm using TabPanel for building my GUI. The problem is, that when I'm drawing rectangle it appears outside of my axes. Problem does not exist when not using TabPanel.

I was testing 'clipping' parameter, but my object is still outside axes (fig).

Any hints?

thanks!

回答1:

I have good news and bad news. (There is no answer all over the internet, I just saw unanswered requests like this one).

I had exactly the same problem. After checking, the problem is actually restrained to MARKERS (so either marker not set to none in the case of plots, or scatters). If I only plot lines, it stays clipped.

The issues is the renderer of the figure in which your plot is. You have to set it to "painter" or "zbuffer" and not "openGL". Sadly only the latter lets you plot transparent images :( . I think Matlab should fix this issue so we can have both unclipped markers and transparent images in the same figure...

K>> get(handles.output,'Renderer')
ans =    
OpenGL
K>> set(handles.output,'Renderer','painter')

Yanis

edit: the solving might be similar for rectangles I hope.