BookmarkSubscribeRSS Feed
Calcite | Level 5

I would like to create a graphic in which a histogram that shows the frequencies for one variable (Ability in the data example, Have) shares an axis with a scatterplot of two other variables (X = Item and Y = Difficulty in the data example). That is, the values of Ability and Difficulty would all reference a common axis as shown in the Want figure below. Ideally, the scatterplot points would be labeled with another variable (Label in the data example). Any idea whether and, if so, how this can be done in SAS?






Super User
Yes, it can definitely be done. GTL is likely what you'd need though. I would probably create each graph type separate first and then combine them.

If you use SGPLOT to create each graph individually and then use the TMPLOUT option you'll get the GTL code.
Then you have to figure out how to set up the layout of them.

I highly recommend searching on for GTL papers for examples.

FYI - If you post images we'd have to type out your data to work with it since we cannot copy/paste.
Super User

You might look at the code here:

This shows a scatter plot with histograms of both the x and y variable. So removing the x variable bits for the histogram may do what you are looking for.


Warning: it does not show the count for the histogram bar lengths.



Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.


Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 


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
  • 4 replies
  • 4 in conversation