Matlab: drawing rectangle when using tabpanel
Asked Answered
C

1

1

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! enter image description here

Consistent answered 12/4, 2012 at 7:21 Comment(4)
how are you drawing the rectangle?Zygophyte
axes(handles.axes_sim_tracks); rectangle('Position',[x, y, d, d],'Curvature',[1,1], 'FaceColor', [0.9, 0.9, 0.9], 'EdgeColor', [0.9, 0.9, 0.9]);Consistent
I really have no idea what I'm doing wrong... :/Consistent
Have you tried something simpler? I've created a gui with a tabpanel and an axes here (Matlab R2011a) and it definitely works.Zygophyte
S
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.

Scum answered 15/11, 2012 at 15:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.