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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2808 views
  • 0 likes
  • 3 in conversation