Thanks for the reply. I've been thinking about this more, and it occurred to me that what I was subconsciously hoping to find was an XAXIS option that effectively functioned the way the DATALABEL option does for plots -- meaning they adhere to the x-axis positions of the plotted variables, but only appear when a non-blank value appears. So I decided to try using a combination of a REFLINE and a SCATTER with datalabels for an axis, and here's what I came up with: I create variables in the positions where I want labels, where "XAXISVAL"=0 in places where I want axis labels, and a separate, and then use a REFLINE and a SCATTER with DATALABEL=PLUS for the tickmarks. Below is the SGPLOT code (full code is pasted below). *Set up variables for xaxis; data rawdata2; set rawdata1; by month; if first.month then do; xlab=put(date,date5.); *Label for the xaxis; xaxisval=0; *Tick marks set the y value to zero to appear on xaxis; pricelab=price; *To be used as DATALABEL for the plotted values; end; run; *Plot using different axis; proc sgplot data=rawdata2 noborder noautolegend; series x=date y=price; scatter x=date y=pricelab / datalabel=pricelab DATALABELPOS=top; xaxis display=none type=discrete; yaxis label="price"; *Use refline and series as xaxis; refline 0 / LINEATTRS=(color=black); scatter x=date y=xaxisval / datalabel=xlab DATALABELPOS=bottom MARKERATTRS=(SYMBOL=plus color=black); run; This code generates the following plot: This is very much a hack, so any suggestions are welcome. Since the functionality seems to be evolving, if we are talking about making potential modifications to the functionality of a discrete XAXIS in future releases, what I'm envisioning is something very simple along the lines of the following, which would assign the tickmarker placement and labels based on a variable in the dataset (in this case "xlab"), which functions similarly to the DATALABEL option for SCATTER plots. Tickers and labels would be placed at locations on the XAXIS for non-missing observations (I assume there would be other parameters which would give more flexibility, but this is the basic structure I'm envisioning): xaxis type=discrete discreteorder=data tickmarvar=xlab; *NOTE: Hypothetical code only -- does not work; (I also believe the TIME axis options described in the last paragraph of this post by @Jay54 would be very useful.) Thanks for reading! I've re-pasted the relevant code from above, with modifications to generate the plot above. *(1) Input raw data; data rawdata; informat date date10.; format date date9.; input Obs Date price; datalines; 1 22SEP2015 12.36 2 23SEP2015 12.24 3 24SEP2015 12.38 4 25SEP2015 12.24 5 28SEP2015 12.38 6 29SEP2015 11.99 7 30SEP2015 12.19 8 01OCT2015 12.31 9 02OCT2015 12.19 10 05OCT2015 12.2 11 06OCT2015 12.12 12 07OCT2015 12.22 13 08OCT2015 12.3 14 09OCT2015 12.69 15 12OCT2015 12.88 16 13OCT2015 12.76 17 14OCT2015 12.78 18 15OCT2015 12.79 19 16OCT2015 13.04 20 19OCT2015 12.94 21 20OCT2015 12.88 22 21OCT2015 13.16 23 22OCT2015 13.09 24 23OCT2015 13.3 25 26OCT2015 13.36 26 27OCT2015 13.24 27 28OCT2015 13.16 28 29OCT2015 13.17 29 30OCT2015 13.11 30 02NOV2015 12.95 31 03NOV2015 13.1 32 04NOV2015 13.12 33 05NOV2015 12.95 34 06NOV2015 13 35 09NOV2015 13.25 36 10NOV2015 12.87 37 11NOV2015 13 38 12NOV2015 13.04 39 13NOV2015 12.85 40 16NOV2015 12.74 41 17NOV2015 13.03 42 18NOV2015 13.17 43 19NOV2015 13.38 44 20NOV2015 13.41 45 23NOV2015 13.53 46 24NOV2015 13.53 47 25NOV2015 13.41 48 26NOV2015 13.5 49 27NOV2015 13.47 50 30NOV2015 13.39 51 01DEC2015 13.72 ; run; *(2) Create time intervals; data rawdata1; set rawdata; year=year(date); month=year*100+month(date); week=year*100+week(date); run; *(3) Get labels to display based on selected time interval; data rawdata2; set rawdata1; by month; if first.month then do; xlab=put(date,date5.); *Label for the xaxis; xaxisval=0; *Tick marks set the y value to zero to appear on xaxis; pricelab=price; *To be used as DATALABEL for the plotted values; end; run; *(4) Plot series and scatter, using a REFLINE and SERIES as the XAXIS; proc sgplot data=rawdata2 noborder noautolegend; series x=date y=price; scatter x=date y=pricelab / datalabel=pricelab DATALABELPOS=top; xaxis display=none type=discrete; yaxis label="price"; *Use refline and series as xaxis; refline 0 / LINEATTRS=(color=black); scatter x=date y=xaxisval / datalabel=xlab DATALABELPOS=bottom MARKERATTRS=(SYMBOL=plus color=black); run;
... View more