Skip to content
Snippets Groups Projects
Select Git revision
  • 752e4d43bd85a3732373afe9a04fe65b74bc45eb
  • master default protected
  • develop protected
  • feature/python-interface
  • feature/reflectionTest
  • feature/diffraction-fading
  • feature/runPELICAN
  • feature/propParamExport
  • feature/factory
  • ma_2018/erraji
  • ITAPropagationModels_v1.0.0
  • ITAPropagationModels_v2024a
  • VA_v2023b
  • ART_v2023a
  • VA_v2023a
  • VA_v2022a
  • before_cmake_rework
  • v2021.a
  • v2019.a
19 results

test_ReflectionFactor.cpp

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
    # %% TagPlot
    [figs, ID] = TagPlot(fig, plot_engine, prefix=ProjectID,
                         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',
            fig1, 'Bild', 'individual')