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 at the end of May, and its replacement, statalist.org 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" <JESLIN01@geh.regionh.dk>
To   <statalist@hsphsun2.harvard.edu>
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
files!!!!!

Thanks,

Jesper


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Scott
Merryman
Sent: 17 August 2011 15:14
To: statalist@hsphsun2.harvard.edu
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
Settings\scott.merryman\Desktop\Graph.gph",replace

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

to

__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
Settings\scott.merryman\Desktop\Graph_new.gph"

Scott


On Wed, Aug 17, 2011 at 4:36 AM, Jesper Lindhardsen
<JESLIN01@geh.regionh.dk> 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:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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