Skip to content
Snippets Groups Projects
Commit ee6e488e authored by Mayr, Hannes's avatar Mayr, Hannes
Browse files

Small documentation improvements.

parent c6982273
Branches
Tags
2 merge requests!19merge dev for new release v.0.1.2,!17Fallback engine implementation
Pipeline #773011 passed
......@@ -2,14 +2,13 @@
"""
Example workflow for integrating plotID.
With tagplot an ID can be generated an printed on the plot. To export the plot
along with the corresponding research data and the plot generating script use
the function publish.
With tagplot() an ID can be generated and printed on the plot. To export the
plot along with the corresponding research data and the plot generating
script use the function publish().
"""
# %% Import modules
import numpy as np
# import h5py as h5
import matplotlib.pyplot as plt
from plotid.tagplot import tagplot
from plotid.publish import publish
......@@ -17,15 +16,12 @@ from plotid.publish import publish
# %% Set Project ID
PROJECT_ID = "MR04_"
# %% Choose Plot engine
PLOT_ENGINE = "image"
# %% Create sample data
x = np.linspace(0, 10, 100)
y = np.random.rand(100) + 2
y_2 = np.sin(x) + 2
# %% Create figures
# %% Create sample figures
# 1. figure
IMG1 = 'image1.png'
......@@ -47,16 +43,18 @@ plt.savefig(IMG2)
FIGS_AS_LIST = [FIG1, FIG2]
IMGS_AS_LIST = [IMG1, IMG2]
# [TAGGED_FIGS, ID] = tagplot(IMGS_AS_LIST, PLOT_ENGINE, prefix=PROJECT_ID,
# id_method='random', location='west')
# Example for how to use tagplot with matplotlib figures
[TAGGED_FIGS, ID] = tagplot('FIGS_AS_LIST', 'matplotlib', prefix=PROJECT_ID,
id_method='random', location='west')
print(type(TAGGED_FIGS[0]))
id_method='time', location='west')
# Example for how to use tagplot with image files
# [TAGGED_FIGS, ID] = tagplot(IMGS_AS_LIST, 'image', prefix=PROJECT_ID,
# id_method='random', location='west')
# %% Publish
# Arguments: Source directory, destination directory, figure, plot name,
# publish-mode).
# Arguments: Source directory or files as list, destination directory, figures,
# plots or images.
publish(['../README.md', '../dist', '../LICENSE'],
'/home/chief/Dokumente/fst/plotid_python/data',
TAGGED_FIGS, 'Bild', 'individual')
TAGGED_FIGS, 'Bild')
......@@ -46,7 +46,7 @@ class PublishOptions:
"""
def __init__(self, src_datapaths, dst_path, figure, plot_names,
data_storage):
data_storage='individual'):
self.src_datapaths = src_datapaths
self.dst_path = dst_path
......
......@@ -2,7 +2,7 @@ coverage==6.3.2
cycler==0.11.0
fonttools==4.32.0
kiwisolver==1.4.2
matplotlib==3.5.1
matplotlib==3.5.2
numpy==1.22.3
packaging==21.3
Pillow==9.1.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment