Hi, I was running into a similar issue recently, in which I need to hide some of the x axis values in my graph. First, I used values=() option in the xaxis statement, but it did not work. Finally, in the documentation, I find fitpolicy=thin option in the xaxis statement and get the result I want. Back to your issue, I think you did not have any obs with values other than 0 8 10 of variable day in your dataset. Such as: data tmp;
input day organism;
cards;
0 1
8 1
10 1
;
run;
proc sgplot data=tmp noautolegend;
vbar day/response=organism nooutline stat=freq barwidth=0.3 transparency=0;
xaxis label="Study Day";
yaxis values=(0 to 8 by 1);
title1 "VE303 Detection panel-Stacked bar charts";
run; Which generates plot like this: Thus you might create additional obs with values 1 to 7, and 9 (those you want to display on the x axis) of variable day with missing values of organism. data tmp;
input day organism;
cards;
0 1
8 1
10 1
1 .
2 .
3 .
4 .
5 .
6 .
7 .
9 .
;
run; Then, rerun the same code, and you will get the result you want as follows 🙂
... View more