Skip to content
Snippets Groups Projects
Select Git revision
  • 20dd523e00472955000ce62e80a469c4ce6e8c74
  • master default protected
  • gitkeep
  • development protected
  • QRCode/Size
  • sync-link-hdf5
  • feature/multi-scriptpaths
  • dev/plotID_Class
  • doc
  • V1.0.1
  • V1.0
  • V1.0-RC1
  • V0.2.2
  • V0.2.1
  • V0.2-RC1
  • V0.1
16 results

PlotID_centralized.m

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    PlotID_centralized.m 1.23 KiB
    clear; close all; clc;
    %%  multiple plots from the same data-set (centralized method)
    % A central data folder is used for saving the research data files, the
    % subfolders contain linked hdf5-files (if hdf5 is used) otherwise the data
    % will only be in the data folder.
    
    % This is recommended, if many plots are made from the same data set.
    % Attention, the linked HDF5 will not work when a subfolder was moved or the data
    % folder was deleted
    
    [x, y, datapath] = createExampleData('hdf');
    scriptPath = [mfilename('fullpath'),'.m'];
    
    fig1 = figure;
    plot(x,y,'-k'); 
    [fig1, ID] = PlotID.TagPlot(fig1);
    
    PlotID.Publish(datapath,scriptPath, fig1, 'Method','centralized')
    
    % Second figure based on the same data set as fig1
    fig2 = figure;
    plot(x.^2,y,'-r'); 
    [fig2, ID] = PlotID.TagPlot(fig2);
    
    PlotID.Publish(datapath,scriptPath, fig2, 'Method','centralized')
    
    %% Note:
    % If you rerun this script PlotId will tell you that a identical named (but
    % not binary idetical) file exists in the data folder. This is intended,
    % due protect the user from overwritting non (binary) identical files. The
    % reason for this is that two hdf files with the same data are not idetical
    % when recreated (see line 11). Usually you would use an existing file
    % without changing it.