load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" begin ; Set up the arrays to plot. num_elems = 128 xvals = ispan(1, num_elems, 1) yvals = new(dimsizes(xvals), double) ymin = 1.0D-15 ymax = 1.0D-8 i_start = 0 i_end = num_elems-2 yvals(i_start:i_end:2) = ymax i_start = 1 i_end = num_elems-1 yvals(i_start:i_end:2) = ymin ; Set up plot resources. res = True res@trXLog = True ; Use log scale for x axis. res@trYLog = True ; Use log scale for y axis. res@trXMinF = min(xvals)*1.0D-1 ; Set the minimum x-axis value. res@trXMaxF = max(xvals)*1.0D+1 ; Set the maximum x-axis value. res@trYMinF = min(yvals)*1.0D-1 ; Set the minimum y-axis value. res@trYMaxF = max(yvals)*1.0D+1 ; Set the maximum y-axis value. res@tiMainString \ ; Set the plot title. = "ymin = " + ymin + "; ymax = " + ymax ; Generate the plot. wks_type1 = "png" wks_type1@wkWidth = 1000 ; Set width of png file. wks_type1@wkHeight = 1000 ; Set height of png file. filename = "log_plot_ymax_" + ymax ; Set name of png file. wks_png = gsn_open_wks(wks_type1, "log_plot_ymin_" + ymin) ; Create workstation in which to generate a png file. plot_png = gsn_csm_xy(wks_png, xvals, yvals, res) ; Generate plot as a png file. end