## Axis values rotation

Occasional Contributor
Posts: 10

# Axis values rotation

How to rotate tick mark values at an angle of 45 degrees from bottom of left to top of right in sg plot ? The graph is line graph.
Contributor
Posts: 38

## Re: Axis values rotation

The SGPlot xaxis fitpolicy=rotate option can be used to rotate the tick mark.

However this is when there is not enough room on the line

A typical syntax could be as follows

proc sgplot data=< your large data set>  ; xaxis  fitpolicy=rotate   ;
----
----
run;

The details are available herehttp://support.sas.com/documentation/cdl/en/grstatproc/69716/HTML/default/viewer.htm#p07m2vpyq75fgan14m6g5pphnwlr.htm

SAS Super FREQ
Posts: 4,111

SAS Super FREQ
Posts: 1,265

## Re: Axis values rotation

[ Edited ]

If you have SAS 9.40M3, you can rotate the ticks vertical by setting xaxis Fitpolicy=rotate and valuesrotate=vertical.

But, if diagonal tick values from botton left to top right are a must, the only way to do this now is using annotate.  Admittedly, annotation is not an easy topic, so I have attached some code using sashelp.heart that you can change for your own data.

I use proc MEANS to get all the category values, but you can use some other method.  Graph is attached at bottom.

/*--Find all categories--*/

proc means data=sashelp.heart noprint;
class deathcause;
output out=heart(where=(_type_ eq 1))
mean=mean;
run;

/*--Create annotation data set for all categories--*/

data anno;
set heart(keep=deathcause);
by deathcause;
if first.deathcause then do;
id='a'; function='text'; x1space='datavalue'; y1space='wallpercent'; label=deathcause;
xc1=deathcause; y1=-1; anchor='right'; width=50; rotate=45; output;
end;
run;

/*--Graph with regular axis--*/

proc sgplot data=sashelp.heart;
vbar deathcause;
run;

/*--Graph with custom diagonal axis--*/

vbar deathcause;
xaxis display=(novalues nolabel);
run;

Occasional Contributor
Posts: 10

## Re: Axis values rotation

Dear Sir, I have used the following procedure, but its not working. Can you please check it. Below is the attached graph.

* Plot with XAXIS and YAXIS;

proc template;

define style styles.LasVegas2;

parent = styles.default;

style GraphConfidence from GraphConfidence / color= CXE8D898;

style GraphLegendBackground / transparency=0;

style GraphValueText from GraphValueText / font=('Times New Roman', 9pt, Bold);

style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

style GraphBorderLines from GraphBorderLines / LineThickness=1;

*style GraphWalls from GraphWalls / color= CXC0C0C0;

style GraphBackground / transparency=1;

end;

run;

ODs graphics on;

HEIGHT = 4in WIDTH = 3in;

ODS html style=LasVegas2;

ODS LISTING GPATH = 'c:\MyGraphs';

PROC SGPLOT DATA = Tttt ;

Series X = year Y = Production/ markers markerattrs=(symbol=circlefilled);

;

series x=Year Y=Prediction/markers markerattrs=(symbol=circlefilled);

XAXIS LABEL = 'Year' values = (1979 TO 2026 BY 3) type=linear;

YAXIS LABEL = 'Production (tonne)' values = (200000 TO 600000 BY 100000);

TITLE 'Fig.1  total marine total fish production';

RUN;

Ods graphics off;

ods graphics / width=5in;

proc sgplot data=gg;

XAXIS LABEL = 'Year' values = (1979 TO 2016 BY 3) type=linear;

YAXIS LABEL = 'Production (tonne)' values = (200000 TO 600000 BY 100000);

hline production;

xaxis fitpolicy=rotate;

run;

ods graphics/reset=width;

ods noresults; ods listing close;

ods graphics on /reset=all border=off width=1500px height=600px

imagemap=on imagename='total marine fish production';

'sgplot_series_by year_1500pxby600px_intervalyear_fitpolicyequalrotate';

ods html path="d:\@wiilsu nov2012\results" (url=none)

body='sgplot_series_by_year_1500pxby600px_intervalyear_fitpolicyequalrotate';

title height=11pt'using fitpolicy=rotate';

proc sgplot data=gg;

series y=production x=year /

markers markerattrs=size=7 symbol=circlefilled color=black)

lineattrs=(thickness=3 pattern=solid color=blue);

yaxis display= (noline) values=(200000 to 600000 by 100000);

