- using a custom scheme,
- explicitly declaring the bar color to be one of the default colors defined within the given scheme file
- adjusting the transparency of this bar color.
Code:
hist mpg, fcolor("scheme p1%50") scheme(economist)
Code:
color p1 maroon
Code:
color p1 "230 92 92"
Code:
net install schemepack, from("https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/") replace sysuse auto, clear hist mpg, fcolor("230 92 92%50") scheme(neon) name(g1,replace) title("with RGB color") hist mpg, fcolor("26 71 111%50") scheme(s2color) name(g2,replace) title("with RGB color") hist mpg, fcolor("scheme p1%50") scheme(neon) name(g3,replace) title("with scheme pX color") hist mpg, fcolor("scheme p1%50") scheme(s2color) name(g4,replace) title("with scheme pX color") graph combine g1 g2 g3 g4
The bottom-left chart is the one with failed transparency. I suspect the problem is that the color p1 in the corresponding scheme file is defined as an RGB in parentheses, and these parentheses mess up the fcolor("scheme p1%50") option.
Would you happen to know whether there is a way to make the command below work properly?
Code:
hist mpg, fcolor("scheme p1%50") scheme(neon)
Thank you,
Jan
0 Response to Transparency in graphs not working with scheme-specific colors
Post a Comment