[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Graph matrix title apostrophe problem

From   [email protected] (Vince Wiggins, StataCorp)
To   [email protected]
Subject   Re: st: Graph matrix title apostrophe problem
Date   Thu, 06 Sep 2007 11:18:23 -0500

Brendan Halpin <[email protected]> reports,

> With Stata 9's graph matrix command, the title option has problems
> with apostrophes:
> . graph matrix Xo Xv100, title("test's")
> quotes unbalanced
> r(198);
> it doesn't seem to happen with other formats:
> . scatter Xo Xv100, title("test's")

Brendan's right, -graph matrix- has problems with titles (and subtitles,
notes, and captions) that have contain apostrophes -- "'".  At first glance,
this problem appears to be limited to -graph matrix-, though we will look

We will fix this in the next ado update.

Regarding, Sergiy Radyakin's <[email protected]> creative work-around
(Sergiy must be doing an awful lot of playing with the underpinnings of
graphics, reading my talks about those underpinnings, or both), I have two
comments.  Sergiy suggested,

    . sysuse auto
    . graph matrix l w, title("whatever")
    . .Graph.title.text[1]="test's"
    . .Graph.drawgraph

First, change

    . .Graph.title.text[1]="test's"
    . _gm_edit .Graph.title.text[1]="test's"

Prefixing with -_gm_edit- registers the edit with the graph so that it will be
shown if the graph is saved and used.  Without the -_gm_edit- the title will
not appear if the graph is saved and later -graph use-ed.  Don't look for
documentation on this trick, we have not formalized access to this layer of
the graphics system.

Second, change

    . .Graph.drawgraph
    . graph display

This just replaces the low-level invocation of the drawing member function of
the graph class with it's nearly equivalent, but documented and easier to use,
command -- -graph display-.

-- Vince 
   [email protected]

*   For searches and help try:

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