Commit 708b0991 by Uddeepta Deka

Delete plotsettings-checkpoint.py

parent 0095ae3f
import numpy as np
from matplotlib import rc
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
from matplotlib.colors import LinearSegmentedColormap
colors_1 = ["#003049","#d62828","#f77f00","#fcbf49","#eae2b7"]
colors_2 = ['#001219', '#005f73', '#0a9396', '#94d2bd', '#e9d8a6', '#ee9b00', '#ca6702', '#bb3e03', '#ae2012', '#9b2226']
def plotsettings(style='Notebook'):
rc('text.latex', preamble='\\usepackage{txfonts}')
rc('text', usetex=True)
rc('font', family='serif')
rc('font', serif='times')
rc('font', size=fontSizeDict[style])
rc('mathtext', default='sf')
rc('lines', markeredgewidth=1)
rc('lines', linewidth=1)
rc('axes', labelsize=labelSizeDict[style])
rc('axes', titlesize=fontSizeDict[style])
rc("axes", linewidth=0.5)
rc('xtick', labelsize=ticklabelSizeDict[style])
rc('ytick', labelsize=ticklabelSizeDict[style])
rc("xtick", direction="in")
rc("ytick", direction="in")
rc('legend', fontsize=fontSizeDict[style]) # 16
rc('legend', title_fontsize=fontSizeDict[style])
rc('legend', frameon=False)
rc('xtick.major', pad=6) # 8)
rc('ytick.major', pad=6) # 8)
rc('xtick.minor', size=6) # 8)
rc('ytick.minor', size=6) # 8)
def get_n_colors_from_colormap(n, colormap_name='viridis'):
cmap = plt.get_cmap(colormap_name)
colors = [cmap(i / n) for i in range(n)]
return colors
def get_n_colors_from_custom_colormap(n, colors_hex):
rgb_colors = [mcolors.hex2color(hex_code) for hex_code in colors_hex]
continuous_colormap = LinearSegmentedColormap.from_list('continuous_colormap', rgb_colors)
colors = continuous_colormap(np.linspace(0, 1, n))
return colors
from packaging import version
if version.parse(matplotlib.__version__) < version.parse("3.5.0"):
from matplotlib import cm
dark2 = cm.get_cmap("Dark2").colors
else:
from matplotlib import colormaps
dark2 = colormaps["Dark2"].colors
figWidthsOneColDict = {
"APS": 3.4,
"APJ": 3.543,
"Elsevier": 3.543,
"Springer": 3.3,
"Presentation": 3,
"Notebook": 6
}
figWidthsTwoColDict = {
"APS": 7.0,
"APJ": 7.48,
"Elsevier": 7.48,
"Springer": 6.93,
"Presentation": 4.5,
"Notebook": 12
}
figHeightsDict = {
"APS": 2,
"APJ": 2,
"Elsevier": 2,
"Springer": 2,
"Presentation": 3.0,
"Notebook": 4.0
}
ticklabelSizeDict = {"APS": 9.0,
"APJ": 8.0,
"Elsevier": 8.0,
"Springer": 8.0,
"Presentation": 8.0,
"Notebook": 14.0}
labelSizeDict = {"APS": 9.0,
"APJ": 8.0,
"Elsevier": 8.0,
"Springer": 8.0,
"Presentation": 8.0,
"Notebook": 18.0}
fontSizeDict = {"APS": 9.0,
"APJ": 8.0,
"Elsevier": 8.0,
"Springer": 8.0,
"Presentation": 8.0,
"Notebook": 14.0}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment