can't keep figure handle hidden when using "fill" w/subplots

2 ビュー (過去 30 日間)
cmmv
cmmv 2015 年 8 月 25 日
コメント済み: cmmv 2015 年 8 月 27 日
I want to use "fill" command for a specific subplot. I am using the "tight_subplot" function found here in the forums. I am able to control/set all properties and plot to each subplot individually, but i haven't figured out how to use fill on a specific subplot without having to use "axes(1)" which then sets the visibility back to 'on' for FIG.
My goal is keep "FIG" hidden at all times, but still apply my "fill" command to a specific subplot.
%define a figure handle and keep it hidden. create the subplots
FIG = figure('doublebuffer','off','Visible','Off');
sub = tight_subplot(2,2,[0.095 0.11],[0.06 0.07],[0.075 0.075]);
set(FIG,'Units','pixels','Position',[25 450 900 810]);
% set some limits on the subplots
set(sub(1:4),...
'drawmode','fast',...
'xlim',[0 samples],...
'YLim',[(min-0.015) (max+0.015)],...
'YTickLabelMode','auto',...
'Xtick',(0:(2*samples)/8:2*samples));
xlabel(sub(1),'this is the X label');
ylabel(sub(1),'Y scale');
title(sub(1),'some title_ thing','FontWeight','bold','Interpreter','none');
%plot some stuff to sub(1)
hold(sub(1),'on');
plot(sub(1),[0,samples],[val1 val1], 'r--')
plot(sub(1),wv1_segs,'g');
% now i want to plot with the "fill" command. I also want to apply this last to keep its boundaries over top of the stuff i already plotted above.
% without this axes call, the fill command uses the coordinates of the entire "FIG" (ie: all 4 subplots) and writes over them. i only want this applied specifically to subplot1 for example.
axes(sub(1));
xVALS = [floor(0.5*samples),floor(0.75*samples),floor(samples),floor(0.75*samples)];
yVALS = [0, 50e-3, 0, -50e-3];
fill(xVALS,yVALS,'b');

採用された回答

Walter Roberson
Walter Roberson 2015 年 8 月 25 日
fill(xVALS,yVALS,'b', 'Parent', sub(1));
  1 件のコメント
cmmv
cmmv 2015 年 8 月 27 日
Walter, thank you! works perfect :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by