Data visualization with SAS programming

Specify height or lenght of z axis in a 3D surface plot

Reply
Contributor
Posts: 23

Specify height or lenght of z axis in a 3D surface plot

[ Edited ]

I want to specify height or length of z axis ("yield" in the code),  and make it constant for all graphs that I plot using the following code:

Data surface_data;
input longitude latitude yield;
datalines;
25 1 10.24061798
25 2 10.18945919
25 3 10.24603036
25 4 10.21469164
25 5 10.3569244
25 6 10.4341069
25 7 10.51234875
25 8 10.31936942
25 9 10.31433383
25 10 10.09816315
25 11 10.08227349
24 1 9.964279285
24 2 9.999276305
24 3 10.13840094
24 4 10.06908336
24 5 10.20031561
24 6 10.20704363
24 7 10.1633989
24 8 9.89360785
24 9 9.868459005
24 10 9.664085973
24 11 9.569255248
23 1 10.16884254
23 2 10.02720902
23 3 10.0989363
23 4 10.06207629
23 5 10.12797438
23 6 10.01120926
23 7 10.10409345
23 8 9.783574659
23 9 9.742959124
23 10 9.576318006
23 11 9.547052867
23 12 9.26079852
22 1 9.838811912
22 2 9.857413943
22 3 9.904069845
22 4 10.02737479
22 5 10.15349052
22 6 10.20212607
22 7 10.32325962
22 8 10.15136354
22 9 9.966611275
22 10 9.84820933
22 11 9.682390789
21 1 9.652928231
21 2 9.747414715
21 3 9.729317621
21 4 9.804088294
21 5 9.98921479
21 6 10.02810718
21 7 10.09754669
21 8 9.929498084
21 9 9.82700071
21 10 9.77142901
21 11 9.557090696
20 1 9.808591981
20 2 10.0023067
20 3 9.858293107
20 4 9.848799645
20 5 9.964216034
20 6 9.954632883
20 7 9.733792497
20 8 9.279543077
19 1 10.3061167
19 2 10.34364618
19 3 10.08549625
19 4 10.02280914
19 5 9.916269233
19 6 9.87102356
18 1 10.2759475
18 2 10.42903691
18 3 10.30009033
18 4 10.22903993
18 5 10.13818918
18 6 10.38026755
17 1 10.30673867
17 2 10.44388668
17 3 10.29540101
17 4 10.27747447
17 5 10.07507574
17 6 10.19549874
16 1 10.57136414
16 2 10.70066989
16 3 10.65852179
16 4 10.67728124
16 5 10.26602339
16 6 10.42233039
15 1 10.64637906
15 2 10.61824617
15 3 10.61049403
15 4 10.7125465
15 5 10.20291925
15 6 10.29158389
14 1 10.26569453
14 2 10.26058373
14 3 10.40219017
14 4 10.5142487
14 5 10.13893007
14 6 10.12276483
13 1 9.946097052
13 2 9.920397473
13 3 9.861763044
13 4 10.10212053
13 5 9.564990592
13 6 9.505557809
12 1 10.14870784
12 2 10.14328109
12 3 10.18934763
12 4 10.42799694
12 5 10.01036317
12 6 10.07429122
11 1 10.1757859
11 2 10.1651892
11 3 10.16743545
11 4 10.39879704
11 5 9.888421802
11 6 9.932260383
11 12 10.61302956
10 1 10.05788891
10 2 10.06779075
10 3 10.08558574
10 4 10.1907223
10 5 9.865100588
10 6 9.904584993
10 7 9.749991066
10 10 9.658145028
10 11 10.05447841
10 12 10.48140198
10 13 10.63479646
9 1 10.06809468
9 2 10.14289316
9 3 9.945727506
9 4 10.07890954
9 5 9.822529657
9 6 10.069579
9 7 10.10869909
9 8 10.42812909
9 9 10.42280183
9 10 10.15911945
9 11 10.34478314
9 12 10.49821017
9 13 10.53931589
8 1 10.21827017
8 2 10.26760735
8 3 10.07571108
8 4 9.848173097
8 5 9.755753342
8 7 10.24994819
8 8 10.52508255
8 9 10.32178952
8 10 10.1234186
8 11 10.37426168
8 12 10.2811384
8 13 10.20907605
7 1 10.01528545
7 2 10.06930679
7 3 9.976016135
7 4 9.673080965
7 5 9.750588118
7 7 10.7830968
7 8 10.76962789
7 9 10.39575261
7 10 10.27608515
7 11 10.45651758
7 12 10.17252876
7 13 10.18773359
6 1 9.779296799
6 2 9.833611131
6 3 9.613889937
6 4 9.363326067
6 5 9.840975778
6 6 10.15947046
6 7 10.36296479
6 8 10.20486752
6 9 10.05220129
6 10 10.03034447
6 11 10.21594756
6 12 10.02849789
6 13 10.19203314
5 1 9.904336681
5 2 10.00233101
5 3 9.869590517
5 4 9.729373418
5 5 10.09030902
5 6 10.31835668
5 7 10.29623454
5 8 10.18334313
5 9 10.05884586
5 10 9.835287931
5 11 9.997013589
5 12 9.8251636
5 13 9.863514134
4 1 9.880326564
4 2 9.8954177
4 3 9.878693889
4 4 9.963253177
4 5 10.19458701
4 6 10.53153975
4 7 10.40092666
4 8 10.16953916
4 9 9.907849155
4 10 9.749135997
4 11 9.846222662
4 12 9.730926313
4 13 9.802125205
3 1 9.919617979
3 2 9.959272196
3 3 10.09832872
3 4 10.18456579
3 5 10.24457327
3 6 10.53359676
3 7 10.57312332
3 8 10.46072723
3 9 10.37885036
3 10 10.19827381
3 11 10.15438569
3 12 10.09109552
3 13 10.02597717
2 1 9.938079954
2 2 9.885515619
2 3 9.929253261
2 4 10.0773824
2 5 10.06407697
2 6 10.39847179
2 7 10.43300803
2 8 10.46975479
2 9 10.44968258
2 10 10.27468616
2 11 10.14966628
2 12 10.13316062
2 13 9.908667445
1 1 9.991726284
1 2 9.896851879
1 3 9.920530828
1 4 10.03064793
1 5 9.970398405
1 6 10.55323808
1 7 10.59372065
1 8 10.86109193
1 9 10.82628107
1 10 10.60592891
1 11 10.36918129
1 12 10.29778208
1 13 9.795459976


