function axishandle = SimplePlotWithStreamLibrary(streamInfo,... sn_hor_axis,sn_vert_axis,frame,printformat) % % Function to plot simple data in Deltares Format % % Syntax: % [handle] = SimplePlotWithStreamLibrary(streamInfo,... % sn_hor_axis,sn_vert_axis) % Input: % streamInfo Structure obtained by using streamRead % sn_hor_axis Shortname for value from streamInfo, to be plotted on % the horizontal axis % sn_vert_axis Shortname for value from streamInfo, to be plotted % on the vertical axis % frame usually frame='DeltaresFrame.mat' % printformat if printformat=1, the plot will be printed to pdf, % if printformat=2, the plot will be printed to png, % otherwise it won't be printed. % Output: % axishandle Handle to manipulate axes if necessary % i.e. 'YDir', 'reverse' to flip the y-axis % i.e. 'XScale','log' to change x-axis in log-scale % i.e. 'XAxisPosition','top' to put x-as above the % plot % Remark: % Make sure DeltaresFrame.mat and PlotLayout1by1.mat are in your % Current Directory. You can find these on the wiki-page: % http://public.deltares.nl/display/STREAM/Downloads % % Annemieke Mens % March 2010 close all clc [path file ext] = fileparts(frame); % load(frame) % read plot layout (1 plot) plotOptions = load(fullfile('PlotLayout1by1.mat')); plotOptions = plotOptions.plotOptions; % get and check frame texts [plotOptions, streamInfo] = streamGetFrameTexts(plotOptions, streamInfo, 'preview'); % % create frame and plot section [plotOptions, figureHandle] = streamPlotCreate(plotOptions, streamInfo); % % plot graph figure(1) x=streamGetValue(streamInfo, sn_hor_axis); y=streamGetValue(streamInfo, sn_vert_axis); thisPlot = plotOptions.plot(1); thisPlot = streamPlotGraph(thisPlot, 'streamInfo', streamInfo,... 'xShortname', sn_hor_axis,'yShortname', sn_vert_axis); plotOptions.plot(1) = thisPlot; axishandle = thisPlot; % % print to PDF? if printformat==1 streamPrintPdf(figureHandle, fullfile(path, [file '.pdf'])); elseif printformat==2 streamPrintPdf(figureHandle, fullfile(path, [file '.png'])); end