Dear all,
I am using Ben Jann's user written -grstyle- package from SSC to create graphs with different color palettes. I would like to combine two graphs but retain the different color palettes used when they were originally created. Instead what happens is the color palette from the first graph listed in the graph combine command is applied to the second/remaining graphs.
Is there a way to specify color palettes (or other grstyle attributes) when combining graphs? My eventual goal is to produce 8-10 sets of graphs for different outcome indicators by region, wealth quintile, and urban/rural residence, but to have all of the graphs that are by wealth quintile using the ptol palette, to help orient readers a bit better. (Merits of this approach may be debatable but are not my primary question!)
An example:
The -graph combine- help file notes that one can specify a commonscheme (and that if not specified, the graphs will retain their original scheme), but I may be not familiar enough with schemes, as when I substitute e.g. "set scheme s1mono" and "set scheme economist" for the two grstyle commands above, the same result occurs -- both graphs have the s1mono scheme.
thank you,
Hannah
I am using Ben Jann's user written -grstyle- package from SSC to create graphs with different color palettes. I would like to combine two graphs but retain the different color palettes used when they were originally created. Instead what happens is the color palette from the first graph listed in the graph combine command is applied to the second/remaining graphs.
Is there a way to specify color palettes (or other grstyle attributes) when combining graphs? My eventual goal is to produce 8-10 sets of graphs for different outcome indicators by region, wealth quintile, and urban/rural residence, but to have all of the graphs that are by wealth quintile using the ptol palette, to help orient readers a bit better. (Merits of this approach may be debatable but are not my primary question!)
An example:
Code:
sysuse auto, clear ssc install grstyle // if not already installed grstyle init sort weight * by foreign: grstyle set color Set2 foreach var of varlist price mpg { twoway connected `var' weight if foreign==1, lw(thick) || connected `var' weight if foreign==0, lw(thick) graph save foreign_`var'.gph, replace } * by rep78: grstyle set color ptol foreach var of varlist price mpg { twoway connected `var' weight if rep78==1, lw(thick) || connected `var' weight if rep78==2, lw(thick) || connected `var' weight if rep78==3, lw(thick) || connected `var' weight if rep78==4, lw(thick) || connected `var' weight if rep78==5, lw(thick) graph save rep78_`var'.gph, replace } graph combine rep78_price_trend.gph foreign_price_trend.gph // both graphs have Set2 palette graph combine foreign_price_trend.gph rep78_price_trend.gph // both graphs have ptol palette
thank you,
Hannah
Comment