BookmarkSubscribeRSS Feed
Melk
Lapis Lazuli | Level 10

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;

4 REPLIES 4
ballardw
Super User

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

 

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

Melk
Lapis Lazuli | Level 10

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

BrunoMueller
SAS Super FREQ

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;
DanH_sas
SAS Super FREQ

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 1222 views
  • 2 likes
  • 4 in conversation