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

Remove unnecessary files.

parent 9086a9eb
No related branches found
No related tags found
2 merge requests!12v.0.1 for alpha release,!6Implement basic functionality of publish.
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.
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 20 12:22:33 2021
example workflow for integrating plotIDs
@author: Richter
Example workflow for integrating plotIDs.
"""
# %% Module einbinden
import sys
# %% Import modules
import numpy as np
from numpy import random
# import h5py as h5
......@@ -14,14 +11,6 @@ from numpy import random
import matplotlib.pyplot as plt
from TagPlot import TagPlot
from publish import publish
from fcn_help.FST_colors import Colors
plt.style.use('fcn_help/FST.mplstyle')
# %matplotlib qt
# %matplotlib inline
# %% Pfade hinzufügen
sys.path.append("fcn_core")
sys.path.append("fcn_help")
# %% Project ID
ProjectID = "MR04_"
......@@ -35,27 +24,21 @@ y = random.rand(100) + 2
y_2 = np.sin(x) + 2
# %% Create figure
# Colors
colors = Colors() # create instance from class
color_list = colors.get_color_names()
# Create plot
color1 = colors.get_rgb('black')
color2 = colors.get_rgb('yellow')
color1 = 'black'
color2 = 'yellow'
# 1.Figure
fig1 = plt.figure()
plt.plot(x, y, color=color1)
plt.plot(x, y_2, color=color2)
# 2.Figure
plt.clf # Close figure
fig2 = plt.figure()
plt.plot(x, y, color=color2)
plt.plot(x, y_2, color=color1)
plt.clf # Close figure
fig = [fig1, fig2]
TagPlot
# %% TagPlot
[figs, ID] = TagPlot(fig, plot_engine, prefix=ProjectID,
method='2', location='west')
......@@ -66,5 +49,5 @@ for i, figure in enumerate(figs):
figure.savefig(name)
# %% Publish
publish('fcn_help', '/home/chief/Dokumente/fst/plotid_python/data',
publish('tests', '/home/chief/Dokumente/fst/plotid_python/data',
fig1, 'Bild', 'individual')
This diff is collapsed.
import matplotlib.pyplot as plt
def set_FST_template(project_directory):
plt.style.use(f'{project_directory}\\Code\\''FST.mplstyle')
class Colors():
def __init__(self):
self.rgb_colors = {
'blue' : (0, 0.31, 0.45),
'red' : (0.91, 0.31, 0.24),
'green' : (0.69, 0.8, 0.31),
'black' : (0, 0, 0),
'orange' : (0.93, 0.48, 0.20),
'petrol' : (0.31, 0.71, 0.58),
'grey' : (0.54, 0.54, 0.54),
'yellow' : (0.99, 0.79, 0)
}
def get_rgb(self, color_name):
if color_name in self.rgb_colors.keys():
return self.rgb_colors[color_name]
else:
print(f"Error: Color '{color_name}' does not exist.\nAvailable colors are: {list(self.rgb_colors.keys())}")
def get_color_names(self):
return list(self.rgb_colors.keys())
\ No newline at end of file
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment