I using SAS 9.3 (TS1M2). I have a 1x2(RxC) cell data panel and I want to specify the CELLWIDTH. I want this so I can "compare" separate graphs. My Y axis tick labels are long and different lenght on different graphs so the size of the data cells will vary depending of the tick lables.
I don't have to stick with DATAPANEL but I would like to have control over the size of the cells that have a common Y axis.
Or maybe there is a way to specify the area for the tick labels. I'll check on that.
I am unable to visualize what you want. Can you attach a graph you have now, or one you want?
There is no way in SG or GTL to specify a cell sizes for a Data Panel. The width of the graph is allocated equally to all columns after accounting for the common Y axis space. With SAS 9.4, you can get PROPORTIONAL allocation based on the number of category values in each cell.
You could use LAYOUT LATTICE, with independent Y axes. In this case, you can specify cell widths as a proportion, you can also make the Y axis common.
I can't post my output. I have two separate calls to SGRENDER a 1x2 DATAPANEL. The Y tick labels are long and different length on each graph. The tick labels are causing the size of the datapanel cells on the graph with long labels to be be smaller than on the other graph. I want to make the cell size on the two graphs uniform.
I have been able to use a fixed font and pad the Y tick label values with 'a0'x and achieve a somewhat acceptable result. Then I came up with the DRAWTEXT idea but that did not produce acceptable results. But I think it will work if I switch to LAYOUT LATTICE, I'll work on it. Maybe this could be the subject of your next blog.
Two separate SGRENDER calls means the 1x2 layout is outside the graph, maybe using ODS Layout? So it seems each graph is still a single cell and not a DATAPANEL. DRAWTEXT should work in this case. You can guarantee the cell widths will be same by using same graph widths and turning off the Y axis for both graphs. Pad the graphs on the left to provide space for your custom axis values using pad=(left=10%). Now you can either annotate or DRAWTEXT the yaxis tick values into the padded space. If I understand this correctly, I think you can use either SGRENDER ore SGPLOT.
I did not explain my requirements well, I apologize for that. Suffice it to say that using LAYOUT LATTICE I was able to achieve everything I needed to generate a uniform multi-page figure.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.