Skip to content
Snippets Groups Projects
Select Git revision
  • d863ff431556aa8ed24e5624d779f83127f18c28
  • main default protected
  • fix/serialization_types
  • feat/spectrogram
  • alazar_issues
  • atsaverage_extra
  • spectrometer/alazar_driver
  • v2025.9.1 protected
  • v2025.7.1 protected
  • v2025.3.1 protected
  • v2024.11.1 protected
  • v2024.9.19-rc1 protected
  • v2024.7.1 protected
  • v2023.7.1 protected
  • v2023.6.1 protected
15 results

core.py

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')