Data visualization with SAS programming

creating heat map of correlation matrix

Accepted Solution Solved
Reply
Contributor
Posts: 32
Accepted Solution

creating heat map of correlation matrix

Dear all,

 

I am using Chris Hemedinger's code posted here:

http://blogs.sas.com/content/sasdummy/2013/06/12/correlations-matrix-heatmap-with-sas/

 

to get a heat map of my correlation matrix. The only problem is I have too many variables(>40) so the labels on the axis all overlap and aren't readable anymore.

 

I think there should be a fix - manipulating the X axis or Y axis display options --- but I'm a total novice with SAS graphics and am not sure what to do. The heat map itself is generated just fine, only the variable names are all lost. Maybe I should try truncating the varaible names? 

 

Thanks for any advice!


Accepted Solutions
Solution
‎04-18-2017 02:06 PM
Super User
Posts: 11,105

Re: creating heat map of correlation matrix


nstdt wrote:

 Chris Hemedinger kindly gave a solution to my question posted on his blog:

 

If you want the labels and values to be readable, you might just need to increase the dimensions of the graph:

ods graphics /height=1500px width=1500px imagemap tipmax=4000;

Adding the TIPMAX option allows the higher number of hover-over tips to be included as well.

 

This gives  better output, though I don't know how I would manage if I had more than 40 variables...

 

 


Shorter labels that key to a text table for reference perhaps. And sometimes the scope just needs to be reduced.

View solution in original post


All Replies
Super User
Posts: 11,105

Re: creating heat map of correlation matrix

Easiest may be to change the height and width options on the the ODS GRAPHICS statement ODS Graphics/ height=10in width=10in may get you close, second would be to reduce the font size of the axis label text and third I would look closely  at whether I needed all of the text currently displaying as an axis label. Shorter labels may help.

 

 

 

 

Contributor
Posts: 32

Re: creating heat map of correlation matrix

 Chris Hemedinger kindly gave a solution to my question posted on his blog:

 

If you want the labels and values to be readable, you might just need to increase the dimensions of the graph:

ods graphics /height=1500px width=1500px imagemap tipmax=4000;

Adding the TIPMAX option allows the higher number of hover-over tips to be included as well.

 

This gives  better output, though I don't know how I would manage if I had more than 40 variables...

 

I tried other options (some suggested below) such as setting tickvalueattrs--- within the xaxisopt code:xaxisopts=(display=(line ticks tickvalues tickvalueattrs=(size=4pt weight=bold)))--- to reset the font but these did not work.

 

 

Solution
‎04-18-2017 02:06 PM
Super User
Posts: 11,105

Re: creating heat map of correlation matrix


nstdt wrote:

 Chris Hemedinger kindly gave a solution to my question posted on his blog:

 

If you want the labels and values to be readable, you might just need to increase the dimensions of the graph:

ods graphics /height=1500px width=1500px imagemap tipmax=4000;

Adding the TIPMAX option allows the higher number of hover-over tips to be included as well.

 

This gives  better output, though I don't know how I would manage if I had more than 40 variables...

 

 


Shorter labels that key to a text table for reference perhaps. And sometimes the scope just needs to be reduced.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 225 views
  • 0 likes
  • 2 in conversation