Skip to content
Snippets Groups Projects
Select Git revision
  • 38cfc40b814623c6ecc7c35f1a6d615294a536e1
  • master default protected
  • dev_2022
  • patch-1
  • develop
  • 50-use-ubuntus-libhidapi
  • issue-highLevelDispatch
  • issue-highLevelDesign
  • issue-motorStartBug
  • issue-commandLayerDesign
  • v1.0
  • v0.4-rc.13
  • v0.4-rc.12
  • v0.4-rc.11
  • v0.4-rc.10
  • v0.4-rc.9
  • v0.3-rc.8
  • v0.3-rc.7
  • v0.3-rc.6
  • v0.3-rc.5
  • v0.3-rc.4
  • v0.3-rc.3
  • v0.3-rc.2
  • v0.3-rc.1
  • v0.3-rc
  • v0.2
  • v0.1.1
  • v0.1
28 results

Sensor.m

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    example.py 1.50 KiB
    # -*- coding: utf-8 -*-
    """
    Created on Tue Jul 20 12:22:33 2021
    example workflow for integrating plotIDs
    @author: Richter
    """
    
    # %% Module einbinden
    import sys
    import numpy as np
    from numpy import random
    # import h5py as h5
    # import matplotlib
    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"
    
    # %% Plot engine
    plot_engine = "matplotlib"
    
    # %% Create sample data
    x = np.linspace(0, 10, 100)
    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')
    # 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
    [figs, ID] = TagPlot(fig, ProjectID, plot_engine, method='2', location='west')
    
    # %% Figure als tiff-Datei abspeichern
    for i, figure in enumerate(figs):
        name = "Test"+str(i)+".tiff"
        figure.savefig(name)
    
    # %% Publish
    publish('fcn_help', '/home/chief/Dokumente/fst/plotid_python/data',
            '/home/chief/Dokumente/fst/plotid_python/Test1.tiff', 'individual')