I love the heatmapparm statement in sgplot for discrete heatmaps. But now I have a difficult challenge in that my one variable (for the x axis) has about 250 values. I can produce the output I want using:
proc sgplot data=a;
styleattrs datacolors=(Blue VeryLightBlue white moderategreen VeryLightRed Red);
heatmapparm x=response y=factor colorgroup=grouph / discretey discretex;
run;
However, as you can see in the attached pdf, all 250 values of x are displayed, making the presentation worthless. I need to suppress the display of the labels and values for the x axis, but I can't find any options for this. The xaxis statement (which I would normally use to control the axis) does not work in combination with heatmapparm. Even inserting
xaxis;
with no options produces the message
WARNING: HEATMAPPARM statement has a conflict with the axis type. The plot will not be drawn.
and an empty graph is produced. The actual heatmap I am producing is exactly what I want, except I don't want the axis values or label. Alternatively, it would be fine if I could plot every 10th (or so) value of x (with thinning). I am using 9.4(TS1M3).
You didn't show any of your attempts at the XAXIS statement.
Try:
xaxis display=none type=discrete;
You have to tell the axis statement it is discrete so that there is not conflict with the heatparm option of discretex.
When you don't specify the type on the XAXIS then the generic rules are invoked, which means "treat like continuous and if the number of values are small show them all or group".
You didn't show any of your attempts at the XAXIS statement.
Try:
xaxis display=none type=discrete;
You have to tell the axis statement it is discrete so that there is not conflict with the heatparm option of discretex.
When you don't specify the type on the XAXIS then the generic rules are invoked, which means "treat like continuous and if the number of values are small show them all or group".
THANKS. For some reason I didn't try type=discrete. Worked perfectly.
And I hit my reply as the solution instead of yours. Working too quickly. Sorry.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.