Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Germain Clavier
python-tools
Commits
478774b6
Commit
478774b6
authored
Jan 31, 2022
by
Germain Clavier
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://www.github.com/bibobu/python-tools
parents
a0b8002f
9b2fa7d9
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
lammps/lmp_ave_post.py
+1
-1
1 addition, 1 deletion
lammps/lmp_ave_post.py
lammps/plot_forces.py
+1
-2
1 addition, 2 deletions
lammps/plot_forces.py
plot/OldStyle.py
+70
-0
70 additions, 0 deletions
plot/OldStyle.py
plot/qp
+8
-6
8 additions, 6 deletions
plot/qp
with
80 additions
and
9 deletions
lammps/lmp_ave_post.py
+
1
−
1
View file @
478774b6
...
...
@@ -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
"
,
...
...
This diff is collapsed.
Click to expand it.
lammps/plot_forces.py
+
1
−
2
View file @
478774b6
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
plot/OldStyle.py
0 → 100644
+
70
−
0
View file @
478774b6
#!/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
()
This diff is collapsed.
Click to expand it.
plot/qp
+
8
−
6
View file @
478774b6
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment