Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
biograph/view

Subject: biograph/view

From: Kevin Murphy

Date: 10 May, 2008 23:13:50

Message: 1 of 9

Hi

When I called view(biograph object), it pops a window called "biograph
viewer N".But I don't know how to change the title of this, or how to
close it from the command line (it does not response to close all).

How do I make it automatically print this to a Matlab figure (which
behaves normally)
and then close the original?

Kevin

Subject: biograph/view

From: erp

Date: 5 Jun, 2008 15:30:08

Message: 2 of 9

On May 10, 7:13=A0pm, Kevin Murphy <murph...@gmail.com> wrote:
> Hi
>
> When I called view(biograph object), it pops a window called "biograph
> viewer N".But I don't know how to change the title of this, or how to
> close it from the command line (it does not response to close all).
>
> How do I make it automatically print this to a Matlab figure (which
> behaves normally)
> and then close the original?
>
> Kevin

this drives me crazy also. I have e-mailed the matlab people. If
they ever respond I'll let you know what they tell me

Subject: biograph/view

From: rdcoll@gmail.com

Date: 24 Jun, 2008 02:47:04

Message: 3 of 9

On Jun 5, 11:30 am, erp <wyatt.travis.cl...@gmail.com> wrote:
> On May 10, 7:13 pm, Kevin Murphy <murph...@gmail.com> wrote:
>
> > Hi
>
> > When I called view(biograph object), it pops a window called "biograph
> > viewer N".But I don't know how to change the title of this, or how to
> > close it from the command line (it does not response to close all).
>
> > How do I make it automatically print this to a Matlab figure (which
> > behaves normally)
> > and then close the original?
>
> > Kevin
>
> this drives me crazy also. I have e-mailed the matlab people. If
> they ever respond I'll let you know what they tell me


Hi guys,

I am pretty new to Matlab myself, but are you looking for "close all
hidden" ?

- Rob

Subject: biograph/view

From: Giulio Genovese

Date: 11 Sep, 2008 21:49:02

Message: 4 of 9

I had the same problem and I finally figure out how to solve it by reading the matlab code for the view function and the biograph.bggui function. This is a sort of a hack but I doubt there is an easier way to print the figure from the command line.
g = biograph.bggui(bg);
f = figure();
copyobj(g.biograph.hgAxes,f);
print(['-f' num2str(f)],'-deps','print.eps')
close(f);
close(g.hgFigure);
Basically the "Biograph Viewer" is just a figure with a handle that is hidden. Because the print command does not take a figure handle for an argument, you need to make a new figure. Making it with the 'Visible' option set to 'off' at least avoids it to pop up. I hope this helps.

Subject: biograph/view

From: Lisa

Date: 24 Mar, 2009 15:23:01

Message: 5 of 9

"Giulio Genovese" <nospam@gmail.com> wrote in message <gac3oe$cl4$1@fred.mathworks.com>...
> I had the same problem and I finally figure out how to solve it by reading the matlab code for the view function and the biograph.bggui function. This is a sort of a hack but I doubt there is an easier way to print the figure from the command line.
> g = biograph.bggui(bg);
> f = figure();
> copyobj(g.biograph.hgAxes,f);
> print(['-f' num2str(f)],'-deps','print.eps')
> close(f);
> close(g.hgFigure);
> Basically the "Biograph Viewer" is just a figure with a handle that is hidden. Because the print command does not take a figure handle for an argument, you need to make a new figure. Making it with the 'Visible' option set to 'off' at least avoids it to pop up. I hope this helps.

Hi,

I'm also struggling to save the biograph object to file. The 'hack' above gets me most of the way there, but my biograph extends beyond the boundaries of the resulting eps file.

Is there a way of extracting the dimensions of the biograph object (I'm not able to find any obvious information in the biograph.bggui object that describes the dimensions) so that I can define a custom paper size for print()?

Ta, Lisa

Subject: biograph/view

From: Moran

Date: 13 Aug, 2009 16:05:08

Message: 6 of 9

Here is a way I found through the Matlab site:

 G.view;
           
child_handles = allchild(0);
names = get(child_handles,'Name');
k = find(strncmp('Biograph Viewer', names, 15));
print(child_handles(k),'-dpng', '-r50',['graph_' num2str(i) '.thmb.png']);

Enjoy!
Moran.

Subject: biograph/view

From: free seek

Date: 20 Aug, 2009 19:17:14

Message: 7 of 9

I have found another solution to the problem, by emulating what bggui.m does. Try these lines:
g = biograph.bggui(bg);
f = figure();
copyobj(g.biograph.hgAxes,f);
set(f,'units','points','position',figurePosition(g.hgFigure,g.biograph));
set(f,'PaperPositionMode','auto','Color',[1 1 1]);
print(['-f' num2str(f)],'-deps','print.eps');
close(f);
close(g.hgFigure);

Although you will have first to copy the function figurePosition on a separate file from the file bggui.m, good luck!

Subject: biograph/view

From: Brad Gulko

Date: 6 May, 2011 20:48:04

Message: 8 of 9

Kevin Murphy <murphyk2@gmail.com> wrote in message <243c9829-6511-4ea4-ad4e-82153a948c2e@y22g2000prd.googlegroups.com>...
> Hi
>
> When I called view(biograph object), it pops a window called "biograph
> viewer N".But I don't know how to change the title of this, or how to
> close it from the command line (it does not response to close all).
>
> How do I make it automatically print this to a Matlab figure (which
> behaves normally)
> and then close the original?
>
> Kevin

I don't know if you have fixed this yet, but here is what I did
in:
C:\Program Files\MATLAB\R2008b\toolbox\bioinfo\bioinfo\@biograph\@bggui\bggui.m

I replaced the line (around line 21)
    figureName = ['Biograph Viewer ' getbiographtoolnumber];

With
    if (~isempty(bho.Label))
       figureName = [ bho.Label ];
   else
       figureName = ['Biograph Viewer ' getbiographtoolnumber];
   end
 
Now the Graph 'Label' that you can provide with the biograph() call will appear in the title bar, or if no label, the default 'Biograph Viewer #' text.

Subject: biograph/view

From: Alejandro Ojeda

Date: 27 Jun, 2011 22:41:05

Message: 9 of 9

"free seek" wrote in message <gac3oe$cl4$1@fred.mathworks.com>...
> I had the same problem and I finally figure out how to solve it by reading the matlab code for the view function and the biograph.bggui function. This is a sort of a hack but I doubt there is an easier way to print the figure from the command line.
> g = biograph.bggui(bg);
> f = figure();
> copyobj(g.biograph.hgAxes,f);
> print(['-f' num2str(f)],'-deps','print.eps')
> close(f);
> close(g.hgFigure);
> Basically the "Biograph Viewer" is just a figure with a handle that is hidden. Because the print command does not take a figure handle for an argument, you need to make a new figure. Making it with the 'Visible' option set to 'off' at least avoids it to pop up. I hope this helps.


You also can do this:
g = biograph.bggui(BGobj);
handler = get(g.biograph.hgAxes,'parent');
set(handler,'Name','my name')

now you can control directly the figure because you get the handler

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us