BookmarkSubscribeRSS Feed
Statsconsultancy
Fluorite | Level 6
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.
2 REPLIES 2
data_null__
Jade | Level 19
[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]
ChrisNZ
Tourmaline | Level 20
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;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2339 views
  • 0 likes
  • 3 in conversation