Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
Kelly
Level III

How do I change legend color on graph builder with box plots?

Hello,

 

I am trying to change the second item in the legend to be black instead of red.

 

 

Inside of my graph builder function I use the following line of code to do this. (line color 0 = black)

Dispatch( {}, "400", ScaleBox, {Legend Model( 3, Properties( 1, {Line Color( 0 )}, Item ID("4TB", 1 ) ) )} )

This is how my plot turns out:

 

Kelly_1-1579047658332.png

 

 

The box plot turns black, but the legend is blue, and the outlier data points are blue. They should be black. 
Am I missing an extra line of code to change the data points to be black?

Thanks for the help!

 

 

2 REPLIES 2
Highlighted

Re: How do I change legend color on graph builder with box plots?

Make the changes interactively in Graph Builder, then click the red triangle at the top and select Save Script > To Script Window. You will see the code that necessary to get all the changes that you want.

Learn it once, use it forever!
Kelly
Level III

Re: How do I change legend color on graph builder with box plots?

 

I realized that it is another problem. I can make the graph as @markbailey suggested by saving the script and running that. But when I save as journal and open it the plot has the wrong color.

 

On the left I have the plot I created with age = 15 set to black.
On the right is the same plot but it has been saved as journal and opened. Now age = 15 has a green data point that should be black.

Kelly_0-1579126105497.png

 

Thanks,

Kelly

 

Article Labels

    There are no labels assigned to this post.