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

Re: st: Queries on graph 8


From   [email protected]
To   [email protected]
Subject   Re: st: Queries on graph 8
Date   Mon, 27 Jan 2003 16:40:42 -0600

David Schwappach wrote:

> I too have been having similar difficulties.  I'm on a Mac OS X machine.  When
> I print a graph directly from Stata, it looks great, crisp lines, etc.  When I
> paste it into Word or do Import Picture From File, it never looks anywhere
> near as good.  The ax is labels, which are rotated 90 degrees, are virtually
> unreadable.

If you when you say "it never looks anywhere near as good" you're referring to
the rotated text on the axis, then the limitation is in the Macintosh's
Quickdraw graphics engine.  Quickdraw does not support rotated text.

For Stata to simulate rotated text on the Macintosh (as well as Unix X-Windows
which also does not support rotated text), Stata must draw the text
horizontally into a bitmap, rotated the bitmap and then draw the bitmap back
on top of the graph.

In addition, both the Macintosh and Unix versions limit text rotation to 90
degree intervals.  However, there is a bug in the rotated text code where only
text rotated 90 degrees works properly.  180 and 270 degrees don't work
properly and we're working on a fix for that.

Bitmaps do not scale or print well.  Just print a web page with graphics to
see what I mean.  To get the best results when exporting a graph from Stata,
you should use the EPS format.  Unfortunately, this requires a PostScript
printer if you want to print the graph from another application.

If you're not referring to just the rotated text as looking bad but the graph
as a whole looking bad when pasted into Word, then the fault lies with Word.

When Stata draws a graph, it uses the exact same operating system drawing
commands to draw lines, arcs, text, etc. regardless of whether it's drawing to
the screen, printer, clipboard, or exporting to a file.  The nice thing about
this is that you tell the operating system to record the following drawing
commands, draw the image, and send the recorded drawing commands to the
clipboard or a file.

Now once the file is pasted or read into another application, the application
has to translate those drawing commands to its own internal format.
Sometimes, it just does a really bad job of translating.  Years ago, Word used
to have a problem with circles that were drawn as 360 degree arcs.  It used to
think a 360 degree arc was the same thing as a 0 degree arc so nothing would
show up.  It would also improperly translate tick marks so that rather than
being perfectly verticaly or horizontal, they would be slightly slanted.  The
latest versions of Word seem to do a much better job though.  I just pasted a
Stata 8 graph in Word X for Macintosh and it appeared fine.

Now I've got good news and bad news.

The good news is that we've rewritten the low-level graphics code on Stata 8
for the Macintosh to use OS X's Quartz 2D drawing engine.  What this means is
graphs will have crisp anti-aliased lines, true rotated text, end caps, 
fractional sizes and coordinates, and many other features.  This will be in
the next update and it's free!

The bad news is that Apple has not updated the clipboard format for images yet
so you're still limited to the PICT format when copying to the clipboard.
You'll only get to see the improvements on the screen or when printing
directly from Stata.  Otherwise, you'll still have to use EPS for best
results.

We believe Apple will use the PDF format for the clipboard but of course all
applications, including Word, will have to be updated to support this format.
Whatever format Apple uses, we'll update Stata to support it.

> Also, I am having some difficulty even exporting the file.  I'll have a
> statement such as:
> 
> -graph export repayment.pct, replace-
> 
> which yields this message:
> 
> output-file suffix "pct" not recognized
>     specify correct suffix or specify as() option
> r(198);
> 
> The "pct" suffix, incidentally, is what I get when I save the graph using the
> pull-down menus.  When I tried using the "pic" or "pict" suffix (whatever is
> in the manual), I get some other message.  Definitely seems buggy.  I look
> forward to an explanatio n & better yet, a fix.

Definitely sounds like a bug.  We'll look into this.

-Chinh Nguyen
 [email protected]
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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