Dear all,
Not sure why the last tick value 144 at xaxis is not shown in the output. I did specify this value in below:
linearopts=(viewmin=1 viewmax=145 tickvaluelist=(1 2 4 6 8 12 16 24 48 72 96 144))
Look forward for any help!
Jacky
proc template;
define statgraph meanover;
begingraph;
layout lattice / columns=1 rowweights=(0.8 0.2) rowgutter=1 /*columndatarange=unionall*/;
layout overlay / xaxisopts=(offsetmin=0.01 offsetmax=0.01 TICKVALUEATTRS=(SIZE=8) linearopts=(viewmin=1 viewmax=145 tickvaluelist=(1 2 4 6 8 12 16 24 48 72 96 144)));
scatterplot x = atptn y = mean
/ /*group = armcd*/ name = "treat"
yerrorlower = LCLM
yerrorupper = UCLM ;
/* markersize = 12px; */
seriesplot x = atptn y = mean;
/* / group = armcd; */
endlayout;
layout overlay / xaxisopts=(type=discrete TICKVALUEATTRS=(SIZE=10) discreteopts=(tickvaluelist=("1" "2" "4" "6" "8" "12" "16" "24" "48" "72" "96" "144"))
display=(tickvalues)) walldisplay=none;
blockplot x=atptc block=n /
class=trt01a
repeatedvalues=true
display=(values);
drawtext textattrs=(size=8) "Number of Subjects" / x=0 y=80 justify=left xspace=datavalue yspace=datapercent width=26;
drawtext textattrs=(size=8) "Timepoint (H)" / x=0 y=0 justify=left xspace=datavalue yspace=datapercent width=26;
endlayout;
endlayout;
endgraph;
end;
run;
specifies a policy for avoiding tick value collision on an axis. The effectiveness of a collision-avoidance policy depends on the number of tick values, their length, and the length of the axis. Which policies are valid depends on the axis on which this option is used. For the Y and Y2 axes, the following policies are valid:
displays consecutive integers along the axis instead of the actual tick values in order to represent those tick values. In most cases, this policy is implemented if the system estimates that a collision might occur. If no collision occurs, then the actual tick values are displayed on the axis in the normal manner.
Requirement | The EXTRACT policy must be used with an AXISLEGEND statement. For more information, see Extracting Discrete Axis Tick Values into a Legend in SAS Graph Template Language: User’s Guide. |
same as EXTRACT, except that the extraction is implemented regardless of whether collision occurs.
Requirement | The EXTRACTALWAYS policy must be used with an AXISLEGEND statement. For more information, see Extracting Discrete Axis Tick Values into a Legend in SAS Graph Template Language: User’s Guide. |
makes no attempt to avoid collisions between tick values. Tick values are display even when they collide.
splits the tick value at a split character, which is specified by the TICKVALUESPLITCHAR= option, only when necessary in order to make the value fit the available space. A split does not occur at a split character if a split is not needed at that location. If the value does not contain any of the specified split characters, then the value is not split. Values that are not split or that do not fit the available space even after splitting might overlap the adjoining space.
See | TICKVALUESPLITCHAR= |
always splits the axis tick value at every occurrence of a split character that is specified by the TICKVALUESPLITCHAR= option.
See | TICKVALUESPLITCHAR= |
same as SPLITALWAYS, except that thinning is performed when long words do not fit the available space.
same as SPLIT, except that thinning is performed when long words do not fit the available space.
eliminates alternate tick values.
display consecutive integers along the axis instead of the actual tick values to represent those tick values. In most cases, this policy is implemented if the system estimates that a collision might occur. If no collision occurs, then the actual tick values are displayed on the axis in the normal manner.
Requirement | The EXTRACT policy must be used with an AXISLEGEND statement. For more information, see Extracting Discrete Axis Tick Values into a Legend in SAS Graph Template Language: User’s Guide. |
same as EXTRACT, except that the extraction is implemented regardless of whether collision occurs.
Requirement | The EXTRACTALWAYS policy must be used with an AXISLEGEND statement. For more information, see Extracting Discrete Axis Tick Values into a Legend in SAS Graph Template Language: User’s Guide. |
does not attempt to fit tick values that collide.
rotates the tick values if a collision occurs. The TICKVALUEROTATION= option specifies whether the values are rotated to a 45-degree diagonal or a 90-degree vertical position. By default, the values are rotated to a 45-degree diagonal position.
rotates the tick values regardless of whether a collision occurs. The TICKVALUEROTATION= option specifies whether the values are rotated to a 45-degree diagonal or a 90-degree vertical position. By default, the values are rotated to a 45-degree diagonal position.
attempts the ROTATEALWAYS policy, and then drops the tick values if collisions still occur.
attempts the ROTATE policy, and then the THIN policy.
splits the tick value at a split character, which is specified by the TICKVALUESPLITCHAR= option, only when necessary in order to make the value fit the available space. A split does not occur at a split character if a split is not needed at that location. If the value does not contain any of the specified split characters, then the value is not split. Values that are not split or that do not fit the available space even after splitting might overlap the adjoining space.
See | TICKVALUESPLITCHAR= |
always splits the axis tick value at every occurrence of a split character that is specified by the TICKVALUESPLITCHAR= option.
See | TICKVALUESPLITCHAR= |
attempts the SPLIT policy, and then the ROTATE policy.
always displays the tick values vertically as stacked letters.
always displays the tick values vertically as stacked letters. Thinning is performed when the tick values do not fit the available space.
alternates the tick values between two rows.
attempts the STAGGER policy, and then the ROTATE policy.
attempts the STAGGER policy, and then the THIN policy.
attempts the STAGGER policy, and then the TRUNCATE policy.
eliminates alternate tick values.
shortens the tick values when they exceed a certain number of characters.
attempts the TRUNCATE policy, and then the ROTATE policy.
attempts the TRUNCATE policy, and then the STAGGER policy.
attempts the TRUNCATE policy, and then the THIN policy.
Default | ROTATE for the X and X2 axes |
THIN for the Y and Y2 axes | |
Note | A note is written to the SAS log when tick value thinning occurs. |
specifies a policy for avoiding tick value collision on an axis. The effectiveness of a collision-avoidance policy depends on the number of tick values, their length, and the length of the axis. Which policies are valid depends on the axis on which this option is used. For the Y and Y2 axes, the following policies are valid:
displays consecutive integers along the axis instead of the actual tick values in order to represent those tick values. In most cases, this policy is implemented if the system estimates that a collision might occur. If no collision occurs, then the actual tick values are displayed on the axis in the normal manner.
Requirement | The EXTRACT policy must be used with an AXISLEGEND statement. For more information, see Extracting Discrete Axis Tick Values into a Legend in SAS Graph Template Language: User’s Guide. |
same as EXTRACT, except that the extraction is implemented regardless of whether collision occurs.
Requirement | The EXTRACTALWAYS policy must be used with an AXISLEGEND statement. For more information, see Extracting Discrete Axis Tick Values into a Legend in SAS Graph Template Language: User’s Guide. |
makes no attempt to avoid collisions between tick values. Tick values are display even when they collide.
splits the tick value at a split character, which is specified by the TICKVALUESPLITCHAR= option, only when necessary in order to make the value fit the available space. A split does not occur at a split character if a split is not needed at that location. If the value does not contain any of the specified split characters, then the value is not split. Values that are not split or that do not fit the available space even after splitting might overlap the adjoining space.
See | TICKVALUESPLITCHAR= |
always splits the axis tick value at every occurrence of a split character that is specified by the TICKVALUESPLITCHAR= option.
See | TICKVALUESPLITCHAR= |
same as SPLITALWAYS, except that thinning is performed when long words do not fit the available space.
same as SPLIT, except that thinning is performed when long words do not fit the available space.
eliminates alternate tick values.
display consecutive integers along the axis instead of the actual tick values to represent those tick values. In most cases, this policy is implemented if the system estimates that a collision might occur. If no collision occurs, then the actual tick values are displayed on the axis in the normal manner.
Requirement | The EXTRACT policy must be used with an AXISLEGEND statement. For more information, see Extracting Discrete Axis Tick Values into a Legend in SAS Graph Template Language: User’s Guide. |
same as EXTRACT, except that the extraction is implemented regardless of whether collision occurs.
Requirement | The EXTRACTALWAYS policy must be used with an AXISLEGEND statement. For more information, see Extracting Discrete Axis Tick Values into a Legend in SAS Graph Template Language: User’s Guide. |
does not attempt to fit tick values that collide.
rotates the tick values if a collision occurs. The TICKVALUEROTATION= option specifies whether the values are rotated to a 45-degree diagonal or a 90-degree vertical position. By default, the values are rotated to a 45-degree diagonal position.
rotates the tick values regardless of whether a collision occurs. The TICKVALUEROTATION= option specifies whether the values are rotated to a 45-degree diagonal or a 90-degree vertical position. By default, the values are rotated to a 45-degree diagonal position.
attempts the ROTATEALWAYS policy, and then drops the tick values if collisions still occur.
attempts the ROTATE policy, and then the THIN policy.
splits the tick value at a split character, which is specified by the TICKVALUESPLITCHAR= option, only when necessary in order to make the value fit the available space. A split does not occur at a split character if a split is not needed at that location. If the value does not contain any of the specified split characters, then the value is not split. Values that are not split or that do not fit the available space even after splitting might overlap the adjoining space.
See | TICKVALUESPLITCHAR= |
always splits the axis tick value at every occurrence of a split character that is specified by the TICKVALUESPLITCHAR= option.
See | TICKVALUESPLITCHAR= |
attempts the SPLIT policy, and then the ROTATE policy.
always displays the tick values vertically as stacked letters.
always displays the tick values vertically as stacked letters. Thinning is performed when the tick values do not fit the available space.
alternates the tick values between two rows.
attempts the STAGGER policy, and then the ROTATE policy.
attempts the STAGGER policy, and then the THIN policy.
attempts the STAGGER policy, and then the TRUNCATE policy.
eliminates alternate tick values.
shortens the tick values when they exceed a certain number of characters.
attempts the TRUNCATE policy, and then the ROTATE policy.
attempts the TRUNCATE policy, and then the STAGGER policy.
attempts the TRUNCATE policy, and then the THIN policy.
Default | ROTATE for the X and X2 axes |
THIN for the Y and Y2 axes | |
Note | A note is written to the SAS log when tick value thinning occurs. |
Hello Warren,
Does TICKVALUEFITPOLICY option fit for SAS EG 5.1(equivalent SAS BASE 9.3)?
I add this option and returning error in log..
Thanks,
Jacky
It is a GTL option. It is in 9.3. Google: tickvaluefitpolicy 9.3
to see what options are supported in that release.
Much apprecated! I tried STAGGERTHIN and 144 is shown. I am still wondering why it's not shown if I do not specify this option, since there is enough space to show the last tick...
And in another similar outputs, I have 1 more tick at 0, and in that output I don't specify the TICKVALUEFITPOLICY option and 144 is shown...
Glad it helped! Since you did not provide full code, I can't play with it. It might be because 144 is so close to your viewmax=145.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.