Skip to content
Snippets Groups Projects
Commit e14c4147 authored by nugget's avatar nugget
Browse files

Make prefix optional, with empty string as default.

parent 00ea178a
Branches
Tags
2 merge requests!12v.0.1 for alpha release,!1Implement basic function to switch between plot engines.
......@@ -5,7 +5,7 @@ from TagPlot_matplotlib import TagPlot_matplotlib
import warnings
def TagPlot(figs, prefix, engine, method=1, location='east'):
def TagPlot(figs, engine, prefix='', method=1, location='east'):
"""
Determine which plot engine should be used to tag the plots.
......@@ -42,7 +42,6 @@ def TagPlot(figs, prefix, engine, method=1, location='east'):
if isinstance(prefix, str):
pass
else:
# TODO: Make prefix optional.
raise TypeError("Prefix is not a string.")
if isinstance(figs, list):
......
......
......@@ -32,7 +32,8 @@ def TagPlot_matplotlib(figs, prefix, method, rotation, position):
# Loop to create and position the IDs
for fig in figs:
ID = CreateID.CreateID(method)
IDs.append(prefix + '_' + str(ID))
ID = prefix + str(ID)
IDs.append(ID)
plt.figure(fig.number)
plt.figtext(x=position[0], y=position[1], s=ID, ha='left', wrap=True,
rotation=rotation, fontsize=FONTSIZE, color=COLOR)
......
......
Image diff could not be displayed: it is too large. Options to address this: view the blob.
Image diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -23,7 +23,7 @@ sys.path.append("fcn_help")
# %% Project ID
ProjectID = "MR04"
ProjectID = "MR04_"
# %% Plot engine
plot_engine = "matplotlib"
......@@ -56,7 +56,8 @@ fig = [fig1, fig2]
# %% TagPlot
[figs, ID] = TagPlot(fig, ProjectID, plot_engine, method='2', location='west')
[figs, ID] = TagPlot(fig, plot_engine, prefix=ProjectID,
method='2', location='west')
# %% Figure als tiff-Datei abspeichern
for i, figure in enumerate(figs):
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment