Clear Filters
Clear Filters

plot to a particular axes

4 views (last 30 days)
Rebecca
Rebecca on 22 Jul 2013
So I have a user interface where the user inputs some values with sliders and text boxes, then it computes some stuff and plots a figure. This consists of 2 subplots, each with 2 sets of data held on.
my problem is that the plot is the full size of the GUI, and not constrained to the axes (called axes5) as I want. How can I do this using subplot? - I've only seen examples using plot and the axes handle??
something likle this:
subplot(2,1,1);
hold on
plot(x,ar0,'-k','LineWidth',2);
plot(x,areas(end,:),'-r','LineWidth',2);
subplot(2,1,2);
hold on
[h0,z,f,D,h_alt] = VokalTraktM(ar0,lv*ones(length(ar0),1),50,5000);
[h1,z,f,D,h_alt] = VokalTraktM(areas(end,:),lv*ones(length(ar0),1),50,5000);
  1 Comment
dpb
dpb on 22 Jul 2013
I've never done GUIs so this is a guess...
From subplot doc's
subplot(..., PROP1, VALUE1, PROP2, VALUE2, ...) sets the specified property-value pairs on the subplot axes. To add the subplot to a specific figure pass the figure handle as the value for the 'Parent' property
Or, if that doesn't bring joy you can always use the form to place the axes precisely where you want them and at a given size...
subplot('position',[left bottom width height]) creates an axes at the specified position in normalized coordinates (in in the range from 0.0 to 1.0)
The latter would be handiest to use if you were to encapsulate it in a helper function, probably.

Sign in to comment.

Answers (0)

Categories

Find more on Graphics Object Programming 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!