    pro setup_graphics,img_base,img_file,postscript=postscript,cols=cols,rows=rows, $
                       charsize=charsize,charthick=charthick,thick=thick, $
                       COLORTABLE=colortable

    COMMON misc,TRUE,FALSE
    COMMON graphics,USE_Z_BUFFER,TC,XS,YS
    COMMON graphic_parms,scale,bottom,ncolors
    COMMON symbols,plot,asterisk,dot,diamond,triangle,square,exx
    COMMON linestyles,solid,dotted,dashed,dashdot,dashdotdot,longdash

    TRUE=1 & FALSE=0
;    USE_Z_BUFFER=FALSE
;    USE_Z_BUFFER=TRUE

    if(NOT KEYWORD_SET(COLORTABLE)) then colortable=39
;
; *** Initialize symbols
;
    plus=1 & asterisk=2 & dot=3 & diamond=4
    triangle=5 & square=6 & exx=7
;
; *** Initialize linestyles
;
    solid=0 & dotted=1 & dashed=2 & dashdot=3 & dashdotdot=4 & longdash=5
;
; *** Setup default parameters
;
    if(not KEYWORD_SET(postscript)) then postscript=FALSE

    if(not KEYWORD_SET(charsize)) then charsize=1
    if(not KEYWORD_SET(charthick)) then charthick=1
    if(not KEYWORD_SET(thick)) then thick=1

    if(not KEYWORD_SET(cols)) then cols=1
    if(not KEYWORD_SET(rows)) then rows=1
;
; *** Set up graphics
;
    xsize = (cols*xs)/100
    ysize = (rows*ys)/100
    if(postscript) then begin
        img_file = img_base + '.ps'
        set_plot, 'ps'
        device,/encapsul,/portrait,/color,xsize=xsize,ysize=ysize,/inches
        device,filename=img_file
        loadct,colortable
        !P.background = 1
        charthick=2
        !P.font=1
        thick=5
        DEVICE, SET_FONT='Helvetica Bold Italic', /TT_FONT
        charsize=1.75
        goto,next
    endif

    if(USE_Z_BUFFER eq TRUE) then begin
        set_plot,'Z',/COPY
        device,set_resolution=[xs*cols,ys*rows]
        loadct,colortable
        charsize=1.75
        !P.background = 255
    endif else begin
        set_plot,'x'
        set_device,TC
        loadct,colortable
        charsize=1.75
        !P.background = 255
        window,4,xs=xs*cols,ys=ys*rows
    endelse
    img_file = img_base + '.png'
next:
    !P.background=255
    !P.multi = [0,cols,rows]

    return
    end
