How can I print a biograph to a Handle Graphics figure programmatically in MATLAB 7.9 (R2009b)?
1 view (last 30 days)
Show older comments
I want to print my biograph to a Handle Graphics figure from the command line. I can do this from the biograph window itself by selecting the File menu -> Print to Figure option.
My end goal is to export the biograph to a file.
Accepted Answer
MathWorks Support Team
on 7 Jan 2010
The ability to print a biograph to a figure from the command line is not available in the Bioinformatics Toolbox 3.4 (R2009b).
As a workaround you can use the COPYOBJ function to copy the contents of axes in the biograph viewer to another figure and then print that figure. The code below is an illustration:
cm = [0 1 1 0 0;1 0 0 1 1;1 0 0 0 0;0 0 0 0 1;1 0 1 0 0];
bg = biograph(cm);
g = biograph.bggui(bg);
f = figure;
copyobj(g.biograph.hgAxes,f);
Alternatively, you can use the following code to find the handle to the figure containing the biograph object, and export the figure using the PRINT command:
f = get(g.biograph.hgAxes, 'Parent');
print(f, '-djpeg', 'test.jpg')
%You can also make the handle to the figure visible to PRINT and other functions by executing
set(f, 'HandleVisibility', 'on')
0 Comments
More Answers (0)
See Also
Categories
Find more on MATLAB Report Generator 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!