Hi all,
In yesterdays lab section I briefly went over how to edit graphs using the graph editor. I want to share how to get the source code from the edited graph in order to add to your do file.
When editing the graph in graph editor, start recording using the record symbol at the bottom of editor before making any edits and then save the recording after as a .grec file (you can open this in word as plain/rich text)
When you open the the .grec file in word you will find a line of code for each edit.
Add the line of code into your do file for your graph prefacing the command with gr_edit.
For example, for question 2g in HW 3 I wanted to center the caption. I went into graph editor and centered the caption through the menus and saved my recording. My .grec file associated with the graph editor recording had the following code:
.caption.style.editstyle box_alignment(center) editcopy
I used the gr_edit command and added the following line of code into my do file:
gr_edit .caption.style.editstyle box_alignment(center) editcopy
When I re-ran my code from my do file the resulting graph had a centered caption.
I know this seems like a lot, but it's honestly not too bad once you understand the process of getting the code from the graph editor. The graph editor is a great tool if you are getting stuck formatting your graphs.
I'm happy to zoom if you need more help with this
Stata forum help on graph editor: