BookmarkSubscribeRSS Feed
JonathanNitzan
Calcite | Level 5

Hi,

 

I’m trying to have GTL create an axis with BOTH major and minor tick marks shown INSIDE rather than outside the cell. This is the code I use to do so for the X-axis:

 

...
layout overlay/
xaxisopts=(offsetmin=0 offsetmax=0 display=(line ticks tickvalues) tickvalueattrs=(family='Arial' size=10px) tickstyle=inside
linearopts=(minorticks=true minortickcount=4 viewmin=1920 viewmax=2040 tickvaluesequence=(start=1920 end=2040 increment=10)))
...

 

According to the GTL Reference manual, the option <tickstyle=inside> should apply for both major and minor ticks. In practice, though, it applies only to the major ticks. The net result is that the major tick marks show inside the cell while the minor tick marks show outside the cell, as you can see here:

 

axis.jpg

 

I asked SAS for assistance and was informed that this is a bug in the program, and that this bug will be fixed only in a future release. It was also suggested that I use DRAWLINE to create the axis as I want it to show.

 

I’m not that good a programmer, so I wonder if anyone can think of a clever little loop to do so.

 

Much obliged,

Jonathan

5 REPLIES 5
GraphGuy
Meteorite | Level 14

I'm not sure about GTL, but here's one way to do it using annotated minor tick marks on a SGplot:

 

data anno_ticks;
function='line'; linepattern='solid'; linecolor='cx989ea1'; linethickness=1;
layer='front';
x1space='datavalue'; y1space='wallpercent';
x2space='datavalue'; y2space='wallpercent';
do x1 = 50 to 150 by 2;
  x2=x1;
  y1=0.3; output;
  y2=1.0; output;
  end;
run;

 

title "Sgplot, with annotated minor tick marks inside";
proc sgplot data=sashelp.class sganno=anno_ticks;
scatter x=weight y=height;
xaxis values=(50 to 150 by 10) tickstyle=inside offsetmin=0 offsetmax=0;
yaxis values=(50 to 75 by 5) offsetmin=0 offsetmax=0;
run;

 

inside_minor.png

JonathanNitzan
Calcite | Level 5
Thank you very much! I'll check it out.
DanH_sas
SAS Super FREQ

Use the TICKSTYLE option on the axis statements in SGPLOT.

DanH_sas
SAS Super FREQ

As a follow-up to my previous post, the TICKSTYLE option affects only the MAJOR tick marks. The solution proposed by @GraphGuy is probably the best option.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2609 views
  • 1 like
  • 3 in conversation