Data visualization with SAS programming

Datapanel CellWidthMin but without the MIN.

Reply
Respected Advisor
Posts: 3,775

Datapanel CellWidthMin but without the MIN.

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.

SAS Super FREQ
Posts: 1,081

Re: Datapanel CellWidthMin but without the MIN.

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.

Respected Advisor
Posts: 3,775

Re: Datapanel CellWidthMin but without the MIN.

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. Smiley Happy

SAS Super FREQ
Posts: 1,081

Re: Datapanel CellWidthMin but without the MIN.

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.

Respected Advisor
Posts: 3,775

Re: Datapanel CellWidthMin but without the MIN.

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.

Ask a Question
Discussion stats
  • 4 replies
  • 425 views
  • 0 likes
  • 2 in conversation