forked from optics/eib700
259 lines
7.8 KiB
Python
259 lines
7.8 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
Created on Wed Aug 14 07:35:17 2024
|
|
|
|
@author: rolf
|
|
"""
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
global figure_width
|
|
figure_width=1
|
|
|
|
def SRI2024_Poster_style():
|
|
global figure_width
|
|
global figure_height
|
|
global left_right_margin
|
|
global top_bottom_margin
|
|
|
|
|
|
print("SRI2024_Poster_style")
|
|
|
|
plt.rcParams['axes.formatter.useoffset'] = False
|
|
|
|
ticklabelsize=18
|
|
mylabelsize =60
|
|
mytickwidth = 2.0
|
|
|
|
plt.rcParams['font.size']=12
|
|
|
|
plt.rcParams['lines.markersize']=8
|
|
plt.rcParams['lines.linewidth'] =2
|
|
|
|
plt.rcParams['xtick.labelsize'] = ticklabelsize
|
|
plt.rcParams['xtick.major.pad'] = 10
|
|
plt.rcParams['xtick.direction'] = 'in'
|
|
plt.rcParams['xtick.major.size']=10
|
|
plt.rcParams['xtick.minor.size']=5
|
|
plt.rcParams['xtick.major.width']=mytickwidth
|
|
plt.rcParams['xtick.minor.width']=mytickwidth
|
|
|
|
plt.rcParams['ytick.direction'] = 'in'
|
|
plt.rcParams['ytick.labelsize'] = ticklabelsize
|
|
plt.rcParams['ytick.major.pad'] = 10
|
|
plt.rcParams['ytick.major.size']=10
|
|
plt.rcParams['ytick.minor.size']=5
|
|
plt.rcParams['ytick.major.width']=mytickwidth
|
|
plt.rcParams['ytick.minor.width']=mytickwidth
|
|
|
|
plt.rcParams['axes.linewidth'] = 2 # set the value globally
|
|
plt.rcParams['axes.labelpad'] = 8
|
|
plt.rcParams['axes.labelsize'] = 20
|
|
|
|
plt.rcParams['legend.markerscale'] = 0.8
|
|
plt.rcParams['legend.fontsize'] = 20
|
|
plt.rcParams['legend.frameon'] = False
|
|
|
|
#plt.rcParams['xtick.top'] = 'True'
|
|
#plt.rcParams['ytick.right'] = 'True'
|
|
|
|
#plt.rcParams['axes.titlepad'] = 10.0 # set the value globally
|
|
#plt.rcParams['axes.labelpad'] = 20.0 # set the value globally
|
|
|
|
|
|
plt.rcParams['figure.subplot.top'] =0.9
|
|
plt.rcParams['figure.subplot.bottom'] =0.1
|
|
#plt.rcParams['figure.subplot.left'] =0.1
|
|
#plt.rcParams['figure.subplot.right'] =0.7
|
|
#plt.rcParams['figure.subplot.wspace'] =0.3
|
|
#plt.rcParams['figure.subplot.hspace'] =0.3
|
|
|
|
#plt.close('all')
|
|
|
|
figure_width = 28.7 # cm
|
|
figure_height = 20 # cm
|
|
left_right_margin = 3 # cm
|
|
top_bottom_margin = 3 # cm
|
|
# Don't change
|
|
left = left_right_margin / figure_width # Percentage from height
|
|
bottom = top_bottom_margin / figure_height # Percentage from height
|
|
width = 1 - left*2
|
|
height = 1 - bottom*2
|
|
cm2inch = 1/2.54 # inch per cm
|
|
|
|
###################################################
|
|
|
|
def SRI2024_Poster_style_two():
|
|
global figure_width
|
|
global figure_height
|
|
global left_right_margin
|
|
global top_bottom_margin
|
|
|
|
print("SRI2024_Poster_style_two")
|
|
|
|
plt.rcParams['axes.formatter.useoffset'] = False
|
|
|
|
ticklabelsize=18
|
|
mylabelsize =60
|
|
mytickwidth = 2.0
|
|
|
|
plt.rcParams['font.size']=12
|
|
|
|
plt.rcParams['lines.markersize']=8
|
|
plt.rcParams['lines.linewidth'] =2
|
|
|
|
plt.rcParams['xtick.labelsize'] = ticklabelsize
|
|
plt.rcParams['xtick.major.pad'] = 10
|
|
plt.rcParams['xtick.direction'] = 'in'
|
|
plt.rcParams['xtick.major.size']=10
|
|
plt.rcParams['xtick.minor.size']=5
|
|
plt.rcParams['xtick.major.width']=mytickwidth
|
|
plt.rcParams['xtick.minor.width']=mytickwidth
|
|
|
|
plt.rcParams['ytick.direction'] = 'in'
|
|
plt.rcParams['ytick.labelsize'] = ticklabelsize
|
|
plt.rcParams['ytick.major.pad'] = 10
|
|
plt.rcParams['ytick.major.size']=10
|
|
plt.rcParams['ytick.minor.size']=5
|
|
plt.rcParams['ytick.major.width']=mytickwidth
|
|
plt.rcParams['ytick.minor.width']=mytickwidth
|
|
|
|
plt.rcParams['axes.linewidth'] = 2 # set the value globally
|
|
plt.rcParams['axes.labelpad'] = 0
|
|
plt.rcParams['axes.labelsize'] = 20
|
|
|
|
plt.rcParams['legend.markerscale'] = 0.8
|
|
plt.rcParams['legend.fontsize'] = 12
|
|
plt.rcParams['legend.frameon'] = False
|
|
# plt.rcParams['legend.loc'] = 2
|
|
|
|
#plt.rcParams['xtick.top'] = 'True'
|
|
#plt.rcParams['ytick.right'] = 'True'
|
|
|
|
#plt.rcParams['axes.titlepad'] = 10.0 # set the value globally
|
|
#plt.rcParams['axes.labelpad'] = 20.0 # set the value globally
|
|
|
|
|
|
plt.rcParams['figure.subplot.top'] =0.9
|
|
plt.rcParams['figure.subplot.bottom'] =0.1
|
|
#plt.rcParams['figure.subplot.left'] =0.1
|
|
#plt.rcParams['figure.subplot.right'] =0.7
|
|
#plt.rcParams['figure.subplot.wspace'] =0.3
|
|
#plt.rcParams['figure.subplot.hspace'] =0.3
|
|
|
|
#plt.close('all')
|
|
|
|
figure_width = 29.4# cm
|
|
figure_height = 17.65 # cm
|
|
|
|
figure_width = 29.5# cm
|
|
figure_height = 17.5 # cm
|
|
|
|
left_right_margin = 3 # cm
|
|
top_bottom_margin = 2 # cm
|
|
|
|
|
|
# Don't change
|
|
left = left_right_margin / figure_width # Percentage from height
|
|
bottom = top_bottom_margin / figure_height # Percentage from height
|
|
width = 1 - left*2
|
|
height = 1 - bottom*2
|
|
cm2inch = 1/2.54 # inch per cm
|
|
###################################################
|
|
|
|
def PowerPoint_style():
|
|
|
|
|
|
ticklabelsize=15
|
|
mylabelsize =20
|
|
mytickwidth =2.0
|
|
|
|
plt.rcParams['font.size']=12
|
|
plt.rcParams['lines.markersize']=8
|
|
plt.rcParams['lines.linewidth'] =2
|
|
plt.rcParams['xtick.labelsize'] = ticklabelsize
|
|
plt.rcParams['xtick.major.pad'] = 10
|
|
plt.rcParams['xtick.direction'] = 'in'
|
|
plt.rcParams['xtick.major.size']=10
|
|
plt.rcParams['xtick.minor.size']=5
|
|
plt.rcParams['xtick.major.width']=mytickwidth
|
|
plt.rcParams['xtick.minor.width']=mytickwidth
|
|
plt.rcParams['ytick.direction'] = 'in'
|
|
plt.rcParams['ytick.labelsize'] = ticklabelsize
|
|
plt.rcParams['ytick.major.pad'] = 10
|
|
plt.rcParams['ytick.major.size']=10
|
|
plt.rcParams['ytick.minor.size']=5
|
|
plt.rcParams['ytick.major.width']=mytickwidth
|
|
plt.rcParams['ytick.minor.width']=mytickwidth
|
|
plt.rcParams['axes.linewidth'] = 2 # set the value globally
|
|
plt.rcParams['axes.labelpad'] = 8
|
|
plt.rcParams['axes.labelsize'] = 24
|
|
plt.rcParams['legend.markerscale'] = 0.8
|
|
plt.rcParams['legend.fontsize'] = 25
|
|
#plt.rcParams['xtick.top'] = 'True'
|
|
#plt.rcParams['ytick.right'] = 'True'
|
|
#plt.rcParams['axes.titlepad'] = 10.0 # set the value globally
|
|
#plt.rcParams['axes.labelpad'] = 20.0 # set the value globally
|
|
plt.rcParams['figure.subplot.top'] =0.9
|
|
plt.rcParams['figure.subplot.bottom'] =0.1
|
|
#plt.rcParams['figure.subplot.left'] =0.1
|
|
#plt.rcParams['figure.subplot.right'] =0.7
|
|
#plt.rcParams['figure.subplot.wspace'] =0.3
|
|
#plt.rcParams['figure.subplot.hspace'] =0.3
|
|
###################################################
|
|
|
|
def Init():
|
|
global figure_width
|
|
global figure_height
|
|
global left_right_margin
|
|
global top_bottom_margin
|
|
global cm2inch
|
|
|
|
figure_width = 29.4# cm
|
|
figure_height = 17.65 # cm
|
|
|
|
# figure_width = 29.5# cm
|
|
# figure_height = 17.5 # cm
|
|
|
|
left_right_margin = 3 # cm
|
|
top_bottom_margin = 2 # cm
|
|
|
|
cm2inch = 1/2.54 # inch per cm
|
|
|
|
|
|
def myfigure():
|
|
global figure_width
|
|
global figure_height
|
|
global left_right_margin
|
|
global top_bottom_margin
|
|
global cm2inch
|
|
|
|
left = left_right_margin / figure_width # Percentage from height
|
|
bottom = top_bottom_margin / figure_height # Percentage from height
|
|
width = 1 - left*2
|
|
height = 1 - bottom*2
|
|
|
|
# print("\nMyfigure: width = ",figure_width,"height = ", figure_height,"\n")
|
|
fig= plt.figure(figsize=(figure_width*cm2inch,figure_height*cm2inch))
|
|
return fig
|
|
|
|
def myAxis(fig):
|
|
|
|
global figure_width
|
|
global figure_height
|
|
global left_right_margin
|
|
global top_bottom_margin
|
|
|
|
left = left_right_margin / figure_width # Percentage from height
|
|
bottom = top_bottom_margin / figure_height # Percentage from height
|
|
width = 1 - left*2
|
|
height = 1 - bottom*2
|
|
# print("\nMyAxis: left = ",left ," width = ", width)
|
|
# print(" : bottom = ",bottom," height = ", height,"\n")
|
|
|
|
ax = fig.add_axes((left, bottom, width, height))
|
|
return ax
|
|
|
|
|