Hi all,
I have a script that creates several plots as output. One graph is a stacked proportion plot and I am trying to get the color theme on it to match another plot (which is based on a continuous gradient color theme that goes from Black to light gray). The data table used for this graph has three columns: an index column, a category column, and a proportion column. The "Category Column" has values that range from 1 to some integer (so the number of levels in this column could change and is data-table dependent).
This is the script I'm using:
Graph Builder( Show Control Panel( 0 ),
Categorical Color Theme( {"White to Black Copy", 2051, {"Black", {221, 221, 221}}} ),
Variables(
X( :Index, Order By( :Proportion, Descending, Order Statistic( "N" ) ) ),
Y( :Proportion ),
Overlay( :Category ) ),
Elements( Bar( X, Y, Legend( 2 ), Bar Style( "Stacked" ) ) ),
SendToReport(
Dispatch( {}, "Proportion", ScaleBox, {Max( 1.02 )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Index" )})
)
)
So rows with category at level "1" should be black and then get progressively lighter for the next levels. However, when I create the plot, the level 1 boxes are always a few shades lighter than black:

Any ideas how to fix or why it does this? I realize this isn't a huge deal in the long run, but am curious why the script does this.
Thanks much.
Sarah