Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dependance on Xfree86 for image creation!?

3 views
Skip to first unread message
Message has been deleted

Dave Tarkowski

unread,
May 8, 2003, 9:46:43 AM5/8/03
to
Brett,

I can't really address the why of your questions, but a practical
workaround is to use VNC. You can get the program at
http://www.uk.research.att.com/vnc/ but many Linux distributions also
include it.

VNC allows you to run a "virtual" X server that is not attached to a
physical display. Point MATLAB's display at the VNC display and it is
quite happy to generate plots in that display.

I use this method myself to generate plots.

-Dave Tarkowski

On Thu, 8 May 2003 08:40:45 -0500, Brett D. Estrade
<est...@nrlssc.navy.mil> wrote:
> If I run a cron job that invokes a shell script that in turn runs a matlab
> script which takes a data set and generates plots, why do I need to have
> an accesible X11 server running? As I understand it, in order to create
> images, MatLab accomplishes this by making some sort of "create
> window" call to the X11 server, and makes the image by getting a screen
> capture of this window.
>
> For me, this is very inconvenient because I can not be logged into my
> machine at all times. There is also no promise that there will be a valid
> X11 server to use on any of the hosts located on the LAN.
>
> My question are:
>
> 1) What thinking went into building its dependance on graphics generation
> on a running instance of X11?
>
> 2) Is there a way to generate graphics without have to make sure there is
> a running X11 server?
>
> 3) Has anyone else run into this issue?
>
> It is my feeling that if MatLab does not have the current capability to
> render on its own, something needs to be done about it. Many people in
> the scientific community use MatLab on Unix/Linux workstations and wish to
> allow for the processing of data and generation of plots offline. To me,
> this seems like a mighty large group of users to alienate.
>
> Brett
>
> --
> +------------------------------------+
> Brett D. Estrade
> Naval Research Laboratory, Code 7322
> Building 1009 Room C-120
> Stennis Space Center, MS 39529-5004
> phone: 228.688.4151
> +------------------------------------+
> alternate contact info:
> cell : 504.319.1757
> email: est...@yahoo.com
> +------------------------------------+
>

snmi...@xxxhotyyypop.com

unread,
May 8, 2003, 11:21:19 AM5/8/03
to
>>>>> "Brett" == Brett D Estrade <est...@nrlssc.navy.mil> writes:

Brett> If I run a cron job that invokes a shell script that in turn
Brett> runs a matlab script which takes a data set and generates
Brett> plots, why do I need to have an accesible X11 server running?
Brett> As I understand it, in order to create images, MatLab
Brett> accomplishes this by making some sort of "create window" call
Brett> to the X11 server, and makes the image by getting a screen
Brett> capture of this window.

Brett> For me, this is very inconvenient because I can not be logged
Brett> into my machine at all times. There is also no promise that
Brett> there will be a valid X11 server to use on any of the hosts
Brett> located on the LAN.

Brett> My question are:

Brett> 1) What thinking went into building its dependance on
Brett> graphics generation
Brett> on a running instance of X11?

Brett> 2) Is there a way to generate graphics without have to make
Brett> sure there is
Brett> a running X11 server?

Brett> 3) Has anyone else run into this issue?

Brett> It is my feeling that if MatLab does not have the current
Brett> capability to render on its own, something needs to be done
Brett> about it. Many people in the scientific community use MatLab
Brett> on Unix/Linux workstations and wish to allow for the
Brett> processing of data and generation of plots offline. To me,
Brett> this seems like a mighty large group of users to alienate.

Brett> Brett

Brett> -- +------------------------------------+ Brett D. Estrade

Brett> Naval Research Laboratory, Code 7322 Building 1009 Room C-120
Brett> Stennis Space Center, MS 39529-5004 phone: 228.688.4151
Brett> +------------------------------------+ alternate contact
Brett> info: cell : 504.319.1757 email: est...@yahoo.com
Brett> +------------------------------------+

Hi Brett

I faced the same problem a few months ago.

I came up with using Xvfb, which is null Xserver for the purpose. Xvfb
accepts all X requests but does not do anything with them. I also do
"set(0,'DefaultFigureVisible','off')" to turn off any actual displaying
of figures.

As for why Mathworks decided that plotting and display engines should be
intertwined, I believe it is beyond us lesser beings to understand the
will of the great software firms.

Satya
--
Remove XXX and YYY to get my address

Joshua Baker-LePain

unread,
May 8, 2003, 4:59:33 PM5/8/03
to
In article <uok7d1c...@quandary.nsc.com>, snmi...@XXXhotYYYpop.com wrote:
>
> I faced the same problem a few months ago.
>
> I came up with using Xvfb, which is null Xserver for the purpose. Xvfb
> accepts all X requests but does not do anything with them. I also do
> "set(0,'DefaultFigureVisible','off')" to turn off any actual displaying
> of figures.

Could you detail how you set this up? Also, does this work if you
want to make movies?

