⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plot_h5_3d_noscreenplot.pro

📁 pic 模拟程序!面向对象
💻 PRO
📖 第 1 页 / 共 2 页
字号:
  print, 'min_x2  = ' , min(r)  print, 'max_x2  = ' , max(r)  contour, ez, z, r, thick=2, /xs, /ys, nlevels=8, xtitle=x_label, ytitle=y_label; rendering to screen is done.  here we render to ps file  if (contour_i eq 0) then begin    contour_i = 1 ;   set_plot, 'PS', /copy    device, filename = ps_cont_file    goto, contour_jump    endif; here rendering to file is done.  set back to screen defaults  if (contour_i eq 1) then begin    device, /close    ;set_plot, 'X'    !p.font=-1    !p.charsize=2.0    ;device,decomposed=0  endifendif; *****************************************************************; Loop for rendering 2-D color contour plot on screen and to a file; *****************************************************************if (doColorCon eq 1) then begin; Get a new window  window_number = !d.window + 1  print, ' '  print, 'Color contour plot will appear in window ', window_number  ;window, window_number  ccontour_i = 0  ccontour_jump:; Load in the STD GAMMA-II color table  loadct, 5; Specify a font that looks great for printing (crappy on screen),;   or else one that looks OK on the screen (also OK for printing).  if (!d.name eq 'PS') then begin    !p.font=1    !p.charsize=1.6    !p.charthick=1.5    if ( ScaleFlag eq 1 ) then begin      x_label = q1_label + ' (c/!9w!3!d0!N)'      y_label = q2_label + ' (c/!9w!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q1_label + ' (c/!9w!3!dp!N)'      y_label = q2_label + ' (c/!9w!3!dp!N)'    endif else if ( ScaleFlag eq 3 ) then begin      x_label = q1_label + ' / !9l!3!dp'      y_label = q2_label + ' / !9l!3!dp'     endif     print, ' '    print, 'Writing the 2D color contour plot to file ' + ps_ccon_file  endif else begin    !p.font=-1    !p.charsize=2.0    if ( ScaleFlag eq 1 ) then begin      x_label = q1_label + ' (c/!4x!3!d0!N)'      y_label = q2_label + ' (c/!4x!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q1_label + ' (c/!4x!3!dp!N)'      y_label = q2_label + ' (c/!4x!3!dp!N)'    endif else if ( ScaleFlag eq 3 ) then begin      x_label = q1_label + ' / !4k!3!dp'      y_label = q2_label + ' / !4k!3!dp'     endif     ;device,decomposed=0    print, ' '    print, 'Rendering the 2D color contour plot to the screen...'  endelse  contour, ez, z, r, thick=2, /xs, /ys, nlevels=100, xtitle=x_label, ytitle=y_label, /fill; rendering to screen is done.  here we render to ps file  if (ccontour_i eq 0) then begin    ccontour_i = 1    ;set_plot, 'PS', /copy    device, filename = ps_ccon_file, /color, bits_per_pixel=8    goto, ccontour_jump    endif; here rendering to file is done.  set back to screen defaults  if (ccontour_i eq 1) then begin    device, /close    ;set_plot, 'X'    !p.font=-1    !p.charsize=2.0    ;device,decomposed=0  endifendif; *****************************************************************; Loop for rendering color surface plot on screen and to a file; *****************************************************************if (doSurface eq 1) then begin; Get a new window  window_number = !d.window + 1  print, ' '  print, 'Color surface plot will appear in window ', window_number  ;window, window_number  surface_i = 0  surface_jump:; Load in the STD GAMMA-II color table  loadct, 5; Specify a font that looks great for printing (crappy on screen),;   or else one that looks OK on the screen (also OK for printing).  if (!d.name eq 'PS') then begin    !p.font=1    !p.charsize=1.6    !p.charthick=1.5    if ( ScaleFlag eq 1 ) then begin      x_label = q1_label + ' (c/!9w!3!d0!N)'      y_label = q2_label + ' (c/!9w!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q1_label + ' (c/!9w!3!dp!N)'      y_label = q2_label + ' (c/!9w!3!dp!N)'    endif else if ( ScaleFlag eq 3 ) then begin      x_label = q1_label + ' / !9l!3!dp'      y_label = q2_label + ' / !9l!3!dp'     endif     print, ' '    print, 'Writing the color surface plot to file ' + ps_surf_file  endif else begin    !p.font=-1    !p.charsize=2.0     if ( ScaleFlag eq 1 ) then begin      x_label = q1_label + ' (c/!4x!3!d0!N)'      y_label = q2_label + ' (c/!4x!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q1_label + ' (c/!4x!3!dp!N)'      y_label = q2_label + ' (c/!4x!3!dp!N)'    endif else if ( ScaleFlag eq 3 ) then begin      x_label = q1_label + ' / !4k!3!dp'      y_label = q2_label + ' / !4k!3!dp'     endif     ;device,decomposed=0    print, ' '    print, 'Rendering the color surface plot to the screen...'  endelse;  xAng = 90;;  zAng = 0;  xAng = 50;  zAng = 30;  surface, ez, z, r, thick=2, /xs, /ys, ax=xAng, az=zAng, shades=ez_color, $           xtitle=x_label, ytitle=y_label, ztitle=z_label; rendering to screen is done.  here we render to ps file  if (surface_i eq 0) then begin    surface_i = 1    ;set_plot, 'PS', /copy    device, filename = ps_surf_file, /color, bits_per_pixel=8    goto, surface_jump    endif; here rendering to file is done.  set back to screen defaults  if (surface_i eq 1) then begin    device, /close    ;set_plot, 'X'    !p.font=-1    !p.charsize=2.0    ;device,decomposed=0  endifendif; *****************************************************************; Repeat simple plot loop for generating fancy 3-tiered plot.; *****************************************************************if (doShow3D eq 1) then begin; Get a new window  window_number = !d.window + 1  print, ' '  print, 'Three-tiered plot will appear in window ', window_number  ;window, window_number  three_tiered_i = 0  three_tiered_jump:; Load in the STD GAMMA-II color table  loadct, 5; Specify a font that looks great for printing (crappy on screen),;   or else one that looks OK on the screen (also OK for printing).  if (!d.name eq 'PS') then begin    !p.font=1    !p.charsize=1.6    !p.charthick=1.5    if ( ScaleFlag eq 1 ) then begin      x_label = q1_label + ' (c/!9w!3!d0!N)'      y_label = q2_label + ' (c/!9w!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q1_label + ' (c/!9w!3!dp!N)'      y_label = q2_label + ' (c/!9w!3!dp!N)'    endif else if ( ScaleFlag eq 3 ) then begin      x_label = q1_label + ' / !9l!3!dp'      y_label = q2_label + ' / !9l!3!dp'     endif     print, ' '    print, 'Writing 3-tiered surface/contour plot to file ' + ps_tier_file  endif else begin    !p.font=-1    !p.charsize=2.0    if ( ScaleFlag eq 1 ) then begin      x_label = q1_label + ' (c/!4x!3!d0!N)'      y_label = q2_label + ' (c/!4x!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q1_label + ' (c/!4x!3!dp!N)'      y_label = q2_label + ' (c/!4x!3!dp!N)'    endif else if ( ScaleFlag eq 3 ) then begin      x_label = q1_label + ' / !4k!3!dp'      y_label = q2_label + ' / !4k!3!dp'     endif     ;device,decomposed=0    print, ' '    print, 'Rendering the 3-tiered surface/contour plot to the screen...'  endelse  surface_struct = { shades:ez_color, xtitle:x_label, ytitle:y_label, ztitle:z_label, $                     xstyle:1, ystyle:1, zstyle:1}  contour_struct = { nlevels:6, xstyle:1, ystyle:1, zstyle:1}  show3, ez, z, r, e_surface=surface_struct, e_contour=contour_struct; rendering to screen is done.  here we render to ps file  if (three_tiered_i eq 0) then begin    three_tiered_i = 1    ;set_plot, 'PS', /copy    device, filename = ps_tier_file, /color, bits_per_pixel=8    goto, three_tiered_jump    endif; here rendering to file is done.  set back to screen defaults  if (three_tiered_i eq 1) then begin    device, /close    ;set_plot, 'X'    !p.font=-1    !p.charsize=2.0    ;device,decomposed=0  endifendif; *****************************************************************; Repeat simple plot loop for generating 2-D lineout plots.; *****************************************************************if (doLineout eq 1) then begin; First, grab the desired row of data (here it is along the r=0 axis); Specify which row (fixed value of r) of grid points you will;   want to use for the lineout plot	  r_row = fix(nr*r_factor)  ez_line = ez(*,r_row)openw,3,'lineoutData.txt'openw,2,'lineoutData2.txt'printf, 3, z, ez_linehelp, zhelp, ez_linenewezline = [[z],[ez_line]]print ,'help'print ,'help'print ,'help'print ,'help'help, newezlineez_line_trans = transpose(newezline)printf, 2, ez_line_trans print, 'nr ',nrprint, 'actual line out position ',(x2max-x2min)/nr * r_row  print, ' '  print, 'r_row = ', r_row  help, ez_line; Put the plot into a new window  window_number = !d.window + 1  print, ' '  print, 'Line plot will appear in window ', window_number  ;window, window_number  lineout_i = 0  lineout_jump:; Load in the STD GAMMA-II color table  loadct, 5; Create a 2D array that specifies the color for each grid point  ez_color=ez-min(ez)  ez_color=ez_color/max(ez_color)  ez_color=ez_color*255.; Specify a font that looks great for printing (crappy on screen),;   or else one that looks OK on the screen (also OK for printing).  if (!d.name eq 'PS') then begin    !p.font=1    !p.charsize=1.6    !p.charthick=1.5    if ( ScaleFlag eq 1 ) then begin      x_label = q1_label + ' (c/!9w!3!d0!N)'      y_label = q2_label + ' (c/!9w!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q1_label + ' (c/!9w!3!dp!N)'      y_label = q2_label + ' (c/!9w!3!dp!N)'    endif else if ( ScaleFlag eq 3 ) then begin      x_label = q1_label + ' / !9l!3!dp'      y_label = q2_label + ' / !9l!3!dp'     endif else if (ScaleFlag eq 4) then begin     ; NGD case, no scaling but set axis label for NGD      x_label = '!3' + x1Label + ' (m)'      y_label = '!3' + x2Label + ' (m)'      z_label = '!3' + dataLabel    endif     print, ' '    print, 'Writing the 2D lineout plot to file ' + ps_line_file  endif else begin    !p.font=-1    !p.charsize=2.0    if ( ScaleFlag eq 1 ) then begin      x_label = q1_label + ' (c/!4x!3!d0!N)'      y_label = q2_label + ' (c/!4x!3!d0!N)'    endif else if ( ScaleFlag eq 2 ) then begin      x_label = q1_label + ' (c/!4x!3!dp!N)'      y_label = q2_label + ' (c/!4x!3!dp!N)'    endif else if ( ScaleFlag eq 3 ) then begin      x_label = q1_label + ' / !4k!3!dp'      y_label = q2_label + ' / !4k!3!dp'     endif else if (ScaleFlag eq 4) then begin; NGD case, no scaling but set axis label for NGD      x_label = '!3' + x1Label + ' (m)'      y_label = '!3' + x2Label + ' (m)'      z_label = '!3' + dataLabel    endif     ;device,decomposed=0    print, ' '    print, 'Rendering the 2D lineout plot for the screen...'  endelse  plot, z, ez_line, thick=2, /xs, xtitle=x_label, ytitle=z_label, xrange=[x1min,x1max]; rendering to screen is done.  here we render to ps file  if (lineout_i eq 0) then begin    lineout_i = 1    ;set_plot, 'PS', /copy    device, filename = ps_line_file, /color, bits_per_pixel=8    goto, lineout_jump    endif; here rendering to file is done.  set back to screen defaults  if (lineout_i eq 1) then begin    device, /close    ;set_plot, 'X'    !p.font=-1    !p.charsize=2.0    ;device,decomposed=0  endifendif; *****************************************************************; Final clean-up; *****************************************************************; Stop here so that all variables will still be in scope.;stop; All done.end; *****************************************************************; checkComponent procedure; *****************************************************************pro checkComponent, componentLabel, component  CASE ComponentLabel OF    ; if componentLabel is 'x'     'x': print, "Setting "+component+" label to "+ComponentLabel    ; 'y'    'y': print, "Setting "+component+" label to "+ComponentLabel    ; 'r'    'r': print, "Setting "+component+" label to "+ComponentLabel                             ; 'z'                    'z': print, "Setting "+component+" label to "+ComponentLabel    ; no matches => print warning  ELSE: print, "WARNING: Component label is not in the set (x, y, r, z)!?"  ENDCASEend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -