BookmarkSubscribeRSS Feed
roshni04
Calcite | Level 5

Hi, 

 Using gplot for the below graph 

1) I want to add the value of reference value on Y-axis which is Y= 0.05. I am unable to find a way to do so. 

 

2) on the X axis I want to display only a few tickers values(50, 60, 90, 100, 120, 150, 200).  I am using the program below, but it is not working. The log does not give any error. 

 

graph.PNG

 

goptions reset=all ;

axis1 order = (0 to 1 by 0.25) offset = (3,0) label = (a=90 'Power') minor=none value=(h=0.7 t=0.05);

axis2 order=(50 to 210 by 10 )
major= none minor = none
label =(h= 1.0 'Sample size')
value= (h=0.7 t=50 '' t=60 '' t=90 '' t=100 '' t=120 '' t=150 '' t=200);

 

symbol1 i = join c = black l=1 value=dot;
symbol2 i = join c = red l=2 value=star ;
symbol3 i = join c = blue l=7 value=square;
symbol4 i = join c = vilg l=4 value=special;
symbol5 i = join c = purple l=5 value=special;

ods graphics on;

proc gplot data = longfintest;
*by prev ppv0;
plot power*n=test/ VAXIS=axis1 haxis=axis2 ;
run;
quit;

ods graphics off; 

 

Desired Axis is as below Axis.jpeg

 

 

3 REPLIES 3
PaigeMiller
Diamond | Level 26

@roshni04 wrote:

 

 Using gplot for the below graph 

1) I want to add the value of reference value on Y-axis which is Y= 0.05. I am unable to find a way to do so. 


How about the VREF= option of the PLOT statement?

 

2) on the X axis I want to display only a few tickers values(50, 60, 90, 100, 120, 150, 200).

 

HAXIS= option

 

I also want to label 50 as (20,30).

 

I don't understand this.

 

I am using the program below, but it is not working.

 

For your future benefit, but also for this thread, please do not say "it is not working" and then provide no other information. We can't help you. We need to know what part is not working, we need explanation, we need information.

--
Paige Miller
roshni04
Calcite | Level 5
Vref option gives a reference line. I want to delete the line and instead
of a line add a value on Y Axis Y=0.05.

How do I use haxis option?
PaigeMiller
Diamond | Level 26

Answer to both: You can use HAXIS or VAXIS as appropriate. It specifically says in the documentation

"For numeric variables, value-list is either an explicit list of values..."

 

Example

yaxis order=(0.05 0.25 0.5 0.75 1);

 

--
Paige Miller

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
  • 3 replies
  • 399 views
  • 1 like
  • 2 in conversation