Data visualization with SAS programming

SGPLOT - Change Angle of Rotation for XAXIS Values

Reply
Contributor
Posts: 30

SGPLOT - Change Angle of Rotation for XAXIS Values

Using SGPLOT, is there a way to change to rotation angle to a specified angle?  It appears that the default is 45 degrees.  I'm using a VBARPARM and a SERIES line on the chart.  I've looked into the documentation and maybe I'm just not seeing something.  I should think that should be easy?

 

Thanks!

SAS Super FREQ
Posts: 4,118

Re: SGPLOT - Change Angle of Rotation for XAXIS Values

Posted in reply to bendsteel6

XAXIS statement in SGPLOT provides rotation values of 0 degrees (horixontal), 90 degreees (vertical), and +/-45 degrees (diagonal or 'diagonal2').

 

The annotation facility allows arbitrary rotation of text, but might be more effort than you want to deal with.

Esteemed Advisor
Posts: 5,399

Re: SGPLOT - Change Angle of Rotation for XAXIS Values

Posted in reply to bendsteel6

Try playing with FITPOLICY= option and labelattrs=(size=n)

PG
Contributor
Posts: 30

Re: SGPLOT - Change Angle of Rotation for XAXIS Values

Thanks for your response. 

The reason I'm wanting this is because my xaxis labels are quite long, and when they are angled 45 degrees, it makes the whole graph look like it's shifted to the left.  Yes, I could mess with the fitpolicy and the fonts size with LABELATTRS but that still doesn't accomplish what I'm looking for.  I thought there'd be a way to change the angle, but I guess not.

 

Appreciate it!

Thanks

SAS Super FREQ
Posts: 1,265

Re: SGPLOT - Change Angle of Rotation for XAXIS Values

Posted in reply to bendsteel6

I assume you mean the x-axis tick values.  If your tick values are very long, it is often better to use a HBAR, or place the category variable on the y-axis, and response on the x-axis.  Please see last graph in this article.

Contributor
Posts: 30

Re: SGPLOT - Change Angle of Rotation for XAXIS Values

Posted in reply to Sanjay_SAS

Hi, thanks.  That's certainly an idea.  (And yes, I did mean x tick mark values Smiley Happy)  My only drawback to that is that this a combination of a bar chart and a series plot.  Maybe I can work something out on that.

 

Thanks for the idea!

SAS Super FREQ
Posts: 1,265

Re: SGPLOT - Change Angle of Rotation for XAXIS Values

[ Edited ]
Posted in reply to bendsteel6

If you attach an image of your graph, better suggestions could be made.  These often depend on the number of categories, and other details.  Providing a working program with sample data is even better.

Contributor
Posts: 30

Re: SGPLOT - Change Angle of Rotation for XAXIS Values

Posted in reply to Sanjay_SAS

Hi,

Unfortunately it has company sensitive data in it and changing this data for the graph would take longer than it may be worth.  I'll just go with it for now.  There have been some good suggestions.

 

Thanks Smiley Happy

Ask a Question
Discussion stats
  • 7 replies
  • 233 views
  • 0 likes
  • 4 in conversation