Most journals recommend vector artwork rather than raster, but I've always leaned toward high-resolution rasters because IDL tends to add artifacts to EPS and PDF output. Using IDL 8.5, I decided to try again and found PDF output doesn't seem to have the same artifacts on my graphics, but it does have very large white space margins I can't get rid of. In the following example I'm trying to make a graphic to a specific size recommended by a journal (95 x 115 mm) with mixed results using different output formats. The example just draws a solid rectangle frame around the graphic with a color bar in the center. PDF output doesn't fill my 95 x 115 mm page size and has about a third of the graphic as white space. EPS output fills the size correctly, but has slashes on the color bar swatches (I've seen this artifact for years and it has crept into some of my publications). PNG output looks the best, but is raster rather than vector.
Are there recommendation for making graphics to publication specifications (i.e. size, font size, line weights) when vector formats seem to be hit and miss?
---------------------------------------------------------
pro pdf_output_example
mm2inches = 0.0393701
mm2point = 2.83464567
screenDPI = 72
figWidthPx = 95 * mm2inches * screenDPI ;mm->px
figWidthCm = 95 * 0.1 ;mm->cm
figHeightPx = 115 * mm2inches * screenDPI ;mm->px
figHeightCm = 115 * 0.1 ;mm->cm
w = window(DIMENSIONS=[figWidthPx,figHeightPx], BUFFER=1)
frame = [0,0,1,1]
;draw box around the window
p = POLYLINE([frame[0], frame[2],frame[2],frame[0],frame[0]],$
[frame[3],frame[3],frame[1],frame[1],frame[3]], /NORMAL)
;create colorbar
rgb = COLORTABLE(70, NCOLORS = 10)
cb1 = COLORBAR(POSITION=[0.2, 0.3, 0.8, 0.4], RGB_TABLE=rgb, BORDER=1)
;creates a PDF file with large white margins
w.save, '~/Desktop/publication_vector_output.pdf',/CENTIMETERS,page_size=[figWidthCm, figHeightCm], xmargin=0, ymargin=0
;creates an EPS file with artifacts in the colorbar (boxes are drawn as two triangles rather than one rectangle)
w.save, '~/Desktop/publication_vector_output.eps',/CENTIMETERS,width=figWidthCm
;creates a high-resolution raster of the correct size
w.save, '~/Desktop/publication_vector_output.png',resolution=600
w.close
end
|