Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Graph editor: Change order of subgraphs in bygraph ?

From   "Jesper Lindhardsen" <>
To   <>
Subject   RE: st: Graph editor: Change order of subgraphs in bygraph ?
Date   Thu, 18 Aug 2011 08:52:04 +0200

Scott, You are a lifesaver. This works perfectly. I must confess I am
intrigued as to how you came up with this solution?
On a personal note, I do think one should have this possibility
available from inside the editor, rather than hacking stata graph



-----Original Message-----
[] On Behalf Of Scott
Sent: 17 August 2011 15:14
Subject: Re: st: Graph editor: Change order of subgraphs in bygraph ?

This appears to work in swithing the location of graph 4 with graph 1:

sysuse sp500,clear
xtile g= date, n(4)
twoway bar change date , by(g,  rescale  ) xlabel(, labsize(*.7))
graph save Graph "C:\Documents and

Then open up the Graph.gph file in an editor.

Edit the lines 447-451 that start with __NOLOG__:

__NOLOG__ .graphs[1] =.__Map.K820a880.ref
__NOLOG__ .graphs[2] =.__Map.K82de008.ref
__NOLOG__ .graphs[3] =.__Map.K8338df8.ref
__NOLOG__ .graphs[4] =.__Map.K8392de0.ref


__NOLOG__ .graphs[4] =.__Map.K820a880.ref
__NOLOG__ .graphs[2] =.__Map.K82de008.ref
__NOLOG__ .graphs[3] =.__Map.K8338df8.ref
__NOLOG__ .graphs[1] =.__Map.K8392de0.ref

save the file as Graph_new.gph and open the file in Stata

graph use "C:\Documents and


On Wed, Aug 17, 2011 at 4:36 AM, Jesper Lindhardsen
<> wrote:
> Hi Listers,
> I've been sent a graph (.gph format created with Stata 11) consisting
of 4 subgraphs (a twoway bar graph created with byoptions on subcat with
4 categories). Unfortunately, I need to change the order of appearance -
not just insert holes or render down instead of across. I cannot find an
option to do this in the graph editor. Am I missing something or do I
have to ask the sender to change the underlying categry coding ??
> Using Stata version 11.1 on windows XP.
> Best regards,
> Jesper

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index