03-03-2015 03:46 PM
I have a two fold question:
1. I Would like to replace Y axis values with legend is it possible to do this SAS GTL or any other SAS procedure? Alternatively how to place circle filled next to the y axis values. As an example, please see below for the graph, I would like to place blue filled circle next to Philip, and red filled circle next to Ronald.
2. How to manually specify the colors for the filled circle ?
Please SAS code for reproduciblity.
define statgraph dotplot;
layout overlay/yaxisopts = (type=discrete griddisplay=on reverse=true);
scatterplot x = weight y=name/markerattrs=(symbol=circlefilled) name='dot' group = name
legendlabel = 'Weight';
discretelegend 'dot'/halign = left ORDER=rowmajor across=1 BORDER = FALSE pad=(top=5 bottom=5);
proc sort data = sashelp.class out = class;
by descending weight;
proc sgrender data = class template = dotplot;
03-03-2015 04:32 PM
Creating a unique, distinct colors for this many category values would be extremely difficult because the color perception of people can vary widely. It appears that your goal is to improve the association of the dot to the category value. I'm not sure of your SAS version, but consider trying color bands to help with the association:
proc sgplot data=sashelp.class;
dot name / response=weight categoryorder=respdesc;