BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KelseyB
Fluorite | Level 6

Hello,

I would like to insert a graphic to the right of a graph I have created. (The graph was created using proc gchart).  I have created three lines using the annotate data set and would like to insert a graphic that gives an explanation as to what these lines are - like a legend of sorts.  I have tried just inserting text above the lines where the annotate date set, but that doesn't work in this case.  (It does the job. I just don't like the way it looks on the graph.)  

 

I know I could add an image below the graph, but for space purposes I would prefer it to the right.

 

Is this possible in SAS?  If so, can someone direct me to a resource that has information related to this?  I have searched online but can't find information related to this.  

 

Thanks,

KelseyB

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

Update.  Actually, Fig 8 in the paper is closer to what you want.

View solution in original post

11 REPLIES 11
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, you can put outputs out to multiple regions using ods region:

http://support.sas.com/documentation/cdl/en/odsug/67921/HTML/default/viewer.htm#p0g1r9d5mqtuezn1g3sv...

 

Not sure how this ties into your code, I would suggest you move to sgplot or GTL though, more flexibility.

KelseyB
Fluorite | Level 6

Thanks RW9.  I am not sure how ods region would work since I want one column at the top of the page and essentially two columns at the bottom - one with the graph, the other with the image next to it.  I am also going to look at sgplot though.  You mentioned GTL. I am not sure how to use that for this.

Jay54
Meteorite | Level 14

Using SGPLOT, you can reserve some space to the right of the graph (PAD=(RIGHT=10pct)), and then add the image in that location using SGANNO functioni.  Note, this works similar to Annotate, with Functions, etc, but has different syntax due to its need to work with SGPLOT.

KelseyB
Fluorite | Level 6

Thank you Sanjay_SAS for the tip.  I am going to try sgplot for this right now.

Jay54
Meteorite | Level 14

This paper explains how to add SGANNO annotations to a SGPLOT graph.  Images are included in the data in Fig 11.  It should be straight forward to place images on the right of the graph.

http://support.sas.com/rnd/datavisualization/papers/sgf2011/277-2011.pdf

 

KelseyB
Fluorite | Level 6

Thank you.  I will check this paper out.  

Jay54
Meteorite | Level 14

Update.  Actually, Fig 8 in the paper is closer to what you want.

KelseyB
Fluorite | Level 6

Thanks.  That is the one I am looking at right now.

KelseyB
Fluorite | Level 6

I am going to mark this as a solution.  I am still playing around to get things to fit, but I feel confident that I am on the right track. Thanks again!

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, I see Sanjay has jumped in and given you a solution which is great.  I would just add, as he is too modest, that his excellent blog will give you all the information you need to use sgplot and GTL (Graph Template Language) which is the underlying graph proc template language which is used to generate graphs.

http://blogs.sas.com/content/graphicallyspeaking/

(although in this instance, it was a different solution, its still a good idea to look into.)

KelseyB
Fluorite | Level 6

Thanks RW9.  Wow!  Yes, this looks like it has a lot of really useful information.  

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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