📄 plot_fft_1d.pro
字号:
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 print, ' ' print, 'Writing the integrated spectrum plot to file ' + ps_line_file endif else begin !p.font=-1 !p.charsize=2.0 device,decomposed=0 print, ' ' print, 'Rendering the integrated spectrum plot for the screen...' endelseif (log_plot_flag eq 0) then begin plot, lambda, psd_1d, thick=2, /xs, xtitle=x_label, ytitle=z_label, xrange=[x1min,x1max]endif else begin plot_io, lambda, psd_1d, thick=2, /xs, xtitle=x_label, ytitle=z_label, xrange=[x1min,x1max]endelse; 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 endifendifstop; *****************************************************************; Create a 2-D color map appropriate for the surface; *****************************************************************; Create a 2D array that specifies the color for each grid pointif (log_plot_flag eq 0) then begin psd_color=psd-min(psd)endif else begin psd_log = alog(psd) psd_color=psd_log-min(psd_log)endelsepsd_color=psd_color/max(psd_color)psd_color=psd_color*255.; *****************************************************************; 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 + ' (!9w!3!d0!N/c)' y_label = q2_label + ' (!9w!3!d0!N/c)' endif else if ( ScaleFlag eq 2 ) then begin x_label = q1_label + ' (!9w!3!dp!N/c)' y_label = q2_label + ' (!9w!3!dp!N/c)' 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 + ' (!4x!3!d0!N/c)' y_label = q2_label + ' (!4x!3!d0!N/c)' endif else if ( ScaleFlag eq 2 ) then begin x_label = q1_label + ' (!4x!3!dp!N/c)' y_label = q2_label + ' (!4x!3!dp!N/c)' endif device,decomposed=0 print, ' ' print, 'Rendering the 2D color contour plot to the screen...' endelseif (log_plot_flag eq 0) then begin contour, psd, z, r, thick=2, /xs, /ys, nlevels=100, xtitle=x_label, ytitle=y_label, /fillendif else begin contour, psd_log, z, r, thick=2, /xs, /ys, nlevels=100, xtitle=x_label, ytitle=y_label, /fillendelse; 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 2-D B&W contour plot on screen and to a file; *****************************************************************if (doContour eq 1) then begin; Get a new window window_number = !d.window + 1 print, ' ' print, 'Contour plot will appear in window ', window_number window, window_number contour_i = 0 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 + ' (!9w!3!d0!N/c)' y_label = q2_label + ' (!9w!3!d0!N/c)' endif else if ( ScaleFlag eq 2 ) then begin x_label = q1_label + ' (!9w!3!dp!N/c)' y_label = q2_label + ' (!9w!3!dp!N/c)' 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 + ' (!4x!3!d0!N/c)' y_label = q2_label + ' (!4x!3!d0!N/c)' endif else if ( ScaleFlag eq 2 ) then begin x_label = q1_label + ' (!4x!3!dp!N/c)' y_label = q2_label + ' (!4x!3!dp!N/c)' endif device,decomposed=0 print, ' ' print, 'Rendering the 2D b&w contour plot to the screen...' endelse print, 'min_x1 = ' , min(z) print, 'max_x1 = ' , max(z) print, 'min_x2 = ' , min(r) print, 'max_x2 = ' , max(r)if (log_plot_flag eq 0) then begin contour, psd, z, r, thick=2, /xs, /ys, nlevels=4, xtitle=x_label, ytitle=y_labelendif else begin contour, psd_log, z, r, thick=2, /xs, /ys, nlevels=4, xtitle=x_label, ytitle=y_labelendelse; 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 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 + ' (!9w!3!d0!N/c)' y_label = q2_label + ' (!9w!3!d0!N/c)' endif else if ( ScaleFlag eq 2 ) then begin x_label = q1_label + ' (!9w!3!dp!N/c)' y_label = q2_label + ' (!9w!3!dp!N/c)' 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 + ' (!4x!3!d0!N/c)' y_label = q2_label + ' (!4x!3!d0!N/c)' endif else if ( ScaleFlag eq 2 ) then begin x_label = q1_label + ' (!4x!3!dp!N/c)' y_label = q2_label + ' (!4x!3!dp!N/c)' endif device,decomposed=0 print, ' ' print, 'Rendering the color surface plot to the screen...' endelse; xAng = 90;; zAng = 0; xAng = 50; zAng = 30;if (log_plot_flag eq 0) then begin surface, psd, z, r, thick=2, /xs, /ys, ax=xAng, az=zAng, shades=psd_color, $ xtitle=x_label, ytitle=y_label, ztitle=z_labelendif else begin surface, psd, z, r, thick=2, /xs, /ys, ax=xAng, az=zAng, shades=psd_color, $ xtitle=x_label, ytitle=y_label, ztitle=z_label, /zlogendelse; 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 + ' (!9w!3!d0!N/c)' y_label = q2_label + ' (!9w!3!d0!N/c)' endif else if ( ScaleFlag eq 2 ) then begin x_label = q1_label + ' (!9w!3!dp!N/c)' y_label = q2_label + ' (!9w!3!dp!N/c)' 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 + ' (!4x!3!d0!N/c)' y_label = q2_label + ' (!4x!3!d0!N/c)' endif else if ( ScaleFlag eq 2 ) then begin x_label = q1_label + ' (!4x!3!dp!N/c)' y_label = q2_label + ' (!4x!3!dp!N/c)' endif device,decomposed=0 print, ' ' print, 'Rendering the 3-tiered surface/contour plot to the screen...' endelse surface_struct = { shades:psd_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, psd, 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; *****************************************************************; 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 + -