BookmarkSubscribeRSS Feed
dleduc
Calcite | Level 5

Lately all of my PROC GPLOT logs have contained the error message

"Undefinable color CX000000CXFF0000 mapped to GRAY"

 

I have not defined any colors and, in fact, whenever I could specify a color it has been black.  I can see that CX000000CXFF0000 is probably not a valid color definition, but I don't know where it is coming from.  I've attached my code and the log file that comes from it (renamed to figure7.txt)  I've also attached my autoexec.sas file to show that I haven't really done anything to strange in it.

 

I am using version 9.4 on a Windows 10 system

10 REPLIES 10
DanH_sas
SAS Super FREQ

The color CX000000CXFF0000 is really black (CX000000) and red (CXFF0000) jammed together. This issue has the feel of a macro concatenating colors into one string, but missing the space separator. However, I do not see this in your code. Since I cannot run your code, let's trying narrowing down the location of the colors be removing the annotations from your plots. Let us know if the color problem goes away.

 

Thanks!
Dan

ballardw
Super User

@dleduc wrote:

Lately all of my PROC GPLOT logs have contained the error message

"Undefinable color CX000000CXFF0000 mapped to GRAY"

 

I have not defined any colors and, in fact, whenever I could specify a color it has been black.  I can see that CX000000CXFF0000 is probably not a valid color definition, but I don't know where it is coming from.  I've attached my code and the log file that comes from it (renamed to figure7.txt)  I've also attached my autoexec.sas file to show that I haven't really done anything to strange in it.

 

I am using version 9.4 on a Windows 10 system


Have you tried resetting goptions to default? There are some things that persist from session to session and

goptions reset=all;

might clear an offending element.

 

Also, which style do you have active? There may be some interaction with an element you are not defining explicitly getting a color setting that is off.

 

This might also be an indication of time to move on to PROC SGPLOT instead of GPLOT.

 

BTW your MYANNO macro really should include a RUN inside the macro definition.

dleduc
Calcite | Level 5

In reference to DanH, I tried removing all traces of the annotate code and it did not help.  I then moved on to using the device TIFFP instead of TIFFB and the problem went away.  I can probably live with this since I only specified black in the potential color palette, but a publisher might not like a color graphic format even if it is only black and white.  Do you know where this faulty color might be defined in the TIFFB driver?  The error message is gone, but this did not solve my real problem which was that my axes are still gray rather than black.  Do you have any thoughts on that?

 

In reference to ballardw as far as I know my options are already reset  since I ran this job in batch mode.  That is why I like batch mode because you do not have left over pieces of previous jobs.  I do not think that style applies to SAS/GRAPH.  Isn't that an ODS graphics option?  It does seem like I probably should move toward SGPLOT, but I've only seen some code samples that seem less flexible that what I can do in SAS/GRAPH even if that is not entirely true.

dleduc
Calcite | Level 5
I checked further and my axes are not gray. They are just very thin black lines so they appear gray on my monitor.
DanH_sas
SAS Super FREQ

Thank you for the information. The TIFFB driver has only one device foreground color define (Black), so you should just get black without the COLORS option. I'm curious to see if TIFFB would work if you ran without the COLORS option (in case there is some interaction).

dleduc
Calcite | Level 5
I think that I only added the colors=black when I kept getting that error message to see if I could prevent it from trying to use that invalid color. However, rather than trusting my memory I reset the device drive to TIFFB and removed all of the color statements from my code. I still get the error message.
DanH_sas
SAS Super FREQ

Okay, thanks again for the information. We'll continue to investigate.

DanH_sas
SAS Super FREQ

I'm having trouble reproducing this issue. Can you run the program below and see if you get the problem. Also, what version of SAS are you using?

 

ods _all_ close;
ods listing gpath=".";

options orientation=landscape;
filename plot "dist_vs_ring_dbh.tif";
goptions  device=tiffb gsfname=plot gsfmode=replace colors=(BLACK) xpixels=6000 ypixels=4800 xmax=10 in ymax=8 in;
proc gplot data=sashelp.class;
plot height*weight;
run;
quit;
dleduc
Calcite | Level 5

First of all I am funning version 9.4   Your code ran fine, so I added to it until I got a failure.  The following code produces the error:

 

 

/* ods _all_ close;
ods listing gpath="."; */

ods listing;
axis1 label=(font="Arial" h=2.5 'Ring Number') value=( font="Arial" h=2.5) order=0 to 70 by 10 major=(width=20) minor=none width=20 color=black; 
axis2 label=(angle=90 h=2.5 font="Arial" 'Distance (mm)') value=( font="Arial" h=2.5)  major=(width=20) order=0 to 200 by 50 minor=none width=20 color=black;
legend1 cborder=black label=(font="Arial" h=2 'Tree') across=1 mode=protect position=(bottom right inside)  value=( font="Arial" h=2);


options orientation=landscape;
filename plot "sastest.tif";
goptions  device=tiffb gsfname=plot gsfmode=replace colors=(BLACK) xpixels=6000 ypixels=4800 xmax=10 in ymax=8 in;
proc gplot data=sashelp.class;
plot weight*height=sex/haxis=axis1 vaxis=axis2 legend=legend1;
run;
quit;

proc print data=sashelp.class;

The key to failure is using the legend.  The legend1 statement does not cause an error by itself, but when it is used with legend=legend1, it produces the error.

 

I appreciate all of your help, but if you don't get any response from me for a couple of weeks it is not that I am uninterested, but my timing was off.  I'm about to go on vacation for a couple of weeks and will only return to this problem upon my return.

 

 

ballardw
Super User

@dleduc wrote:

In reference to DanH, I tried removing all traces of the annotate code and it did not help.  I then moved on to using the device TIFFP instead of TIFFB and the problem went away.  I can probably live with this since I only specified black in the potential color palette, but a publisher might not like a color graphic format even if it is only black and white.  Do you know where this faulty color might be defined in the TIFFB driver?  The error message is gone, but this did not solve my real problem which was that my axes are still gray rather than black.  Do you have any thoughts on that?

 

In reference to ballardw as far as I know my options are already reset  since I ran this job in batch mode.  That is why I like batch mode because you do not have left over pieces of previous jobs.  I do not think that style applies to SAS/GRAPH.  Isn't that an ODS graphics option?  It does seem like I probably should move toward SGPLOT, but I've only seen some code samples that seem less flexible that what I can do in SAS/GRAPH even if that is not entirely true.


Change ods styles on a graphics program and see. Results sent to listing and ODS can vary quite notably for anything not specifically set in your program. You don't control device graphics options generally but a few elements can be set by them.

 

The features I used with GPLOT that I am not quite happy yet with SGPLOT are the axis controls but they have been getting better with each release of SAS. The ability to overlay multiple different graph types is one big advantage. And once you discover DATTRMAP for consistent appearance of values across graph procedures (District Five everything is always blue/star/dot-dash line/ etc. and doesn't change just because District Four didn't appear on that graph)

 

And check out some of the examples from http://support.sas.com/sassamples/graphgallery/PROC_SGRENDER.html or the SAS graphics BLOGS.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 10 replies
  • 1894 views
  • 0 likes
  • 3 in conversation