BookmarkSubscribeRSS Feed
Abud
Calcite | Level 5

Hi, everbody!

I'm using the proc sgplot and trying to control de width of the label (as you can see in the image).

How can I change the width of the xaxis ?

Doubt.png

My code:

graphics on / height=3in width=10.5in noborder;

proc sgplot data=tmpgrafico;

vbar Teste /   response=Volume legendlabel="Volume" barwidth=0.7;

vbar Teste / response=Volume_Dt legendlabel="Volume_Dt" barwidth=0.4;

yaxis label='Volume';

run;

tk's in advantage....

5 REPLIES 5
PGStats
Opal | Level 21

Add

XAXIS FITPOLICY=THIN; 

I think it's a v9.3 feature...

PG

PG
ballardw
Super User

FITPOLICY is in 9.2.3 as well. Other options you might try are STAGGER, STAGGERROTATE, STAGGERTHIN, ROTATETHIN

The format associated with the X axis variable controls what is attempted to display. You might try adding Format teste ddmmyyn4. ;

which should have  fewer characters but shouldn't show year values so may be problematic for some uses.

martin623
Calcite | Level 5

Is there anyway to rotate to 90?


PGStats
Opal | Level 21

As far as I know (up to version 9.3 anyway) you cannot rotate to 90 degrees in SG graphics. You can however in SAS/GRAPH graphics, if you define an axis with the VALUE option and the ANGLE suboption. I find it very awkward to use.

What you might also try in SG graphics is to increase the image resolution with option IMAGE_DPI=300 on your ODS LISTING or ODS HTML statement. This has for side effect to decrease the size of all text strings on the graph. - PG

PG
Jay54
Meteorite | Level 14

Not sure what you mean by "Change the width of this label".  If you want to change the font size of the tick values, you can do that using valueattrs.  Vertical tick values are supported at SAS 9.4 in GTL (see example below).  In your case, with so many tick values, you could try two other possibilities. 

  - Use a horizontal bar chart, so the date values are on the Y axis.

  - If this is really a time axis, use a time axis with needle plots.

heart1.png

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 2749 views
  • 6 likes
  • 5 in conversation