Data visualization with SAS programming

Vertical not horizontal

Reply
Contributor
Posts: 73

Vertical not horizontal

Hello all

Can anyone explain how to change vertical not horizontal?

Fri, Oct, 6
to
F
r
i
,
O
c
t
,
6


I'm losing all the dates on the graph, my data range was October 1, 16 but on the graph it only shows the first and last day of month.


proc gplot data = Total_callshandled_by_day template=BarTableHorz;
title 'Calls Handled throught Time';
plot calls_handled*date;
symbol v = triangle I = j ci=blue
w = 1 ;
label Date = ‘Date’;
run;
quit;

Fred

Message was edited by: fredbell Message was edited by: fredbell
SAS Super FREQ
Posts: 8,641

Re: Vertical not horizontal

Hi:
The AXIS statements allow the use of the ANGLE and ROTATE suboptions to alter how AXIS text and AXIS value text can be made to fit. That documentation is here:
http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#axischap.htm

Also, for numeric variables, SAS/GRAPH will calculate the intervals that it needs to show unless you provide other instructions (again, with an AXIS statement) or with other options (such as in your plot or action statement).

Are you also intending or attempting to REPLAY your GPLOT output??? Your use of TEMPLATE= is unusual and normally a specific template would be seen when using PROC GREPLAY -- which I do not see in your code. So I wonder whether your code has any messages in the log that are also causing issues.

cynthia
SAS Employee
Posts: 963

Re: Vertical not horizontal

Here's a specific example that might help...

-----

axis1 value=(height=8pt angle=90);

proc gplot data = Total_callshandled_by_day template=BarTableHorz;
title 'Calls Handled throught Time';
plot calls_handled*date / haxis=axis1;
symbol v = triangle I = j ci=blue
w = 1 ;
label Date = ‘Date’;
run;
quit;

-----

SAS/Graph tries to make the text values on the axes "fit", but you can control the angle of the text (or rotate of the characters) manually ... and if you make it fit, then gplot won't have to. And you can generally make better judgement calls as to what "looks better". Sometimes you also have to make the text smaller to get it to fit.

One caveat - sometimes, graph will do both what you tell it, and also apply it's fitting algorithm (if it 'thinks' the text values won't fit) and you'll end up with upside-down stacked letters. That is fixed in v9.3 (internal tracking number S0176883), but in v9.2 you might have to make the text smaller, so that gplot knows it will fit comfortably, and not have it's automatic fitting-algorithm kick in.

Another caveat - some of the axis text rotate/angle stuff might only have "partial support" in dev=activex and dev=java (which are the defaults if you're using EG or Stored Processes). I would recommend device=png.

-----

Message was edited by: Robert Allison @ SAS Message was edited by: Robert Allison @ SAS
Contributor
Posts: 73

Re: Vertical not horizontal

Thanks so much Robert.

Fred Message was edited by: fredbell
Grand Advisor
Posts: 9,682

Re: Vertical not horizontal

Probably not needed as a response to the original post at this time but the FORMAT associated with the axis variable also would be a place to look to increase readability especially with dates. The example looks like a MMDDYY10. or MMDDYY8. would have fit and been readable. Depending on the number of values they may have then even appeared horizontally.
Post a Question
Discussion Stats
  • 4 replies
  • 150 views
  • 0 likes
  • 4 in conversation