XAXIS LABEL = 'Year' values = (1979 TO 2016 BY 3) type=linear;

xaxis display= (noline) fitpolicy=rotate;

run;

ods html close; ods listing;

PROC SGPLOT DATA=gg;

SERIES X=Year Y=PRODUCTION/MARKERS=CIRCLEFILLED;

XAXIS type=linear FITPOLICY=ROTATE values=1978 to 2016 by 3;

YAXIS LABEL=Production(tonne);

title 'Marine total fish production';

run;

PROC SGPLOT DATA=gg;

VLINE YEAR / RESPONSE=PRODUCTION;

XAXIS LABEL = 'Year' values = (1979 TO 2016 BY 3) type=linear;

XAXIS DISPLY=(NOLABEL);

KEYLEGEND / POSITION=LEFT   VALUEATTRS=(SIZE=9PT);

RUN;

Occasional Contributor
Posts: 10

## Re: Axis values rotation

I have also tried all these procs. There is no result. Can anyone suggest me what modifications I need.

* Define a style to determine the color for each of the groups. */

proc template;

define style colors;

parent=styles.htmlblue;

style GraphData1 from GraphData1 / ContrastColor=cx0000CC Color=cx0000cc;

style GraphData2 from GraphData2 / ContrastColor=lip Color=lip;

end;

run;

/* Reference the style in the ODS destination statement. */

ods html style=colors gpath='c:\temp';

/* Create an annotate data set to place the axis values below

the axis with a rotation of 90 degrees. */

data sganno;

retain function 'text' x1space 'datavalue' y1space 'datapercent'

rotate 90 anchor "right" width 30 textweight 'bold';

length textcolor \$20;

set sashelp.class;

label=name;

xc1=name;

y1=-5;

/* Make the color for the text the same as the group value.

Since "M" is encountered first in the data, GraphData1 is used. */

if sex="F" then textcolor='GraphData2:color';

else textcolor='GraphData1:color';

run;

title 'Use Annotate to Rotate Axis Values';

scatter x=name y=weight / markerattrs=(symbol=squarefilled size=10px)

group=sex;

xaxis display=(nolabel novalues) offsetmin=0.02 offsetmax=0.02;

yaxis labelattrs=(weight=bold) valueattrs=(weight=bold);

keylegend / location=inside valueattrs=(weight=bold);

run;

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;

ods noresults; ods listing close; ods graphics on / reset=all border=off antialiasmax=2500 tipmax=2500 width=1500px height=600px imagemap=on imagename= 'SGPLOT_SERIES_By_Day_1500pxBY600px_IntervalEqualWeek_FitPolicyEqualRotate'; ods html path="D:\@MWSUG2012\Results" (url=none) body='SGPLOT_SERIES_By_Day_1500pxBY600px_IntervalEqualWeek_FitPolicyEqualRotate.html' (title='1500px BY 600px SERIES Plot with Grid Interval=Week - Dow by Day in 1990'); title height=11pt '1500px BY 600px SERIES Plot with Grid Interval=Week: Dow by Day in 1990'; title2 height=11pt 'Using FitPolicy=Rotate'; proc sgplot data=work.DowByDayIn1990; series y=Dow x=Date / markers markerattrs=(size=7 symbol=circlefilled color=red) lineattrs=(thickness=2 pattern=solid color=blue); yaxis display=(nolabel) values=(&Ymin_1990 &Ymax_1990); xaxis display=(nolabel) grid interval=week FitPolicy=Rotate; format Dow 5.; run; ods html close; ods listing;

VLINEBREAKLINEATTRS=TRANSPARENCY=

TICKVALUEFORMAT= DATA

roc sgplot data=sashelp.stocks (where=(date >= "01jan2000"d

and date <= "01jan2001"d

and stock = "IBM"));

title "Stock Volume vs. Close";

vbar date / response=volume;

vline date / response=close y2axis;

run;

* Horizontal axis; axis1 order=('20oct93'd to '25oct93'd)X label=('visit date' h=1 f=swiss)Y minor=NONEZ value=(angle=45 h=.75 f=simplex)[ ; ***vertical axis; axis2 order=(70 to 80 by 2)\ minor=(n=1)] label=(a=90 j=c h=1.75 f=simplex 'heart rate' );^ *--------------------------------------------------------------------------------; proc gplot data=hr; plot hr*date=treat/haxis=axis1 vaxis=axis2; _ format date date9.; run; quit;

