Data visualization with SAS programming

Add ticks to y2axis

Reply
Occasional Contributor
Posts: 10

Add ticks to y2axis

I am using sgplot to build vertical boxplots and would like to add ticks without labels to the y2axis where the yaxis has labels. when i add y2axis the yaxis goes away. how can i do this?

 

proc sgplot data=data;
    vbox out / group=cat;
       INSET 'p-value <0.001' / POSITION=TOPLEFT BORDER;
run;

Grand Advisor
Posts: 9,713

Re: Add ticks to y2axis

Did you try having a Yaxis statement and a Y2axis statement?

 

It sounds like you might want a Display=Novalues on a Y2axis statement.

Occasional Contributor
Posts: 10

Re: Add ticks to y2axis

I am not getting any error messages but i dont see anything on the y2axis

SAS Super FREQ
Posts: 620

Re: Add ticks to y2axis

Hi

 

To get something on the Y2 axis, you need a plot statement that uses this axis. The example below uses two VBOX, the second is completely transparent and so not visiable.

 

proc sgplot data=sashelp.cars;
  vbox invoice / group=origin name="vb1" ;
  vbox invoice / group=origin name="vb2" transparency=1 y2axis;
run;
SAS Super FREQ
Posts: 864

Re: Add ticks to y2axis

[ Edited ]

On the YAXIS statement, use the REFTICKS option:

 

proc sgplot data=data;

    yaxis refticks=(values);
    vbox out / group=cat;
       INSET 'p-value <0.001' / POSITION=TOPLEFT BORDER;
run;

 

If you only want tick marks, just say REFTICKS without any arguments.

 

Hope this helps!

Dan

Post a Question
Discussion Stats
  • 4 replies
  • 74 views
  • 2 likes
  • 4 in conversation