Help With PROC SGPLOT fonts

Reply
New Contributor
Posts: 3

Help With PROC SGPLOT fonts

While trying to create a scatter plot, I am oddly unable to change the x-axis font. Below is an example of the code that I am running:

data orig_dat;

     infile datalines delimiter = ',';

     length Measure $ 12 Yearid $11;

     input Measure $ Group $ Yearid $ Rate LCL UCL @@;

     datalines;

     Measure1,Group1,Jul08-Jun09,2345,1234,3456

     Measure1,Group2,Jul09-Jun10,3345,2234,4456

     Measure1,Group3,Jul10-Jun11,4345,3234,5456

     ;

run;


proc sgplot data=orig_dat;

Y=rate X=group / yerrorlower=lcl yerrorupper=ucl legendlabel=" " datalabel=rate datalabelattrs=( color=BLACK family='Calibri' size=8pt) markerattrs=(symbol=diamondfilled color=CX365F91) ERRORBARATTRS=(color = black) ;

refline 1000   2000  3000 4000 5000 6000 ;
yaxis label = ' ' grid values= ( 1000 to 6000 by 1000) valueattrs=( color=BLACK family='Calibri' size=8pt);

xaxis offsetmax=.2 offsetmin=.2 label=' ' valueattrs=( color=BLACK family='Calibri' size=8pt);
run;

This particular set of code does not give me any trouble, but as soon as I use my own data (which has a few more observations), the x-axis defaults to a very ugly font that I can't change the size of. Any tips for trouble shooting this issues would be greatly appreciated. I tried removing the offsetmax and offsetmin. I tried using a smaller length yearid (RY1,RY2,RY3 instead of date ranges), and there was more space, but the font still won't change to my designated Calibri 8pt.

Super User
Posts: 11,343

Re: Help With PROC SGPLOT fonts

I think you may need to repost your code as the type of chart isn't appearing which may indicate other items are missing also.

It would also help to post data that causes the problem.

New Contributor
Posts: 3

Re: Help With PROC SGPLOT fonts

I am unable to post the live data

Super User
Posts: 11,343

Re: Help With PROC SGPLOT fonts

Since the result is apparently data related then you need to go over it with a fine tooth comb. Make sure there are no "special" characters or Unicode text. Lengths and formats associated might be another place where issues arise.

Something else to try would be a different overall style.

New Contributor
Posts: 3

Re: Help With PROC SGPLOT fonts

Woops! I accidentally deleted the "Scatter"--valid proc sgplot is below

proc sgplot data=orig_dat;

Scatter Y=rate X=group / yerrorlower=lcl yerrorupper=ucl legendlabel=" " datalabel=rate datalabelattrs=( color=BLACK family='Calibri' size=8pt) markerattrs=(symbol=diamondfilled color=CX365F91) ERRORBARATTRS=(color = black) ;

refline 1000   2000  3000 4000 5000 6000 ;
yaxis label = ' ' grid values= ( 1000 to 6000 by 1000) valueattrs=( color=BLACK family='Calibri' size=8pt);

xaxis offsetmax=.2 offsetmin=.2 label=' ' valueattrs=( color=BLACK family='Calibri' size=8pt);
run;

Ask a Question
Discussion stats
  • 4 replies
  • 264 views
  • 0 likes
  • 2 in conversation