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
Update. Actually, Fig 8 in the paper is closer to what you want.
Well, you can put outputs out to multiple regions using ods region:
Not sure how this ties into your code, I would suggest you move to sgplot or GTL though, more flexibility.
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.
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.
Thank you Sanjay_SAS for the tip. I am going to try sgplot for this right now.
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
Thank you. I will check this paper out.
Update. Actually, Fig 8 in the paper is closer to what you want.
Thanks. That is the one I am looking at right now.
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!
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.)
Thanks RW9. Wow! Yes, this looks like it has a lot of really useful information.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.