itle 'Height by Name';
proc sgplot data=sashelp.class
noautolegend noborder;
vbar name / response=height
baselineattrs=(thickness=0)
fillattrs=graphdata3
xaxis display=(nolabel noline noticks)
fitpolicy=rotate
valuesrotate=vertical;
yaxis display=(noline);
run;

title "US Currency in Circulation: Bill Counts";proc sgplot data=cashvalues; label denomination = 'Denomination'; format denomination \$notes.; vbar year / response=BillCountsInBillions group=denomination grouporder=data; keylegend / position=right across=1 noborder valueattrs=(size=12pt) title=""; yaxis label="Bill Counts in Billions";  xaxis display=(nolabel);run;proc sgplot data=sashelp.class noborder;  hbar name / response=height nostatlabel baselineattrs=(thickness=0)        filltype=gradient dataskin=pressed fillattrs=graphdata4;  yaxis display=(nolabel noline noticks) fitpolicy=none valueshalign=center;  xaxis display=(noline);  run;

 /*--HBar Chart None--*/ ods graphics / reset width=4.2in height=3in imagename='HBarNone'; title 'Height by Name'; proc sgplot data=sashelp.class noborder; hbar name / response=height nostatlabel baselineattrs=(thickness=0); yaxis display=(nolabel) fitpolicy=none; run; /*--Bar Chart Vertical--*/ ods graphics / reset width=4.2in height=3in imagename='VBarVertical'; title 'Height by Name'; proc sgplot data=sashelp.class noborder; vbar name / response=height nostatlabel baselineattrs=(thickness=0) fillattrs=graphdata1; xaxis display=(nolabel) valuesrotate=vertical; run;

proc sgplot data=ts pad=(bottom=10pct) sganno=ts_anno;  series x=myDate y=value;  xaxis type=time    ranges=(    "01JAN2005"d -  "01jul2015"d    )    display=(novalues nolabel)    grid  ;  yaxis    min=0 max=5    grid  ;run;proc sgplot data=cp_jo pad=(bottom=10pct) sganno=jp_anno noautolegend;   band y=x1 lower="01DEC07"d upper="01JUN09"d / transparency=.8 fillattrs=(color=gray);   series x=sasdate y=jopu;  xaxis type=time    ranges=(    "01JAN2005"d - "01aug2015"d    )    display=(novalues nolabel )      ;   yaxis     grid   ;    YAXIS LABEL = ' ' GRID VALUES = (0 TO 7 BY 1);run;

layout overlay /  xaxisopts=(linearopts=(integer=true))    yaxisopts=(linearopts=(tickvalueFormat= (extractScale=true) ));  seriesplot x=Hours y=Bacteria; endlayout;layout overlay / xaxisopts=(timeopts=(interval=month                                       splittickvalue=false                                      tickvaluefitpolicy=rotate ));

Occasional Contributor
Posts: 10

## Re: Axis values rotation

Dear Sir,

Thank You for your kind help and support. This is for bar graph, but I need for line graph.

SAS Super FREQ
Posts: 1,265

## Re: Axis values rotation

Just change VBAR to VLINE.  I suggest you refer to the procedure syntax.

Occasional Contributor
Posts: 10

## Re: Axis values rotation

Thank You for your support. I have tried all logs. I am sending you all the logs which I have tried. Can you please check the log, do some necessary corrections in it and send me back one log which will give me the result. I cannot understand where to modify, so I have done up to my level. Below are my all logs. Just say what to write in the command in which log no. and which line no. in that log.

LOG DAT 0.

Log

189  * Plot with XAXIS and YAXIS;

190  proc template;

191  define style styles.LasVegas2;

192  parent = styles.default;

193  style GraphConfidence from GraphConfidence / color= CXE8D898;

194  style GraphLegendBackground / transparency=0;

195  style GraphValueText from GraphValueText / font=('Times New Roman', 9pt, Bold);

196  style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

197  style GraphBorderLines from GraphBorderLines / LineThickness=1;

198  *style GraphWalls from GraphWalls / color= CXC0C0C0;

199  style GraphBackground / transparency=1;

200  end;

NOTE: STYLE 'Styles.LasVegas2' has been saved to: SASUSER.TEMPLAT

201  run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

202  ODs graphics on;

203  HEIGHT = 4in WIDTH = 3in;

------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

