function plot_multi, time, data, yname, plot_title, name, y_low, y_up ;---------- ;Help ;---------- ;Function for plotting and exporting to .PNG for multiple data. Unlike overview_plot function, data, yname and ;y_border are represented by matrix. At least 3 plots must be combined using this function (if you need less, ;use overview_plot.pro). ;PARAMETERS: ;1. time x-axis (common) ;2. data y-axis (matrix) ;3. yname names of y axes (from above) (matrix) ;4. plot_title title of the plot ;5. name name of the .png file ;6. y_low matrix of lower y_border ;7. y_up matrix of upper y_border ;---------- ;Variable preparation ;---------- time = double(time) data = double(data) yname = string(yname) plot_title = string(plot_title) y_low = double(y_low) y_up = double(y_up) N_plots = long(n_elements(yname)) ;---------- ;Plotting and exporting to PNG ;---------- d_y = float(0.9d/N_plots) ;relative vertical difference in .png file for plots set_plot, 'z' device, set_pixel_depth = 24, decomposed = 0, z_buffering = 0 loadct,39 !P.color=0 !P.background=255 !P.multi = [0,1,N_plots,0] !P.position =[0.05, 0.95 - 1*d_y, 0.95, 0.95 - 0*d_y] ;uppermost plot plot, time, data[0,*], xrange=[0,30], yrange=[y_low[0],y_up[0]], ytitle=yname[0], title=plot_title for i=1, N_plots-2 do begin ;middle plots !P.position =[0.05, 0.95 - (i+1)*d_y, 0.95, 0.95 - i*d_y] plot, time, data[i,*], xrange=[0,30], yrange=[y_low[i],y_up[i]], ytitle=yname[i] endfor !P.position =[0.05, 0.95 - N_plots*d_y, 0.95, 0.95 - (N_plots-1)*d_y] ;lowermost plot plot, time, data[N_plots-1,*], xtitle = 'Time [ms]', xrange=[0,30], yrange=[y_low[N_plots-1],y_up[N_plots-1]], ytitle=yname[N_plots-1] write_png, name+'.png', tvrd(true=1) device, /close ;set_plot, 'x' ;---------- ;Finalisation ;---------- !P.multi = 0 ;settings set to default (otherwise ostandard plotting would be deformed). !P.Position=[0,0,0,0] end