Hey all,
New member here, first time posting. I'm working in stata right now, using a foreach loop to create graphs. The problem comes with saving the graphs. My code keeps writing the plots on top of each other instead of saving, then writing a new graph for the next one.
Here is my code:
foreach x of var country {
twoway (line _total_ year if country == `x', yaxis(1)) (line _score year if country == `x', yaxis(2)), xtitle(Year) title(`x' Total and Score) saving(`x' Total and Score)
}
It gives me one graph with the total and score of each country instead of separate graphs. Ideally I'd like to put in $path\save graphs here\ but I can't seem to get the `x' in the filename to work. It always comes out as country
Thanks for any help!
New member here, first time posting. I'm working in stata right now, using a foreach loop to create graphs. The problem comes with saving the graphs. My code keeps writing the plots on top of each other instead of saving, then writing a new graph for the next one.
Here is my code:
foreach x of var country {
twoway (line _total_ year if country == `x', yaxis(1)) (line _score year if country == `x', yaxis(2)), xtitle(Year) title(`x' Total and Score) saving(`x' Total and Score)
}
It gives me one graph with the total and score of each country instead of separate graphs. Ideally I'd like to put in $path\save graphs here\ but I can't seem to get the `x' in the filename to work. It always comes out as country
Thanks for any help!
Comment