We have a data matrix of 1544x1544 i.e. pixel coordinates and their colors. We want to display that information graphically with the sgplot procedure. The _tmp dataset contains X, Y and color.
x=1; y=1; color="CX000000";
x=1; y=2; color="cxD3D3D3";
x=1; y=3; color="cx03D3D3";
...........................................................
...........................................................
Total 1544 ^ 2 = 2 383 936 observations
We use the following syntax:
data attrmap;
set _tmp;
retain id "myid";
altcolor=color;
min=_N_-0.1;max=_N_+0.1;
run;
proc sgplot data=_tmp rattrmap=attrmap;
scatter X=x Y=y /
colorresponse=nr markerattrs=(symbol=CircleFilled size=10)
rattrid=myid;
gradlegend "notitle";
run;
We get the error:
ERROR: An exception has been encountered.
Please contact technical support and provide them with the following traceback information:
The SAS task name is [SGPLOT]
ERROR: Read Access Violation SGPLOT
Exception occurred at (068DAECD)
Task Traceback
Address Frame (DBGHELP API Version 4.0 rev 5)
00000000068DAECD 000000000A0A70B0 sasods:tkvercn1+0x109E8D
000000000D7F9EC4 000000000A0A70B8 sasstgr:tkvercn1+0x78E84
000000000D7946DE 000000000A0A7700 sasstgr:tkvercn1+0x1369E
000000000754C4FA 000000000A0A7708 saswobc:tkvercn1+0x1B4BA
000000000753BECD 000000000A0A7800 saswobc:tkvercn1+0xAE8D
000000000D813F4A 000000000A0A7840 sasstgr:tkvercn1+0x92F0A
000000000D78971E 000000000A0A78B0 sasstgr:tkvercn1+0x86DE
000000000D813F4A 000000000A0A78F0 sasstgr:tkvercn1+0x92F0A
000000000D78E3EE 000000000A0A8290 sasstgr:tkvercn1+0xD3AE
000000000754C4FA 000000000A0A82D0 saswobc:tkvercn1+0x1B4BA
000000000753BECD 000000000A0A8390 saswobc:tkvercn1+0xAE8D
000000000D813F4A 000000000A0A83D0 sasstgr:tkvercn1+0x92F0A
000000000D78971E 000000000A0A8440 sasstgr:tkvercn1+0x86DE
000000000D813F4A 000000000A0A8480 sasstgr:tkvercn1+0x92F0A
000000000D78E3EE 000000000A0A8E20 sasstgr:tkvercn1+0xD3AE
000000000D813F4A 000000000A0A8E60 sasstgr:tkvercn1+0x92F0A
000000000D7DB15F 000000000A0A8ED0 sasstgr:tkvercn1+0x5A11F
000000000D813F4A 000000000A0A8F10 sasstgr:tkvercn1+0x92F0A
000000000D7ECFB8 000000000A0A9350 sasstgr:tkvercn1+0x6BF78
000000000D813F4A 000000000A0A9390 sasstgr:tkvercn1+0x92F0A
000000000D7EB6D8 000000000A0A9990 sasstgr:tkvercn1+0x6A698
000000000D813F4A 000000000A0A99D0 sasstgr:tkvercn1+0x92F0A
000000000D7FD185 000000000A0A9A40 sasstgr:tkvercn1+0x7C145
00000000069E43EA 000000000A0A9A80 sasods:tkvercn1+0x2133AA
0000000006821A69 000000000A0A9CA0 sasods:tkvercn1+0x50A29
0000000006820D4F 000000000A0A9F20 sasods:tkvercn1+0x4FD0F
000000000C5455DA 000000000A0A9F28 sassgplo:tkvercn1+0xC459A
000000000C4BCD3F 000000000A0AFBB0 sassgplo:tkvercn1+0x3BCFF
00000000031B946E 000000000A0AFBB8 sashost:Main+0x113BE
00000000031BF2CD 000000000A0AFF20 sashost:Main+0x1721D
00007FFFAD817BD4 000000000A0AFF28 KERNEL32:BaseThreadInitThunk+0x14
00007FFFAE76CED1 000000000A0AFF58 ntdll:RtlUserThreadStart+0x21
NOTE: The SAS System stopped processing this step because of errors.
What could be an alternative solution to graphically represent such a big array?
Have you tried the HEATMAP statement in proc sgplot? By default it only accomodates 100000 bins but you can increase that number with the NXYBINSMAX= option of the ODS GRAPHICS statement.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.