📄 plot_efield.pro
字号:
contour_jump:; 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 b&w contour plot to file ' + ps_cont_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 b&w contour plot to the screen...' endelse 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, xsize=x_device, ysize=ywin_device, /LANDSCAPE 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, xsize=x_win_ccon, ysize=ywin_ccon, RETAIN=2 ccontour_i = 0 ccontour_jump:; 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; Load in the RAINBOW color table loadct, 13 contour, ez+min(ez), z, r, thick=2, /xs, /ys, nlevels=40, xtitle=x_label, ytitle=y_label, $ /fill; Load in the B-W LINEAR color table loadct, 0 contour, ez+min(ez), z, r, thick=2, /xs, /ys, nlevels=40, xtitle=x_label, ytitle=y_label, $ /fill, /NoErase, /NoData; 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, $ xsize=x_device, ysize=ywin_device, /LANDSCAPE 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, xsize=x_win_ccon, ysize=ywin_ccon, RETAIN=2 surface_i = 0 surface_jump:; 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; xAng = 75; zAng = 10;; Load in the RAINBOW color table loadct, 13 surface, ez, z, r, thick=2, /xs, /ys, ax=xAng, az=zAng, $ shades=ez_color, xtitle=x_label, ytitle=y_label, ztitle=z_label; Load in the B-W LINEAR color table loadct, 0 surface, ez, z, r, thick=2, /xs, /ys, ax=xAng, az=zAng, $ shades=ez_color, xtitle=x_label, ytitle=y_label, ztitle=z_label, $ /NoData, /NoErase; 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, $ xsize=x_device, ysize=ywin_device, /LANDSCAPE 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, xsize=x_win_ccon, ysize=ywin_ccon, RETAIN=2 three_tiered_i = 0 three_tiered_jump:; 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; Load in the STD GAMMA-II color table loadct, 5 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, $ xsize=x_device, ysize=ywin_device, /LANDSCAPE 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.; *****************************************************************; *****************************************************************; 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) efield_line = ez(*,r_row) print, ' ' print, 'r_row = ', r_row help, efield_line; *****************************************************************; Next, save the lineout to an IDL .dat file for later use. efield_x = z save, efield_x, efield_line, filename = lineout_fileif (doLineout eq 1) then begin; 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, RETAIN=2 lineout_i = 0 lineout_jump:; 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 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 device,decomposed=0 print, ' ' print, 'Rendering the 2D lineout plot for the screen...' endelse plot, z, efield_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, xsize=12.0, ysize=10.0 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -