plotyy messing up my gui
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.
1 Comment
Yash
on 8 Jul 2012
can you include another axis?
Accepted Answer
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.
Categories
Find more on Combine Multiple Plots 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!