BookmarkSubscribeRSS Feed
data_null__
Jade | Level 19

So I decided to annotate my Y axis tick labels.  This drawtext statement works to place the text at the correct Y value and X=-10 is pretty close to where I want it on the left.

     drawtext 'this is it' / x=-10 xaxis=x2 y='10-001'  xspace=layoutpercent yspace=datavalue;

There's just one small problem the text is drawn in all columns (in my case 2) and I can't figure out how to only get it drawn in one column.

If I move the statement to outside the LAYOUT PROTOTYPE; block I cannot use YSPACE=DATAVALUE and I don't see how I can find the correct place to draw the text.

3 REPLIES 3
DanH_sas
SAS Super FREQ

What if you moved the draw text outside of the prototype and used "layoutpercent" for the Y as well?

data_null__
Jade | Level 19

DanH@sas wrote:

What if you moved the draw text outside of the prototype and used "layoutpercent" for the Y as well?

But how can I associated the text with the Y tick values when I change to percent.  I am trying to label the common Y similar to way the X is is annotated here.  44129 - Split axis values across multiple lines with the Graph Template Language (GTL)

I want multiple calls to produce uniform panels, this question. https://communities.sas.com/message/193891#193891

I've got part of that working using a fixed font for Y axis tick labels of all 'a0'x and then annotate the values I wan't using DRAWTEXT with proportional font.

Maybe I'm doing it all wrong and need to start over.Smiley Happy

Jay54
Meteorite | Level 14

Any statements in the PROTOTYPE of a LAYOUT DATAPANEL are always drawn in all the cells.  So, any DRAW statements will also draw in both cells.  This would be fine for the two X axes if they are UNION, and in both cases, a negative Y dimension will take you below each axis line.  For Y axis, the negative X dimension will take you to the left of both cells, which is ok for left cell, but not the right cell.  Example 44129 is for a single cell graph.

But, DATAPANEL creates equal size cells anyway, so I don't understand the issue.  Can you attach your graph output?

You could use a 1x2  LAYOUT LATTICE, and populate each cell yourself with the right plot statements with the subset of the data.  In GTL, you can use the IFN or IFC syntax to subset the data by a class variable.  Keeping Y axis for both cells, you can then use the DRAW statements in each LAYOUT OVERLAY to draw the split axis tick values.  You will have to do something to reserve the right amount of white space for DRAWing the custom tick values.

SAS 9.4 will do split tick values for you with just an option.  This was going to be the topic of my next blog.  🙂

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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