Hello,
I am trying to add color/markers to row states through Flags mentioned in a particular column. For instance, working on the Cities dataset, I created random flags (5 different classes of flags) for few rows, and most are empty. Now, the majority of those values are plotted with a single black dot, I am fine with it. But, the major issue arises, when I try to create an individual value plot with a legend. I do not want the black dot to show up on the legend, I want the 5 different classes with different colors to show up.
dlg = Column Dialog(
yList = Col List( "Ys",
Min Col(1)
),
xList = Col List( "Xs",
Min Col(1),
Max Col(1)
),
byList = Col List( "Color/Mark By",
Max Col(1)
)
);
_files = dlg["byList"];
dt << Color or Mark by Column( _files[1], Marker Theme( "solid" ), Color Theme("JMP default") );
meas_cols = dt << Get Column Names("String");
// Get the selected X and Y columns
x_col = dlg["xList"];
y_cols = dlg["yList"];
// Create new window with a vertical list box to store graph builder objects
nw = New Window( "graphs", <<journal, myVLB = V List Box() );
// Iterate over the Y columns and create a Graph Builder plot for each column
For(i = 1, i <= N Items(y_cols), i++,
y_name = Char(y_cols[i]);
x_name = Char(x_col[1]);
gb = dt << Graph Builder(
Size(700, 350),
Show Control Panel(0),
Show Footer(0),
Variables(X(x_col[1]), Y(y_cols[i])),
Elements(Points(X, Y, Legend(24))),
invisible,
SendToReport(
Dispatch(
{},
"Graph Builder",
OutlineBox,
{Set Title( y_name || " vs " || x_name ), Image Export Display( Normal )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Marker Size( 5 ), Transparency(1)}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "" )}
),
Dispatch(
{},
"X title",
TextEditBox,
{Set Text( "" )}
)
// Dispatch(
// {},
// "Y title",
// TextEditBox,
// {Set Text( "" )}
// ),
)
);
gb << Show Legend(1);
myVLB << append( Report( gb ) );
// Save the plot as an image with specified width, height, and format (optional)
// gb << Save Picture("Plot_" || Char(i) || ".emf", EMF);
gb << delete;
);