204  ODS html style=LasVegas2;

205

206  ODS LISTING GPATH = 'c:\MyGraphs';

207

208  data sganno;

209     retain function 'text' x1space 'datavalue' y1space 'datapercent'

210            rotate 45 anchor "right" width 30 textweight 'bold';

211     length textcolor \$20;

212     set sashelp.class;

213     label=year;

214     xc1=year;

215     y1=-5;

NOTE: Variable textcolor is uninitialized.

NOTE: Variable year is uninitialized.

NOTE: There were 19 observations read from the data set SASHELP.CLASS.

NOTE: The data set WORK.SGANNO has 19 observations and 17 variables.

NOTE: DATA statement used (Total process time):

real time           0.01 seconds

cpu time            0.00 seconds

216  PROC sgplot DATA = sashelp.class sganno=sganno pad=(bottom=15%);

217  Series X = year Y = Production/ markers markerattrs=(symbol=circlefilled);

218  ;

219  series x=Year Y=Prediction/markers markerattrs=(symbol=circlefilled);

220  XAXIS LABEL = 'Year' values = (1979 TO 2026 BY 3) type=linear;

221  YAXIS LABEL = 'Production (tonne)' values = (200000 TO 600000 BY 100000);

222  TITLE 'Fig.1  total marine total fish production';

223  RUN;

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE SGPLOT used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

224  Ods graphics off;

LOG DATA 1.

log data

133  * Plot with XAXIS and YAXIS;

134  proc template;

135  define style styles.LasVegas2;

136  parent = styles.default;

137  style GraphConfidence from GraphConfidence / color= CXE8D898;

138  style GraphLegendBackground / transparency=0;

139  style GraphValueText from GraphValueText / font=('Times New Roman', 9pt, bold);

140  style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

141  style GraphBorderLines from GraphBorderLines / LineThickness=1;

142  *style GraphWalls from GraphWalls / color= CXC0C0C0;

143  style GraphBackground / transparency=0;

144  end;

NOTE: STYLE 'Styles.LasVegas2' has been saved to: SASUSER.TEMPLAT

145  run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

146  ODs graphics on;

147  HEIGHT = 3in WIDTH = 4in;

------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

148  ODS html style=LasVegas2;

149

150  ODS LISTING GPATH = 'c:\MyGraphs';

151

152  PROC SGPLOT DATA = bv ;

153  SERIES X = year Y = production /LINEATTRS=(thickness=3);

154  XAXIS LABEL = 'Year' values = (1979 TO 2027 BY 4) type=linear;

155  YAXIS LABEL = 'Production (tonnes)' values = (200000 TO 600000 BY 100000);

156  TITLE 'Marine total fish production';

157  RUN;

NOTE: PROCEDURE SGPLOT used (Total process time):

real time           0.28 seconds

cpu time            0.06 seconds

WARNING: GPATH or PATH is not a writable directory. It will be ignored.

NOTE: Listing image output written to SGPlot17.png.

NOTE: There were 50 observations read from the data set WORK.BV.

158  Ods graphics off;

159

160  PROC SGPLOT DATA=bv;

161  VLINE YEAR / RESPONSE=PRODUCTION;

162  XAXIS LABEL = 'Year' values = (1979 TO 2027 BY 4) type=linear;

163  XAXIS DISPLY=(NOLABEL);

------

1

WARNING 1-322: Assuming the symbol DISPLAY was misspelled as DISPLY.

164  KEYLEGEND / POSITION=LEFT   VALUEATTRS=(SIZE=9PT);

165  run;

NOTE: Since no format is assigned, the numeric category variable will use the default of BEST6.

NOTE: PROCEDURE SGPLOT used (Total process time):

real time           0.28 seconds

cpu time            0.06 seconds

WARNING: GPATH or PATH is not a writable directory. It will be ignored.

NOTE: Listing image output written to SGPlot19.png.

NOTE: There were 50 observations read from the data set WORK.BV.

LOG DATA 2.

log data

166  * Plot with XAXIS and YAXIS;

167  proc template;

168  define style styles.LasVegas2;

169  parent = styles.default;

170  style GraphConfidence from GraphConfidence / color= CXE8D898;

171  style GraphLegendBackground / transparency=0;

172  style GraphValueText from GraphValueText / font=('Times New Roman', 12pt, Bold);

173  style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

174  style GraphBorderLines from GraphBorderLines / LineThickness=0;

