02-08-2012 02:30 PM
I am a simple (probably silly) question on the sgplot outcome. The graph I try to generate is a figure with both bars and lines (similar to the charts used in stock markets, where lines are for prices but bars for volumes).I don't want the figure to be too busy, so I try to control the incremental value for horizontal axis by using the xaxis statement.
xaxis label="Trading Interval (Quarters)" values=(0 to 150 by 20) offsetmin=0 offsetmax=0;
I suppose numbers showing on the axaxis should be 0, 20, 40 ect. Howerver, the outcome is that the numbers are 1, 2, 3, ..., i.e, the incremental value is 1 rather than 20. There is no warning or error message from SAS. I am using SAS9.2 in a UNIX system. Is there something wrong?
02-08-2012 02:39 PM
The bar chart forces the xaxis to be discrete, so the VALUES option has no effect in that case. The best two options for you in this chart is to either set the TICKVALUEFITPOLICY=THIN on the XAXIS statement or use a NEEDLE plot and SERIES plot overlay instead of the VBAR/VLINE overlay. In the NEEDLE/SERIES case, the VALUES option will be honored because the axis is continuous by default.
Hope this helps!
02-08-2012 03:30 PM
Not currently, but can still work around that. Specify start and end values in the VALUES option that go beyond the typical limits of your data and specify the VALUESHINT option. The boolean option tells the proc to display tick values from the VALUES option only if they fall within the range of your data. All specified values outside of the data range are ignored. Be sure that the range specified by your start and end values are evenly divisible by your increment value for best results.