From c7d1af3162e459319a224a2003284bab159701f1 Mon Sep 17 00:00:00 2001 From: jamesjcai Date: Wed, 8 Jan 2025 19:48:54 -0600 Subject: [PATCH] . --- +gui/i_cascadeviolin.m | 21 ++++++++++----------- +gui/i_singlegraph.m | 1 - +gui/i_stemscatterfig.m | 1 - +ten/e_mkqqplot.m | 14 +------------- 4 files changed, 11 insertions(+), 26 deletions(-) diff --git a/+gui/i_cascadeviolin.m b/+gui/i_cascadeviolin.m index e3c0af7c..014213ea 100644 --- a/+gui/i_cascadeviolin.m +++ b/+gui/i_cascadeviolin.m @@ -10,7 +10,9 @@ function i_cascadeviolin(sce, Xt, thisc, glist, ytxt, grouporder, colorit) y = full(Xt(idx, :)); ttxt = sce.g(idx); - f = figure('visible', 'off'); + + hx=gui.myFigure; + hFig = hx.FigureHandle; ax1 = subplot(1, 2, 1); pkg.i_violinplot(y, thisc, colorit, grouporder); assignin('base', 'y', y); @@ -21,18 +23,15 @@ function i_cascadeviolin(sce, Xt, thisc, glist, ytxt, grouporder, colorit) subplot(1, 2, 2) sc_scattermarker(sce.X, sce.g, ... sce.s, glist(k), 2); - - tb = uitoolbar(f); - pkg.i_addbutton2fig(tb, 'off', {@in_savedata, y, thisc}, ... + hx.addCustomButton('off', {@in_savedata, y, thisc}, ... 'export.gif', 'Export data...'); - pkg.i_addbutton2fig(tb, 'off', {@i_invertcolor, ax1, colorit, y, thisc, grouporder}, ... + hx.addCustomButton('off', {@i_invertcolor, ax1, colorit, y, thisc, grouporder}, ... "xpowerpoint.gif", 'Switch to BW'); - P = get(f, 'Position'); - set(f, 'Position', [P(1) - 20 * k, P(2) - 20 * k, P(3), P(4)]); - set(f, 'visible', 'on'); - f.Position(3) = f.Position(3) * 2.2; - drawnow; - F{k} = f; + P = get(hFig, 'Position'); + set(hFig, 'Position', [P(1) - 20 * k, P(2) - 20 * k, P(3), P(4)]); + hFig.Position(3) = hFig.Position(3) * 2.2; + hx.show; + F{k} = hFig; end gui.i_export2pptx(F, glist); diff --git a/+gui/i_singlegraph.m b/+gui/i_singlegraph.m index 588bf2a9..5eb72cbd 100644 --- a/+gui/i_singlegraph.m +++ b/+gui/i_singlegraph.m @@ -33,7 +33,6 @@ function i_singlegraph(G1, figname, parentfig) %hx.ptvenable(logical([1 1 1 1 1 0 1 1 1 1 0])); hx.addCustomButton('off', @ChangeWeight, 'noun_Weight_2243621.gif', 'ChangeWeight'); hx.addCustomButton('off', @ChangeFontSize, 'noun_font_size_591141.gif', 'ChangeFontSize'); -%pkg.i_addbutton2fig(tb, 'off', @ChangeWeight, 'noun_Weight_2243621.gif', 'ChangeWeight'); hx.addCustomButton('off', @ChangeLayout, 'noun_Layout_792775.gif', 'ChangeLayout'); hx.addCustomButton('off', @ChangeDirected, 'noun_directional_arrows_3497928.gif', 'ChangeDirected'); hx.addCustomButton('off', @AnimateCutoff, 'noun_trim_3665385.gif', 'AnimateCutoff'); diff --git a/+gui/i_stemscatterfig.m b/+gui/i_stemscatterfig.m index 6a290bdd..4c2fbb9d 100644 --- a/+gui/i_stemscatterfig.m +++ b/+gui/i_stemscatterfig.m @@ -16,7 +16,6 @@ hx.addCustomButton('on', @in_geneheatmapx, 'greenarrowicon.gif', 'Heatmap'); hx.addCustomButton('on', @i_genedotplot, 'greencircleicon.gif', 'Dot plot'); hx.addCustomButton('on', @i_viewgenenames, 'HDF_point.gif', 'Show gene names'); -%pkg.i_addbutton2fig(tb,'on',@i_viewscatter3,'icon-mat-blur-on-10.gif','Show scatter plot'); hx.addCustomButton('on', @in_heatscatterplot,'icon-mat-blur-on-10.gif','Show heat scatter plot'); hx.show(parentfig); diff --git a/+ten/e_mkqqplot.m b/+ten/e_mkqqplot.m index eb2e1d1c..675e0326 100644 --- a/+ten/e_mkqqplot.m +++ b/+ten/e_mkqqplot.m @@ -11,19 +11,7 @@ function e_mkqqplot(T) [~, idx] = sort(T.FC); dt = datacursormode; dt.UpdateFcn = {@i_myupdatefcn1x, T.genelist(idx)}; - - -% tb = findall(hFig, 'Tag', 'FigureToolBar'); -%tb = uitoolbar('Parent', hFig); -%uipushtool(tb, 'Separator', 'off'); - -%tb = uitoolbar('Parent', hFig); -%hx.addCustomButton('off', @gui.i_changefontsize, 'noun_font_size_591141.gif', 'ChangeFontSize'); -%hx.addCustomButton('on', {@gui.i_savemainfig, 3}, "powerpoint.gif", 'Save Figure to PowerPoint File...'); -%hx.addCustomButton('off', {@gui.i_savemainfig, 2}, "svg.gif", 'Save Figure as Graphic File...'); -%hx.addCustomButton('off', {@gui.i_savemainfig, 1}, "svg.gif", 'Save Figure as SVG File...'); -hx.addCustomButton('on', @i_savetable, 'export.gif', 'Export data...'); -%hx.addCustomButton('on', {@gui.i_resizewin, hFig}, 'HDF_pointx.gif', 'Resize Plot Window'); +hx.addCustomButton('off', @i_savetable, 'export.gif', 'Export data...'); hx.show();