Help using Base SAS procedures

VREF and HREF

Reply
Occasional Contributor
Posts: 16

VREF and HREF

I am trying to draw a square with coordinates (-1,-1), (1,-1), (-1,-1) and (1,1). I thought i can use VREF = -1 1 and HREF= -1 1. But these give me extra lines that I do not need. Basically, i will like to know how to draw a horizontal line passing through Y=1, beggining at X=-1 and ending at X=1. Or how can I draw a verical line passing through X=1, beggining at Y=-1 and ending at Y=1.
Respected Advisor
Posts: 3,799

Re: VREF and HREF

Posted in reply to Statsconsultancy
[pre]
data a;
infile cards dsd;
input x y;
cards;
-1,-1
-1,1
1,1
1,-1
-1,-1
;;;;
run;
goptions reset=all;
goptions hsize=6in vsize=6in;
symbol i=join c=red w=2;
proc gplot;
plot y*x;* / noaxis noframe;
run;
quit;
[/pre]
PROC Star
Posts: 1,760

Re: VREF and HREF

Posted in reply to data_null__
Or if you need to plot a square on top of existing data:



data ANNO;
retain XSYS YSYS '2' COLOR 'red';
FUNCTION='move'; X=12; Y=12; output;
FUNCTION='draw'; X=11; Y=12; output;
FUNCTION='draw'; X=11; Y=11; output;
FUNCTION='draw'; X=12; Y=11; output;
FUNCTION='draw'; X=12; Y=12; output;
run;
proc gplot data=SASHELP.CLASS annotate=ANNO;
plot AGE*AGE;* / noaxis noframe;
run;
quit;
Ask a Question
Discussion stats
  • 2 replies
  • 355 views
  • 0 likes
  • 3 in conversation