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

Re: st: Scheme error message


From   [email protected] (Vince Wiggins, StataCorp)
To   [email protected]
Subject   Re: st: Scheme error message
Date   Wed, 08 Sep 2004 14:23:47 -0500

Friedrich Huebler <[email protected]> has followed the instructions in
[G] to create a new graphics scheme by first copying the official scheme file
s2color.scheme to another name.  He then changes the new file in a perfectly
legitimate way only to encounter "invalid syntax" messages when attempting to
draw a graph with the new scheme.

Documenting that the best way to create your own scheme was to copy an
existing scheme to a new name and then edit the new file was a bad idea and
the Graphics manual [G] should have been changed before it shipped.  I was
surprised to find that the help file schemes.hlp still contains this
suggestion, particularly since I was the last person to update that file.

Users wishing to create new schemes should do exactly what official schemes do
and that is to inherit the look of another official scheme by using a
-#include <official_scheme_name>- statement in their scheme file.  Friedrich
was attempting a minor modifications to the official s2color scheme, the
default scheme for Stata graphics.  In particular, all he wanted to do was
change the background color of the graph from -ltbluishgray- to -white-.  Here
is how I suggest he proceed,

        1)  Create a new scheme file in his personal ado directory.  
            Friedrich wanted his scheme named -s2colorfh-, so the file should
            be scheme-s2colorfh.scheme.

        2)  Edit the new file to #include s2color and make any desired changes
            to s2color.  (Note, to see the structure of a scheme file, follow
            the instructions in -help schemes- to locate scheme-s2color.scheme
            so that you can examine that file.)  In Friedrich's case his new
            file need contain only two lines:

            --------------------------- BEGIN --- scheme-s2colorfh.scheme --- 
            #include s2color
            color background white
            ----------------------------- END --- scheme-s2colorfh.scheme --- 

That's it.  

Without going into details, the problem with copying an existing scheme is
that many changes to the -graph- command, including bug fixes, require
updating the base scheme file.  For that reason, it is best to inherit from
official scheme files or other files that have already inherited from an
official scheme file.

We did not originally document the structure of scheme files because we
expected substantial feedback from users of the new graphics system and we
further expected that feedback to lead to substantial changes in the scheme
files.  Our expectations were met and then some.  We appreciate the input of a
number of users who created schemes without documentation and noted where they
encountered difficulties.  Schemes are much more flexible today for their
input.

We are now comfortable that the structure of scheme files is sufficiently
stable to document.  That documentation will become available toward the end
of September as -help scheme files-.  As is usually the case, the documenting
process has led to some changes that will make creating custom schemes easier.


-- Vince
   [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