BookmarkSubscribeRSS Feed
WJJK
Calcite | Level 5

I know how to make a polygon in an annotation data set (with sgpolygon and sgpolycont). I know how to set the line color, the line pattern, the fill color, but is there a way to fill the polygon with a pattern?

3 REPLIES 3
Ksharp
Super User

@GraphGuy  might give you an answer .

RichardDeVen
Barite | Level 11

Can you show some code ?
Are you creating raw annotate data (DIY) or using %SG*** macros ?

At present there is no built-in way to render a polygonally clipped image or have a polygon FILLSTYLEELEMENT other than COLOR. You can suggest new feature s at the SASWare Ballot

  • annotate with an image that is polygon clipped, tiled, stretched or fit to target area
  • annotate with fill style elements such as pattern and hatch as was possible with DSGI
WJJK
Calcite | Level 5

Thank you for your reply. I plot a graph of observations on the y-axis and time on the x-axis in sgplot with the series statement. I then want to fill the area below the graph with a pattern. This could of course be done with a band statement, but I want to achieve a kind of zig-zag pattern; lines of the pattern go up from Time 1 to Time 2, down from Time 2 to Time3, up from Time 3 to Time. I didnt's see an easy way with the band statement, so I thouth to give it a try with annotating. I am programming the annotate data set from scratch (so not using the macros). Instead of a pattern, I now use alternating colors. This is the code:

 

function = "polygon";
x1 = Time1;
y1 = 0;
if mod(_N_, 2) = 0 then do;
   fillcolor = "cx3B5DAD";
end;
else do;
   fillcolor = "cx393547";
end;
filltransparency = 0.5;
display = "fill";
layer = "back";
x1space = "datavalue";
y1space = "datavalue";
output;

function = "polycont";
x1 = Time2;
y1 = 0;
output;

function = "polycont";
x1 = Time2;
y1 = Obs2;
output;

if _N_ > 1 then do;
function = "polycont";
x1 = Time1;
y1 = Obs1;
output;
end;

 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 290 views
  • 0 likes
  • 3 in conversation