Hello I have been trying and searched all around the internet how to code this, I am pretty sure it is simple but i am going in circles and hope that someone here can help me notably i tried to follow the advice here, unsuccessfully https://blogs.sas.com/content/graphicallyspeaking/2016/02/04/legend-order/ I am trying to invert the order of the legend of the attached plot so it matches that of the bars - as you can see for now you have in the plot the legend starts with Staphylococcus aureus on top, when in the plot it is at the bottom. It would be much more readable if the order of the legend matched that of the plot thanks in advance regards Alex ods html image_dpi=300;
title Frequency of pathogens by location of onset;
proc sgplot data=klfig.path;
vbar location / response=Percent group=Pathogen groupdisplay=stack SEGLABELFORMAT=percent10.1 seglabel grouporder=reversedata;
xaxis discreteorder=data;
yaxis grid values=(0 to 1 by 0.1) label="Percentage of each Pathogen" discreteorder=data;
keylegend / location=outside position=right across=1 title="order needs inverted";
run;
... View more