Data visualization with SAS programming

Is there a way to shift the position of an axis label within PROC TEMPLATE?

Reply
SAS Employee
Posts: 6

Is there a way to shift the position of an axis label within PROC TEMPLATE?

Hello, SAS GRAPH community,

I have a customer who has created customized graphic output using PROC TEMPLATE, where he has produced a chart of mean, median, quartiles above a box plot. He would like to move the position of his x-axis label from the default centered positon to in front of and in line with the x-axis. Is there a way to do that within PROC TEMPLATE, other than removing the axis label and using an ENTRY statement to manually create the label?

Secondarily, he is trying to line up the data columns in the table with their individual box plots in the graph. THe columnweights statement seems to work for the middle two columns, but there appears to be a buffer at the beginning and end of the table that skews the first and last columns. We have tried many different values for the columnweights, with the first and last columns largely remaining in the same skewed position. Is there a way to align these columns?

The template and greplay code are below.

Thanks!

--Matt

proc template;

  define statgraph boxplotparma;

     begingraph;

        entrytitle "Levels";

     layout lattice/rowweights=(.04 .04 .04 .04 .84)

                     columnweights=(.10 .50 .10 .30);

        blockplot x=x block=q1 /

         display=(values label) valuehalign=left       
 
labelattrs=graphdatatext(size=12pt family='helvetica')

          valueattrs=graphdatatext(size=12pt family='arial');

        blockplot x=x block=mean /

         display=(values label) valuehalign=left
     
labelattrs=graphdatatext(size=12pt family='helvetica')

          valueattrs=graphdatatext(size=12pt family='arial');

        blockplot x=x block=median /

         display=(values label) valuehalign=center

         labelattrs=graphdatatext (size=12pt family='helvetica')

         valueattrs=graphdatatext (size=12pt family='arial');

          blockplot x=x block=q3 /

         display=(values label) valuehalign=center

         labelattrs=graphdatatext (size=12pt family='helvetica')

         valueattrs=graphdatatext (size=12pt family='arial');

         boxplotparm y=value x=x stat=stat/

        meanattrs=(color=green size=8px symbol=DiamondFilled weight=bold)

       orient=vertical;

       endlayout;

     endgraph;

  end;

run;

proc sgrender data=work.all3 template=boxplotparma;

run;

Post a Question
Discussion Stats
  • 0 replies
  • 148 views
  • 0 likes
  • 1 in conversation