Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: stata under X11

From (Shannon Driver, StataCorp)
Subject   Re: st: stata under X11
Date   Thu, 30 Sep 2004 09:46:34 -0500

Stephen Brown <> wrote:

> I normally run stata on a unix machine that I access using X11 (an
> Xwindows client running on a Mac, similar to using a a Wintel machine
> with Exceed.)
> Most of the time I am happy running with stata in terminal mode. But
> if I should want to see a graph occasionally, then under stata6 and
> stata7, graphs are readily available.
> Running stata8, this appears not to be the case. It seems that to get
> any graphic capability at all, I have to invoke xstata (rather than
> stata). But this program is so graphically intensive (like SAS) that
> everything to do with stata is horribly slow - especially if I am
> working from home over a DSL line.
> Am I missing something? i.e. is there a way in the terminal type
> version of stata8 to get the graphic window back on an "as and when
> required " basis - as it was in previous versions?

There is no way to view graphics in the console version of Stata 8.  I do,
however, have a fairly simple workaround that may be of interest to you.

Here is a wrapper program that you can use or modify as you wish.

-----Begin mygraph.ado-----

*! version 1.0.0  SRD 30sep2004
program mygraph
	version 8.2
	tempfile mygraph
	qui graph export "`mygraph'", as(eps) replace
	!gv "`mygraph'"

-----End mygraph.ado-----

To call this program, you would simply type -mygraph <your graph command>-.
The graph command that you give it will be executed.  A tempfile will then be
created, and the graph will be exported to .eps format.  The final command,
-!gv ...-, is a shell call to Ghostview.  This should open Ghostview with your
graph loaded in the window.  One slight issue with this is that Stata will stop
until you close Ghostview.

--Shannon Driver

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index