Data visualization with SAS programming

Creating CMYK colored figures with GTL

Reply
Highlighted
Occasional Learner
Posts: 1

Creating CMYK colored figures with GTL

I want to create a graph using GTL (SAS 9.4) which completely uses CMYK pure process black color. I replaced (hopefully) all colors in my style definition with CMYK color black (CMYK000000FF) or white (CMYK00000000) and create my statgraph definitions. The figure as PDF file looks as expected, but looking into the color scheme, black is not presented as pure black (CMYK000000FF) but as a combination of RGB values (e.g., cyan 75%, magenta 68%, yallow 67%, process black 90%)..

Are thee any hints or ideas what's going wrong?

 

Here's my code (looks long because of all the color defintions):

%LET color=CMYK000000FF;

%**** Define the template;

%let __font = %str(Arial);

%let __fontsz = %str(8pt);

%let __fontsz2 = %str(6pt);

proc template;

define style cmfm;

parent=styles.listing;

style color_list

"Colors used in the listing style" /

'fgB2' = CMYK000000FF

'fgB1' = CMYK000000FF

'fgA4' = CMYK000000FF

'bgA4' = CMYK000000FF

'bgA3' = CMYK00000000

'fgA2' = CMYK000000FF

'bgA2' = CMYK000000FF

'fgA1' = CMYK000000FF

'bgA1' = CMYK000000FF

'fgA' = CMYK000000FF

'bgA' = CMYK00000000;

style GraphColors

"Abstract colors used in graph styles" /

'goffill' = CMYK000000FF

'gofill' = CMYK000000FF

'govbline' = CMYK000000FF

'gobline' = CMYK000000FF

'gncdata12' = CMYK000000FF

'gndata12' = CMYK000000FF

'gncdata11' = CMYK000000FF

'gndata11' = CMYK000000FF

'gncdata10' = CMYK000000FF

'gndata10' = CMYK000000FF

'gncdata9' = CMYK000000FF

'gndata9' = CMYK000000FF

'gncdata8' = CMYK000000FF

'gndata8' = CMYK000000FF

'gncdata7' = CMYK000000FF

'gndata7' = CMYK000000FF

'gncdata6' = CMYK000000FF

'gndata6' = CMYK000000FF

'gncdata5' = CMYK000000FF

'gndata5' = CMYK000000FF

'gncdata4' = CMYK000000FF

'gndata4' = CMYK000000FF

'gncdata3' = CMYK000000FF

'gndata3' = CMYK000000FF

'gncdata2' = CMYK000000FF

'gndata2' = CMYK000000FF

'gncdata1' = CMYK000000FF

'gndata1' = CMYK000000FF

'gncdata' = CMYK000000FF

'gndata' = CMYK000000FF

'gnclink' = CMYK000000FF

'gnlink' = CMYK000000FF

'gntext' = CMYK000000FF

'gblockheader' = CMYK000000FF

'gcphasebox' = CMYK000000FF

'gphasebox' = CMYK000000FF

'gczonec' = CMYK000000FF

'gzonec' = CMYK000000FF

'gczoneb' = CMYK000000FF

'gzoneb' = CMYK000000FF

'gzonea' = CMYK000000FF

'gcunder' = CMYK000000FF

'gunder' = CMYK000000FF

'gcover' = CMYK000000FF

'gover' = CMYK000000FF

'gcfinal' = CMYK000000FF

'gfinal' = CMYK000000FF

'gcinitial' = CMYK000000FF

'ginitial' = CMYK000000FF

'gcother' = CMYK000000FF

'gother' = CMYK000000FF

'gcmiss' = CMYK000000FF

'gmiss' = CMYK000000FF

'gablock' = CMYK000000FF

'gblock' = CMYK000000FF

'gcclipping' = CMYK000000FF

'gclipping' = CMYK000000FF

'gcstars' = CMYK000000FF

'gstars' = CMYK000000FF

'gcruntest' = CMYK000000FF

'gruntest' = CMYK000000FF

'gccontrollim' = CMYK000000FF

'gcontrollim' = CMYK000000FF

'gcerror' = CMYK000000FF

'gerror' = CMYK000000FF

'gcpredictlim' = CMYK000000FF

'gpredictlim' = CMYK000000FF

'gcpredict' = CMYK000000FF

'gpredict' = CMYK000000FF

'gcconfidence2' = CMYK000000FF

'gcconfidence' = CMYK000000FF

'gconfidence2' = CMYK000000FF

'gconfidence' = CMYK000000FF

'gcfit2' = CMYK000000FF

'gcfit' = CMYK000000FF

'gfit2' = CMYK000000FF

'gfit' = CMYK000000FF

'gcoutlier' = CMYK000000FF

'goutlier' = CMYK000000FF

'gcdata' = CMYK000000FF

'gdata' = CMYK000000FF

'greferencelines' = CMYK000000FF

'gheader' = colors('docbg')

'gconramp3cend' = CMYK000000FF

'gconramp3cneutral' = CMYK00000000

'gconramp3cstart' = CMYK000000FF

'gramp3cend' = CMYK000000FF

'gramp3cneutral' = CMYK000000FF

'gramp3cstart' = CMYK000000FF

'gconramp2cend' = CMYK000000FF

'gconramp2cstart' = CMYK000000FF

'gramp2cend' = CMYK000000FF

'gramp2cstart' = CMYK000000FF

'gtext' = CMYK000000FF

'glabel' = CMYK000000FF

'gborderlines' = CMYK000000FF

'goutlines' = CMYK000000FF

'ggrid' = CMYK000000FF

'gaxis' = CMYK000000FF

'gshadow' = CMYK000000FF

'glegend' = CMYK00000000

'gfloor' = CMYK00000000

'gwalls' = CMYK00000000

'gcdata12' = CMYK000000FF

'gcdata11' = CMYK000000FF

'gcdata10' = CMYK000000FF

'gcdata9' = CMYK000000FF

'gcdata8' = CMYK000000FF

'gcdata6' = CMYK000000FF

'gcdata7' = CMYK000000FF

'gcdata4' = CMYK000000FF

'gcdata5' = CMYK000000FF

'gcdata3' = CMYK000000FF

'gcdata2' = CMYK000000FF

'gcdata1' = CMYK000000FF

'gdata12' = CMYK000000FF

'gdata11' = CMYK000000FF

'gdata10' = CMYK000000FF

'gdata9' = CMYK000000FF

'gdata8' = CMYK000000FF

'gdata6' = CMYK000000FF

'gdata7' = CMYK000000FF

'gdata4' = CMYK000000FF

'gdata5' = CMYK000000FF

'gdata3' = CMYK000000FF

'gdata2' = CMYK000000FF

'gdata1' = CMYK000000FF;

style GraphAxisLines / ContrastColor=&color;

style GraphData1 / ContrastColor=&color Linestyle=1 markersymbol = "Circle";

style GraphData2 / ContrastColor=&color Linestyle=4 markersymbol = "Square";

style GraphData3 / ContrastColor=&color Linestyle=2 markersymbol = "Diamond";

style GraphData4 / ContrastColor=&color Linestyle=1 markersymbol = "CircleFilled";

style GraphData5 / ContrastColor=&color Linestyle=4 markersymbol = "SquareFilled";

style GraphData6 / ContrastColor=&color Linestyle=2 markersymbol = "DiamondFilled";

end;

run;

 

proc template;

define statgraph Graphics.timechange_a;

dynamic _title1 _title2 _title3 _footnote1 _footnote2 _footnote3

_xvar _xlabel _yvar1 _ylabel _group

_displayopt ;

mvar __nullrep;

begingraph / border=0 ;

/* layout lattice ;*/

/* Graph layout declaration */

layout overlay / pad=0 border = false walldisplay = none

xaxisopts = (

label = ( "Week" )

labelattrs = (color=&color weight=normal size=&__fontsz family="&__font")

tickvalueattrs = (color=&color weight=normal size=&__fontsz family="&__font")

offsetmin = 0.05

offsetmax = 0.05

linearopts = (tickvaluesequence=(start=0 end=24 increment=6))

display = _displayopt

)

yaxisopts = (

label = ( "Adjusted* Mean A1C (%) Change from Baseline")

labelattrs = (color=&color weight=normal size=&__fontsz family="&__font")

tickvalueattrs = (color=&color weight=normal size=&__fontsz family="&__font")

offsetmin = 0.05

offsetmax = 0.05

linearopts = (tickvaluesequence=(start=-2.5 end=1.5 increment=0.5) tickvalueformat=4.1 viewmin=-2.0 viewmax=0.5)

display = _displayopt )

opaque = false ;

/* line - stepped */

seriesplot x=_xvar y=_yvar1 / connectorder = xvalues display = all

lineattrs=(thickness=1px) group=_group name="seriesA";

discretelegend "seriesA" /

location=outside

across=1

valueattrs=(color=&color weight=normal size= 10pt family="&__font")

halign=left valign=bottom

backgroundcolor=white

opaque=1

border=FALSE

;

endlayout;

/* Add titles and footnotes */

entryfootnote halign=left textattrs=(color=&color weight=normal size=&__fontsz family="&__font") _footnote1 / textfitpolicy=wrap;

entryfootnote halign=left textattrs=(color=&color weight=normal size=&__fontsz family="&__font") _footnote2 / textfitpolicy=wrap;

entryfootnote halign=left textattrs=(color=&color weight=normal size=&__fontsz family="&__font") _title1 / textfitpolicy=wrap pad=(top=3px);

entryfootnote halign=left textattrs=(color=&color weight=normal size=&__fontsz family="&__font") _title2 / textfitpolicy=wrap;

entryfootnote halign=right textattrs=(color=&color weight=normal size=&__fontsz family="&__font") _footnote3 / textfitpolicy=wrap;

endgraph;

end;

run;

 

ODS LISTING STYLE=cmfm image_dpi=300 GPATH="\\client\C$\temp\test" ;

ODS GRAPHICS ON / RESET=all IMAGENAME="adhoc12353_4" IMAGEFMT=pdf WIDTH=7.7cm NOBORDER ;

/* Produce graph */

proc sgrender data=inplot

template=Graphics.timechange_a

object=CMF

objectlabel="Time plot";

DYNAMIC

_title1 =" "

_title2 =" "

_footnote1 = ""

_footnote2 = "*Variables used in adjustment: Baseline A1C and prior use of OADs"

_footnote3 = " "

_xvar = "tptno"

_yvar1 = "estimate"

_group = "atrsort"

_displayopt="all"

;

format atrsort $_trt1v.;

run;

 

 

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