PlotID
PlotID
is a toolkit that labels your plots and figures and copies all associated data (research data, plotting script, user-functions and a copy of the figure) to the desired location.
This version of PlotID
is build for MATLAB
.
PlotID
provides two core functions TagPlot and Publish which are described in Detail below.
Feel free to give feedback and feature requests or to take part in the development process.
Quick User Guide
PlotID.TagPlot()
[figs, IDs] = TagPlot(figs, options)
TagPlot adds IDs to figures
The ID is placed visual on the figure window and as Tag (property of figure)
TagPlot can tag multiple figures at once. If a single Plot is taged IDs is a char, otherwise it is a cell array of chars
detailed description
options
you find the options for TagPlot below. The data is in curled braces and the default value follows the equal sign.
- ProjectID {mustBeText}= ''
- Fontsize {mustBeInteger} = 8
- Location {mustBeText} = 'east'
- Position {mustBeVector} = [1,0.4]
- Rotation {mustBeInteger} = 0
options.ProjectID is the project number (string or char), if empty the ID from the config file is used The ID is placed on the 'east' of the figure per default, if you want it somwhere else, use the 'Location' option. 'north','east','south','west' are predefined, otherwise use the 'custom' option and provide the desired 'Position' (relative to your x- and y-axis limits)
-
UNIX Time in seconds as HEX
This is used by default due to its simplicity and it is human readable. -
random UUID from Java 128 bit.
Static factory to retrieve a type 4 (pseudo randomly generated) UUID. The UUID is generated using a cryptographically strong pseudo random number generator.
friendlyID()
[IDf,PrjID, Str] = friendlyID(ID)
FriendlyID Changes the Hex Number to a human friendly datetime and dateStr. IDf returns the ID as DateTime Object, PrjID returns the ProjectID, Str returns the timestamp as String.
This only works with ID method 1.
PlotID.Publish()
Publish(DataPaths, ID, figure, options)
Publishes saves plot, data and measuring script
Location sets the storage location. 'local' sets the storage location to the current folder (an export folder will be created), 'server' is a remote path, that is defined in the config file. Two Methods are implemented 'individual' stores the data for each plot while 'centralized' uses a data folder and uses reference links to the original data (hdf5 only). ParentFolder is the folder Name where the exported data is stored if a path is used, PlotId will use this path a storagePath
detailed description
options
you find the options for publish below. The data is in curled braces and the default value follows the equal sign.
- Location {mustBeMember(options.Location ,{'local','server','manual','CI-Test'})} = 'local'
'local' creates the folder in your current working path, 'server' on a remote path that needs to be specified in the config file. 'manual' opens an UI Window where the path must be choosen, 'CI-Test' is for CI testing only. - Method {mustBeMember(options.Method ,{'individual','centraliced'})} = 'individual'
'individual' each folder contains the assigned data files. (recommended for small file sizes and for sharing). 'centralized' one central data folder is used for saving the research data files, the subfolders contain linked hdf5-files (if hdf5 is used). 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. - ParentFolder {mustBeText} = 'export'
An individual folden name can be set with this option. - CopyUserFCN {mustBeNumericOrLogical} = true
All user functions that are used by script that calls publish will be exported per default as well. Set this to false (not recommended) to prevent this. - CSV {mustBeNumericOrLogical} = false
An overview of all published plots and the associated data will be stored in a csv file.
createFileCopy ()
[] = createFileCopy(filePaths,folderName,storPath,ID,type)
Creates a copy of the files (can be used for multiple paths in a cell array). folderName is the name of the exporting folder
createLinkedHDF ()
[status] = createLinkedHDF5(SourceFile,TargetPath,ID)
createLinkedHDF5 creates a HDF file that references the Sourcefile. TargetPath is the storage location, ID the foldername, Status returns true if the function was sucessfull.
fileCompare()
[status, id] = fileCompare(filename,fileList)
fileCompare checks if file1 is (binary) identical to a file in filelist, it returns a sttus and the id of the identical file. The function uses the windows system function fc or the unix function diff (not tested).
removePltIdFiles()
[fListClean] = removePltIdFiles(fList)
removePltIdFiles removes functions that are part of PlotID out of flist.
How to use the .config file
The config file is a JSON-File. At the moment two options can be set in the config file, the project ID and the remote Path.
{
"ProjectID": "your ProjectID",
"ServerPath": "\\\\Server\\Folder1\\Subfolder"
}