175  *style GraphWalls from GraphWalls / color= CXC0C0C0;

176  style GraphBackground / transparency=0;

177  end;

NOTE: STYLE 'Styles.LasVegas2' has been saved to: SASUSER.TEMPLAT

178  run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

179  ODs graphics on;

180  HEIGHT = 3in WIDTH = 4in;

------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

181  ODS html style=LasVegas2;

182

183  ODS LISTING GPATH = 'c:\MyGraphs';

184

185  PROC SGPLOT DATA = bv ;

186  SERIES X = year Y = production /LINEATTRS=(thickness=3);

187  XAXIS LABEL = 'Year' values = (1979 TO 2027 BY 4) type=linear;

188  YAXIS LABEL = 'Production (tonnes)' values = (200000 TO 600000 BY 100000);

189  TITLE 'Marine total fish production';

190  RUN;

NOTE: PROCEDURE SGPLOT used (Total process time):

real time           0.29 seconds

cpu time            0.06 seconds

WARNING: GPATH or PATH is not a writable directory. It will be ignored.

NOTE: Listing image output written to SGPlot21.png.

NOTE: There were 50 observations read from the data set WORK.BV.

191  Ods graphics off;

192

193  PROC SGPLOT DATA=bv;

194  VLINE YEAR / RESPONSE=PRODUCTION;

195  XAXIS LABEL = 'Year' values = (1979 TO 2027 BY 4) type=linear;

196  XAXIS DISPLY=(NOLABEL);

------

1

WARNING 1-322: Assuming the symbol DISPLAY was misspelled as DISPLY.

197  KEYLEGEND / POSITION=RIGHT   VALUEATTRS=(SIZE=9PT);

198  run;

NOTE: Since no format is assigned, the numeric category variable will use the default of BEST6.

NOTE: PROCEDURE SGPLOT used (Total process time):

real time           0.31 seconds

cpu time            0.04 seconds

WARNING: GPATH or PATH is not a writable directory. It will be ignored.

NOTE: Listing image output written to SGPlot23.png.

NOTE: There were 50 observations read from the data set WORK.BV.

LOG DATA 3.

log data

225  * Plot with XAXIS and YAXIS;

----

388

76

ERROR 388-185: Expecting an arithmetic operator.

ERROR 76-322: Syntax error, statement will be ignored.

ERROR: You cannot open WORK.BV.DATA for output access with member-level control because WORK.BV.DATA

is in use by you in resource environment ViewTable Window.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time           30.70 seconds

cpu time            0.48 seconds

226  proc template;

227  define style styles.LasVegas2;

228  parent = styles.default;

229  style GraphConfidence from GraphConfidence / color= CXE8D898;

230  style GraphLegendBackground / transparency=0;

231  style GraphValueText from GraphValueText / font=('Times New Roman', 9pt, Bold);

232  style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

233  style GraphBorderLines from GraphBorderLines / LineThickness=1;

234  *style GraphWalls from GraphWalls / color= CXC0C0C0;

235  style GraphBackground / transparency=1;

236  end;

NOTE: STYLE 'Styles.LasVegas2' has been saved to: SASUSER.TEMPLAT

237  run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.01 seconds

cpu time            0.01 seconds

238  ODs graphics on;

239  HEIGHT = 4in WIDTH = 11in;

------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

240  ODS html style=LasVegas2;

241

242  ODS LISTING GPATH = 'c:\MyGraphs';

243  data bv;

244          retain function 'text' x1space 'year' y1space'production'

245          rotate 45 anchor "right" width 30 textweight "bold";

246          length textcolor \$20;

247          set sashelp.class;

248          label=year;

249  xc1=year;

250  y1=-5;

251  run;

NOTE: Variable textcolor is uninitialized.

NOTE: Variable year is uninitialized.

ERROR: You cannot open WORK.BV.DATA for output access with member-level control because WORK.BV.DATA

is in use by you in resource environment ViewTable Window.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time           0.01 seconds

cpu time            0.00 seconds

LOG DATA 4.

log data

370  * Plot with XAXIS and YAXIS;

371  proc template;

372  define style styles.LasVegas2;

373  parent = styles.default;

374  style GraphConfidence from GraphConfidence / color= CXE8D898;

375  style GraphLegendBackground / transparency=0;

376  style GraphValueText from GraphValueText / font=('Times New Roman', 9pt, Bold);

377  style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

