plotyy messing up my gui
2 views (last 30 days)
Show older comments
I have a gui that has many buttons that plot something after pressing each button. All plots have the same dimension and are plotted on the same frame. So I decided to have one of these plots contain two graphs, using plotyy since the second graph has a different y axis. Now when I press a button, my plots come out bigger and outside the original frame. I managed to fix that but the new plots have the new axes and the old axes superimposed on them. I have tried to understand handles but it's like a foreign language to me. Does anyone know how I can eliminate the AX(2) properties? This seems to be the one messing me up. I just want all my buttons to plot in the correct spot.
Accepted Answer
Jose Ramos
on 8 Jul 2012
1 Comment
Jan
on 8 Jul 2012
Please add information required to understand the question by editing the question and not as answer. Most of all if you accept your answer, the thread looks like it is solved.
I still do not get the problem. When the following plots appear in an AXES, which is large than you want it to be, setting the size to the wanted value would be an obvious solution.
More Answers (1)
Jan
on 8 Jul 2012
The question is not clear to me. Perhaps understanding the handle concept allows you to solve the problem already: A "handle" is a value of type double (but it could be any other type also, e.g. a string, but this detail does not matter), which addresses each GUI object unequivocally. Using this handle allows to set the properties of an object later on or to use a specific object as parent of others.
Axes1H = subplot(1,2,1); % Now AxesH is the AXES object
Axes2H = subplot(1,2,2);
% Show all properties:
get(Axes1H)
% Set a specific property:
set(Axes2H, 'Color', [1,0,1]);
% Draw to a specific axes:
LineH = line(1:10, rand(1,10), 'Parent', Axes1H);
% Show properties of the line:
get(LineH)
Now consider that plotyy creates two axes, while the one in the foreground has a transparent background color. Perhaps you can use the two axes handles replied by plotyy to perform, what you want.
0 Comments
See Also
Categories
Find more on Two y-axis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!