I'm trying to control the chart titles for a large series of charts from a do file but am having a problem when the title text includes a comma
For simplicity I've replicated the issue here using auto.dta
When I type in a title with a comma directly it works fine (see uploaded png)
When I save the graph command as a do file and then try to control the title text from a master do file it won't work because the comma is now seen as a comma. I've tried compound quotes but these do not stop the comma from being seen as a comma and triggering an error because it then expects an option after the comma (here being "option row is not allowed".
do file 1: gphtest
do file 2: gphmaster
Many thanks
Gareth
For simplicity I've replicated the issue here using auto.dta
When I type in a title with a comma directly it works fine (see uploaded png)
Code:
sysuse auto.dta
graph bar (count), over(foreign) title("title row 1" "title, row2")
When I save the graph command as a do file and then try to control the title text from a master do file it won't work because the comma is now seen as a comma. I've tried compound quotes but these do not stop the comma from being seen as a comma and triggering an error because it then expects an option after the comma (here being "option row is not allowed".
do file 1: gphtest
Code:
graph bar (count), over(foreign) graph bar (count), over(foreign) title("`1'" "`2'")
Code:
do gphtest "title row 1" "title, row 2"
Many thanks
Gareth

Comment