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

I'm using GTL and SAS v 9.4. Is there a way to vary the lengths of the y-axis in my template (top & bottom graphs using layout lattice/rows=2) so that the lengths of the y-axis (percentage) will be of varying lengths, with the maximum being a certain value, say, 10% above the maximum percentage value in the data? I.e., a "floating" y-axis length for each graph. Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

If you have a LATTICE layout, you can set the ROWWEIGHTS (or COLUMNWEIGHTS) option to make the ROWS (or COLUMNS) of the height you want based on the proportion between the two Y axes.  If you want this to be dynamically controlled, you could use ROWWEIGHTS=dynamic, where the dynamic is the the text string providing the values, such as "0.6 0.4" not including the quotes or the parentheses.  Then, you can generate this dynamic string based on the use case. 

 

The actual axis length is always computed based on the size of the cell.  There is no way to specify an axis length in GTL.  If you want, you can keep the cells constant size and set a PAD value to provide more white space above the y-axis.

View solution in original post

4 REPLIES 4
ballardw
Super User

I won't say "no" but since GTL has to live with other things like ODS GRAPHICS that can set the entire available graphics space then trying to set a fixed length inside GTL is likely to have bad interactions when someone changes display area size.

 

You could make the axis statement flexible by using a parameter that sets the max value of the axis if you calculate it before the SGRENDER that calls the template.

 

Generic answer to generic question. If you show your code for the template you may get better suggestions. Best would include some example data in the form of a data step to allow testing code. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

wcw
Calcite | Level 5 wcw
Calcite | Level 5

thank you ballardw

Jay54
Meteorite | Level 14

If you have a LATTICE layout, you can set the ROWWEIGHTS (or COLUMNWEIGHTS) option to make the ROWS (or COLUMNS) of the height you want based on the proportion between the two Y axes.  If you want this to be dynamically controlled, you could use ROWWEIGHTS=dynamic, where the dynamic is the the text string providing the values, such as "0.6 0.4" not including the quotes or the parentheses.  Then, you can generate this dynamic string based on the use case. 

 

The actual axis length is always computed based on the size of the cell.  There is no way to specify an axis length in GTL.  If you want, you can keep the cells constant size and set a PAD value to provide more white space above the y-axis.

wcw
Calcite | Level 5 wcw
Calcite | Level 5

thank you Sanjay, this works very well for me

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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