Skip to content
Snippets Groups Projects
Commit eb2925ad authored by Michael Reuscher's avatar Michael Reuscher
Browse files

new plot

parent 88f83bcf
Branches
No related tags found
1 merge request!4Python driver and data analysis part
{ {
"data_set_1":{ "data_set_1":{
"--posixDataDir": "protokoll", "--posixDataDir": "fehler_test",
"-n": "15", "-n": "15",
"-s": "2M", "-s": "2M",
"-i": "0.1s", "-i": "0.1s",
"-N": "4"}, "-N": "4"},
"data_set_2":{ "data_set_2":{
"--posixDataDir": "protokoll", "--posixDataDir": "protokoll",
"-q": "20", "-q": "error test parameter",
"-n": "20", "-n": "20",
"-s": "1M", "-s": "1M",
"-i": "0.1s", "-i": "0.1s",
......
...@@ -44,7 +44,7 @@ def run_sim(e_list, d_path, s_path): ...@@ -44,7 +44,7 @@ def run_sim(e_list, d_path, s_path):
print(output) print(output)
print(errors) print(errors)
if return_code > 0: if return_code > 0:
print(return_code) print("return code: ", return_code)
# --- MAIN --- # --- MAIN ---
......
Install the controller and its dependencies Install the visualizer and its dependencies
by following these instructions: by following these instructions:
Please make sure that you are using Python 3.9 or higher. Please make sure that you are using Python 3.9 or higher.
Please make sure that you have installed setuptools for python3 Please make sure that you have installed setuptools for python3
if not: if not:
sudo apt install python3-setuptools apt install python3-setuptools
or or
pip install setuptools pip install setuptools
1. Navigate to /detectorwritesim/controller 1. Navigate to /detectorwritesim/visualizer
2. Create a new Python3.9 or higher virtual environment: 2. Create a new Python3.9 or higher virtual environment:
python3 -m venv visualizerenv python3 -m venv visualizerenv
3. Activate the environment: 3. Activate the environment:
...@@ -18,6 +18,6 @@ if not: ...@@ -18,6 +18,6 @@ if not:
python3 setup.py install python3 setup.py install
Now you have completed the setup process, Now you have completed the setup process,
you can start the controller by entering the following command: you can start the visualizer by entering the following command:
visualizer_run visualizer_run
\ No newline at end of file
"/home/user/Projekt/detectorwritesim/output1"
\ No newline at end of file
...@@ -11,6 +11,7 @@ setup( ...@@ -11,6 +11,7 @@ setup(
'pandas', 'pandas',
'seaborn', 'seaborn',
'matplotlib', 'matplotlib',
'scipy'
], ],
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
......
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import seaborn as sns import seaborn as sns
from scipy.stats import iqr
class SeabornPlotter: class SeabornPlotter:
...@@ -22,10 +23,11 @@ class SeabornPlotter: ...@@ -22,10 +23,11 @@ class SeabornPlotter:
y_bins = [y_start + (y_step * i) for i in range(int((y_end - y_start) / y_step) + 1)] y_bins = [y_start + (y_step * i) for i in range(int((y_end - y_start) / y_step) + 1)]
f, ax = plt.subplots(figsize=(16, 20)) f, ax = plt.subplots(figsize=(16, 20))
sns.scatterplot(x=x, y=y, s=5, color=".15", hue=list(self.dataframe.index.get_level_values(0))) sns.violinplot(x=x, y=y, s=5, color=".15", palette="light:b", inner="points", hue=list(self.dataframe.index.get_level_values(0)))
sns.histplot(x=x, y=y, bins=[x_bins, y_bins], pthresh=.1, cmap="coolwarm") #sns.histplot(x=x, y=y, bins=[x_bins, y_bins], pthresh=.1, cmap="coolwarm")
ax.set_xscale('log') #ax.set_xscale('log')
ax.set_yscale('log') ax.set_yscale('log')
plt.tight_layout() plt.tight_layout()
plt.show() plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment