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