378  style GraphBorderLines from GraphBorderLines / LineThickness=1;

379  *style GraphWalls from GraphWalls / color= CXC0C0C0;

380  style GraphBackground / transparency=1;

381  end;

NOTE: STYLE 'Styles.LasVegas2' has been saved to: SASUSER.TEMPLAT

382  run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

383  ODs graphics on;

384  HEIGHT = 4in WIDTH = 11in;

------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

385  ODS html style=LasVegas2;

386

387  ODS LISTING GPATH = 'c:\MyGraphs';

388

389  data bv;

390     retain function 'text' x1space 'datavalue' y1space 'datapercent'

391            rotate 45 anchor "right" width 30 textweight 'bold';

392     length textcolor \$20;

393     set sashelp.class;

394     label=year;

395     xc1=year;

396     y1=-5;

397  run;

NOTE: Variable textcolor is uninitialized.

NOTE: Variable year is uninitialized.

ERROR: You cannot open WORK.BV.DATA for output access with member-level control because WORK.BV.DATA

is in use by you in resource environment ViewTable Window.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

LOG DATA 5.

log

425  * Plot with XAXIS and YAXIS;

426  proc template;

427  define style styles.LasVegas2;

428  parent = styles.default;

429  style GraphConfidence from GraphConfidence / color= CXE8D898;

430  style GraphLegendBackground / transparency=0;

431  style GraphValueText from GraphValueText / font=('Times New Roman', 9pt, Bold);

432  style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

433  style GraphBorderLines from GraphBorderLines / LineThickness=1;

434  *style GraphWalls from GraphWalls / color= CXC0C0C0;

435  style GraphBackground / transparency=1;

436  end;

NOTE: STYLE 'Styles.LasVegas2' has been saved to: SASUSER.TEMPLAT

437  run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

438  ODs graphics on;

439  HEIGHT = 4in WIDTH = 11in;

------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

440  ODS html style=LasVegas2;

441

442  ODS LISTING GPATH = 'c:\MyGraphs';

443

444  data bv;

445          retain function 'text' x1space 'year' y1space'production'

446          rotate 45 anchor "right" width 30 textweight "bold";

447          length textcolor \$20;

448          set sashelp.class;

449          label=year;

450  xc1=year;

451  run;

NOTE: Variable textcolor is uninitialized.

NOTE: Variable year is uninitialized.

ERROR: You cannot open WORK.BV.DATA for output access with member-level control because WORK.BV.DATA

is in use by you in resource environment ViewTable Window.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

LOG DATA 6.

log data

505  * Plot with XAXIS and YAXIS;

506  proc template;

507  define style styles.LasVegas2;

508  parent = styles.default;

509  style GraphConfidence from GraphConfidence / color= CXE8D898;

510  style GraphLegendBackground / transparency=0;

511  style GraphValueText from GraphValueText / font=('Times New Roman', 9pt, Bold);

512  style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

513  style GraphBorderLines from GraphBorderLines / LineThickness=1;

514  *style GraphWalls from GraphWalls / color= CXC0C0C0;

515  style GraphBackground / transparency=1;

516  end;

NOTE: STYLE 'Styles.LasVegas2' has been saved to: SASUSER.TEMPLAT

517  run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

518  ODs graphics on;

519  HEIGHT = 4in WIDTH = 11in;

------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

520  ODS html style=LasVegas2;

521

522  ODS LISTING GPATH = 'c:\MyGraphs';

523

524  data bv;

525          retain function 'text' x1space 'year' y1space'production'

526          rotate 45 anchor "right" width 30 textweight "bold";

527          length textcolor \$20;

528          set sashelp.class;

529          label=year;

530  run;

NOTE: Variable textcolor is uninitialized.

NOTE: Variable year is uninitialized.

ERROR: You cannot open WORK.BV.DATA for output access with member-level control because WORK.BV.DATA

is in use by you in resource environment ViewTable Window.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

LOG DATA 7.

Log

37   * Plot with XAXIS and YAXIS;

38   proc template;

39   define style styles.LasVegas2;

40   parent = styles.default;

41   style GraphConfidence from GraphConfidence / color= CXE8D898;

42   style GraphLegendBackground / transparency=0;

43   style GraphValueText from GraphValueText / font=('Times New Roman', 9pt, Bold);

44   style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

45   style GraphBorderLines from GraphBorderLines / LineThickness=1;

