BookmarkSubscribeRSS Feed
bendsteel6
Obsidian | Level 7

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!

7 REPLIES 7
Rick_SAS
SAS Super FREQ

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.

PGStats
Opal | Level 21

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

PG
bendsteel6
Obsidian | Level 7

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

Jay54
Meteorite | Level 14

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.

bendsteel6
Obsidian | Level 7

Hi, thanks.  That's certainly an idea.  (And yes, I did mean x tick mark values :))  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!

Jay54
Meteorite | Level 14

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.

bendsteel6
Obsidian | Level 7

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 🙂

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 3870 views
  • 0 likes
  • 4 in conversation