--
Joshua Baker-LePain
Department of Biomedical Engineering
Duke University

snmi...@xxxhotyyypop.com

unread,
May 8, 2003, 5:29:43 PM5/8/03
to
>>>>> "Joshua" == Joshua Baker-LePain <jl...@begone.spam.duke.edu> writes:

Joshua> In article <uok7d1c...@quandary.nsc.com>,


Joshua> snmi...@XXXhotYYYpop.com wrote:
>>
>> I faced the same problem a few months ago.
>>
>> I came up with using Xvfb, which is null Xserver for the
>> purpose. Xvfb accepts all X requests but does not do anything
>> with them. I also do "set(0,'DefaultFigureVisible','off')" to
>> turn off any actual displaying of figures.

Joshua> Could you detail how you set this up? Also, does this work
Joshua> if you want to make movies?

Joshua> -- Joshua Baker-LePain Department of Biomedical Engineering
Joshua> Duke University
You can search the internet for Xvfb for your OS. Should be able to get
it for Solaris at ibiblio.org solaris repository.

Xvfb does not need root previleges to run as it does not control any
hardware. I usually run it as 'Xvfb -pn -ac :1'. -pn tells it to ignore
not being able to use the unix socket interface and -ac tells it to
disable all access control. :1 means it attaches itself to DISPLAY
1. Then you can run matlab as
matlab -nojvm -nosplash -display `hostname`:1 -r 'matlab_command'.

or if you have compiled the matlab code, run it as

compiled_command -display `hostname`:1

Hope this helps. The disadvantage with this method is that you don't
have access to the figures at any time. All you can do is use 'print' to
print the figures into postscript files or you can use 'hgsave' to save
the figure for later opening in MATLAB.

I use "set(0,'DefaultFigureVisible','off')" in the matlab code to set
the Visible property on all figures to 'off'. As long as you don't call
any functions that set the Visible property to 'on' (e.g. figure), the
figures will not be rendered. That saves quite a bit of computational
time if you have a fairly complex figure.

I believe it should work for movies too, but I have never tried it.

Joshua Baker-LePain

unread,
May 9, 2003, 7:54:45 AM5/9/03
to
In article <uobrydc...@quandary.nsc.com>, snmi...@XXXhotYYYpop.com wrote:

> You can search the internet for Xvfb for your OS. Should be able to get
> it for Solaris at ibiblio.org solaris repository.

For the archives, Xvfb on Linux is part of XFree86. On a RedHat box,
it's the XFree86-Xvfb package.

*snip VERY useful instructions*



> Hope this helps. The disadvantage with this method is that you don't
> have access to the figures at any time. All you can do is use 'print' to
> print the figures into postscript files or you can use 'hgsave' to save
> the figure for later opening in MATLAB.
>
> I use "set(0,'DefaultFigureVisible','off')" in the matlab code to set
> the Visible property on all figures to 'off'. As long as you don't call
> any functions that set the Visible property to 'on' (e.g. figure), the
> figures will not be rendered. That saves quite a bit of computational
> time if you have a fairly complex figure.
>
> I believe it should work for movies too, but I have never tried it.

Thanks *very* much for posting this. If it works for movies (which
I'll be testing), this will be exceedingly handy for our whole group.

--
Joshua Baker-LePain
Department of Biomedical Engineering

Duke University

Eric Ludlam

unread,
May 9, 2003, 12:36:24 PM5/9/03
to
>>> "Brett D. Estrade" <est...@nrlssc.navy.mil> seems to think that:

>If I run a cron job that invokes a shell script that in turn runs a matlab
>script which takes a data set and generates plots, why do I need to have
>an accesible X11 server running? As I understand it, in order to create
>images, MatLab accomplishes this by making some sort of "create
>window" call to the X11 server, and makes the image by getting a screen
>capture of this window.
>
>For me, this is very inconvenient because I can not be logged into my
>machine at all times. There is also no promise that there will be a valid
>X11 server to use on any of the hosts located on the LAN.
>
>My question are:
>
>1) What thinking went into building its dependance on graphics generation
>on a running instance of X11?
>
>2) Is there a way to generate graphics without have to make sure there is
>a running X11 server?
>
>3) Has anyone else run into this issue?
>
>It is my feeling that if MatLab does not have the current capability to
>render on its own, something needs to be done about it. Many people in
>the scientific community use MatLab on Unix/Linux workstations and wish to
>allow for the processing of data and generation of plots offline. To me,
>this seems like a mighty large group of users to alienate.

An easy way to work around the problem is to use the print command.
If you choose to print into a EPS file, you can convert the EPS file
into other forms of images like jpg, tiff, or whatnot using
ghostscript.

Eric

--
Eric Ludlam "Photonic Doodler" The MathWorks x 7556
elu...@mathworks.com (work) http://www.mathworks.com
er...@siege-engine.com (home) http://www.siege-engine.com

0 new messages