;

 

proc template;
define statgraph surface;


begingraph;
entrytitle 'Height Data';
rangeattrmap name="yield_map";

range 0-8 / rangecolormodel = (black );
range 8.02-8.88 / rangecolormodel=(darkred);
range 8.88-9.74/ rangecolormodel=(red);
range 9.74-10.6 / rangecolormodel=(yellow);
range 10.6 - 11.46 / rangecolormodel=(green);
range 11.46-12.32/ rangecolormodel=(darkgreen);

endrangeattrmap;
rangeattrvar attrvar=yieldvar var=yield attrmap="yield_map";
layout overlay3d / rotate=-70 tilt=55;
surfaceplotparm x=Latitude y=Longitude z=yield / surfacetype=fillgrid
colorresponse=yieldvar name="surface";
continuouslegend "surface";
endlayout;
endgraph;
end;
run;

ods graphics / width=640px height=640px;
proc g3grid data=surface_data out=gridded;
grid Longitude*Latitude=Yield / spline smooth=1
axis1=1 to 25 by 1
axis2=1 to 13 by 1;

run;
proc sort data=gridded; by Longitude Latitude; run;


proc sgrender data=gridded template=surface;

run;
quit;

 

 

 

Is there a way that we can control Z axis?

Ask a Question
Discussion stats
  • 0 replies
  • 136 views
  • 0 likes
  • 1 in conversation