Skip to content
Snippets Groups Projects
Commit 478774b6 authored by Germain Clavier's avatar Germain Clavier
Browse files
parents a0b8002f 9b2fa7d9
No related branches found
No related tags found
No related merge requests found
......@@ -168,7 +168,7 @@ def write_output(outfile, fields, ave, sem):
def main():
parser = argparse.ArgumentParser(
description="Script to compute lifetime of tubes of symmetric star polymers."
description="Script to compute ave and standard error from lammps ave/* output"
)
parser.add_argument(
"-f",
......
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
'''
Plot LAMMPS forces
Plot LAMMPS forces.
'''
import argparse
......@@ -10,7 +10,6 @@ import numpy as np
import os
import logging
import sys
import GCcolors
from matplotlib import pyplot as plt
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
An old scitific journal style inspired plotting configuration file
'''
import numpy as np
import re
from matplotlib import pyplot as plt
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
import sys
plt.rc('axes', linewidth=2)
label_fontsize = 20
ticks_fontsize = 20
linewidth = 3
axes_linewidth = 1
major_tick_length = 15
minor_tick_length = major_tick_length//2
no_tick = 0
# print(plt.rcParams.keys())
# sys.exit()
plt.rcParams['font.family'] = 'Latin Modern Math'
plt.rcParams['font.weight'] = 'normal'
plt.rcParams['font.variant'] = 'small-caps' # Unfortunately, this does not work yet with matplotlib
plt.rcParams['axes.linewidth'] = axes_linewidth
plt.rcParams['lines.linewidth'] = linewidth
plt.rcParams['axes.labelsize'] = label_fontsize
plt.rcParams['legend.fontsize'] = label_fontsize
plt.rcParams['xtick.major.size'] = major_tick_length
plt.rcParams['xtick.minor.visible'] = True
plt.rcParams['xtick.minor.size'] = minor_tick_length
plt.rcParams['xtick.labelsize'] = ticks_fontsize
plt.rcParams['ytick.labelsize'] = ticks_fontsize
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['xtick.top'] = True
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['ytick.right'] = True
plt.rcParams['ytick.major.size'] = major_tick_length
plt.rcParams['ytick.minor.visible'] = True
plt.rcParams['ytick.minor.size'] = minor_tick_length
plt.rcParams['xtick.major.width'] = axes_linewidth
plt.rcParams['ytick.major.width'] = axes_linewidth
plt.rcParams['xtick.minor.width'] = axes_linewidth
plt.rcParams['ytick.minor.width'] = axes_linewidth
plt.rcParams['lines.markerfacecolor'] = 'white'
plt.rcParams['lines.markeredgecolor'] = 'black'
nlinestyle = 4
linestyle_list = ['-', '--', '-.', ':']
color_list = ['#000000', '#888888', '#CCCCCC']
marker_list = ['o', 's', 'v', '^']
plt.rcParams['axes.prop_cycle'] = plt.cycler(color=color_list) * (plt.cycler(linestyle=linestyle_list) + plt.cycler(marker=marker_list))
##### SOME EXAMPLES FOR TESTING PURPOSE ####
##### Plotting linear data
# npoints = 10
# for i in range(12):
# data = np.linspace(0, 1, 10)
# plt.plot((i+1)*data, label=" ".join(['data', str(i+1)]))
# ax = plt.gca()
# ax.legend(frameon=False)
# ax.set_xlabel(r"PIF ($\int_{-\infty}^{3} \frac{x}{l_0}$)")
# ax.set_ylabel("POUET")
##### Show result
plt.show()
......@@ -11,12 +11,12 @@ import sys
import re
import GCcolors
import povray as pov
from itertools import cycle
import numpy as np
from scipy.signal import savgol_filter
import matplotlib as mpl
from matplotlib import pyplot as plt
# plt.rcParams.update({'lines.markeredgewidth': 4})
plt.rcParams.update({'font.size': 22, 'lines.linewidth': 3.})
......@@ -310,7 +310,7 @@ def main():
help='File name followed by columns and optionally lines to skip.')
parser.add_argument('-n', '--names', dest='names',
nargs='+', action='append',
default=[],
default=[''],
help='Names for the legend.')
parser.add_argument('-l', '--loglog', dest='is_log_xy',
action='store_true',
......@@ -401,11 +401,13 @@ def main():
'steelblue', 'blue', 'darkblue', 'indigo']
elif grad:
colors = []
g = pov.gradient(name='aquatic')
col1 = np.array([2., 242., 245.])/255.
col2 = np.array([252., 44., 255.])/255.
for i in range(grad):
x = i/grad
c = g.extract(x)
color = (c.r, c.g, c.b)
x = i/(grad-1)
# c = g.extract(x)
# color = (c.r, c.g, c.b)
color = (1-x)*col1 + x*col2
colors.append(color)
else:
colors = GCcolors.color_list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment