begin # block file for automatic inclusion function ChromDiag(TitleCmt, yMax) begin rootpath = "C:\science\vex\" descrip = " " LamLoHi = [360, 699] global LamDomain, purples, LamLoCC, JimTime global OutputDevice, SansFnt, SerifFnt NumEltsLocus = LamLoHi(2) - LamLoHi(1) + 1 global ChromCoord_x, ChromCoord_y if (ChromCoord_x(301) < 0.5) or ... (ChromCoord_y(161) < 0.5) then begin filnam = [rootpath, "ccmnmlx.31"] GetAsIs(filnam, descrip, LamLoHi, ChromCoord_x) filnam = [rootpath, "ccmnmly.31"] GetAsIs(filnam, descrip, LamLoHi, ChromCoord_y) NumEltsLocus = LamLoHi(2) - LamLoHi(1) + 1 # should be same LamLoCC = LamLoHi(1) end # end if (ChromCoord_x(301) etc. if arg(0) == 0 then begin TitleCmt = "Chromaticity Diagram" end yMin = 0.0 if arg(0) < 2 then yMax = 1.0 yMajor = int( (yMax-yMin)/0.1 + 0.001) if (yMajor/2)*2 == yMajor then yMajor = yMajor/2 gyaxis("linear", yMin, yMax, yMajor) if yMax < 0.99 then begin CloseX = { 0.0, 0.79999, 0.79999 } CloseY = { yMax, yMax, yMin } gplot( CloseX, CloseY ) end # if yMax < 0.99 title = clipstr( TitleCmt.row(1) ) gxtitlefont(SansFnt,12) gytitlefont(SansFnt,12) gxtitle("x") gytitle("y") left = 0.20 right = 0.05 below = 0.16 above = 0.10 gspace(left, right, below, above) InrAsp = (yMax - yMin)/0.8 asp = OuterAspect(InrAsp, left, right, below, above) gaspect( asp ) if purples then begin x2plot = {ChromCoord_x, ChromCoord_x(1) } y2plot = {ChromCoord_y, ChromCoord_y(1) } end else begin x2plot = ChromCoord_x y2plot = ChromCoord_y end gxtickfont(SerifFnt,14) gytickfont(SerifFnt,14) gxtick("outside") gytick("outside") gstyle("solid", 5) gplot(x2plot, y2plot) LamTicks = { 400, 450, 460} for j = 1 to 17 begin LamTicks = {LamTicks, 460+j*10} end LamTicks = {LamTicks, 650} indices = LamTicks - LamLoHi(1) +1 NumTicks = rowdim(LamTicks) ChromLocus = [ChromCoord_x, ChromCoord_y] unit = [0, 0] rot90 = {[0.0, -1.0d0],[1.0, 0.0]} LenWeLike = 0.01 # actually in chromaticity units gaddtextfont(SansFnt, 10) textco = [1.0, 0.5] gstyle("solid", 5) for j = 1 to NumTicks begin i = indices(j) if ChromLocus(i, 2) > yMax then goto SkipIt forward = ChromLocus.row(i+3) - ChromLocus.row(i-3) unitvector(forward, unit) unit = unit*rot90 tiny = unit*LenWeLike tikk = {ChromLocus.row(i), ChromLocus.row(i)+tiny} x = tikk.col(1) y = tikk.col(2) gplot(x,y) tiny = tiny/3.0 tokk = gcoord(ChromLocus(i,1)-tiny(1),... ChromLocus(i,2)-tiny(2) ) text = clipstr(ntoa( LamTicks(j) )) if( LamTicks(j) > 520 ) then begin textco = [0.0, 0.5] unit = -unit end #end the little if gaddtext(text, tokk, textco, unit); label SkipIt end # end for = 1 to NumTicks gaddtextfont(SerifFnt, 15) if OutputDevice == "ILLUSTRATOR" then begin gaddtextfont(SerifFnt, 15) end mid_title = gcoord(0.4, yMax) gaddtext(title, mid_title, [0.5, 0.0]); gaddtextfont(SansFnt, 9) gaddtext(JimTime, [1.0,1.0], [1.0, 1.0]); # asp is already defined # Notice that the spectrum locus is plotted based on # the available data, independent of what LamDomain is. NumCmt = rowdim(TitleCmt) - 1 if NumCmt > 0 then begin ytop = 0.65 face = SansFnt size = 12 for jCmt = 1 to NumCmt begin texto = clipstr( TitleCmt.row(jCmt+1) ) comment(ytop, asp, face, size, texto) end # for jCmt end # if NumCmt > 0 etc gupdate end # end function ChromDiag() end # end blocking for automatic inclusion