46   *style GraphWalls from GraphWalls / color= CXC0C0C0;

47   style GraphBackground / transparency=1;

48   end;

NOTE: STYLE 'Styles.LasVegas2' has been saved to: SASUSER.TEMPLAT

49   run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

50   ODs graphics on;

51   HEIGHT = 4in WIDTH = 3in;

------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

52   ODS html style=LasVegas2;

53

54   ODS LISTING GPATH = 'c:\MyGraphs';

55

56   data bv;

57           retain function 'text' x1space 'year' y1space'production'

58           rotate 45 anchor "right" width 30 textweight "bold";

59           length textcolor \$20;

60           set sashelp.class;

61           label=year;

62   xc1=year;

63

NOTE: Variable textcolor is uninitialized.

NOTE: Variable year is uninitialized.

ERROR: You cannot open WORK.BV.DATA for output access with member-level control because WORK.BV.DATA

is in use by you in resource environment ViewTable Window.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

64   PROC SGPLOT DATA = bv pad=(bottom=15%); ;

65   Series X = year Y = Production/ markers markerattrs=(symbol=circlefilled);

66   ;

67   series x=Year Y=Prediction/markers markerattrs=(symbol=circlefilled);

68   XAXIS LABEL = 'Year' values = (1979 TO 2026 BY 3) type=linear;

69   YAXIS LABEL = 'Production (tonne)' values = (200000 TO 600000 BY 100000);

70   TITLE 'Fig.1  total marine total fish production';

71   RUN;

NOTE: PROCEDURE SGPLOT used (Total process time):

real time           0.68 seconds

cpu time            0.20 seconds

WARNING: GPATH or PATH is not a writable directory. It will be ignored.

NOTE: Listing image output written to SGPlot1.png.

NOTE: There were 50 observations read from the data set WORK.BV.

72   Ods graphics off;

LOG DATA 8.

Log

73   * Plot with XAXIS and YAXIS;

74   proc template;

75   define style styles.LasVegas2;

76   parent = styles.default;

77   style GraphConfidence from GraphConfidence / color= CXE8D898;

78   style GraphLegendBackground / transparency=0;

79   style GraphValueText from GraphValueText / font=('Times New Roman', 9pt, Bold);

80   style GraphLabelText from GraphLabelText / font=('Times New Roman', 12pt, Bold);

81   style GraphBorderLines from GraphBorderLines / LineThickness=1;

82   *style GraphWalls from GraphWalls / color= CXC0C0C0;

83   style GraphBackground / transparency=1;

84   end;

NOTE: STYLE 'Styles.LasVegas2' has been saved to: SASUSER.TEMPLAT

85   run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.00 seconds

cpu time            0.00 seconds

86   ODs graphics on;

87   HEIGHT = 4in WIDTH = 3in;

------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

88   ODS html style=LasVegas2;

89

90   ODS LISTING GPATH = 'c:\MyGraphs';

91

92   data bv;

93      retain function 'text' x1space 'datavalue' y1space 'datapercent'

94             rotate 45 anchor "right" width 30 textweight 'bold';

95      length textcolor \$20;

96      set sashelp.class;

97      label=year;

98

NOTE: Variable textcolor is uninitialized.

NOTE: Variable year is uninitialized.

ERROR: You cannot open WORK.BV.DATA for output access with member-level control because WORK.BV.DATA

is in use by you in resource environment ViewTable Window.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time           0.01 seconds

cpu time            0.01 seconds

99   PROC SGPLOT DATA = bv pad=(bottom=15%); ;

100  Series X = year Y = Production/ markers markerattrs=(symbol=circlefilled);

101  ;

102  series x=Year Y=Prediction/markers markerattrs=(symbol=circlefilled);

103  XAXIS LABEL = 'Year' values = (1979 TO 2026 BY 3) type=linear;

104  YAXIS LABEL = 'Production (tonne)' values = (200000 TO 600000 BY 100000);

105  TITLE 'Fig.1  total marine total fish production';

106  RUN;

NOTE: PROCEDURE SGPLOT used (Total process time):

real time           0.29 seconds

cpu time            0.07 seconds

WARNING: GPATH or PATH is not a writable directory. It will be ignored.

NOTE: Listing image output written to SGPlot3.png.

NOTE: There were 50 observations read from the data set WORK.BV.

107  Ods graphics off;

Discussion stats
• 8 replies
• 1388 views
• 3 likes
• 4 in conversation