Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
JPSreport
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
JuPedSim
JPSreport
Commits
56d6a8f7
Commit
56d6a8f7
authored
Jan 11, 2018
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plot time series: bigger fonts and better scaling
parent
a8a1414c
Pipeline
#5923
passed with stages
in 1 minute and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
scripts/_Plot_timeseries_rho_v.py
scripts/_Plot_timeseries_rho_v.py
+12
-9
No files found.
scripts/_Plot_timeseries_rho_v.py
View file @
56d6a8f7
#!/usr/bin/env python3
#!/usr/bin/env python3
from
numpy
import
*
import
numpy
as
np
import
matplotlib
import
matplotlib
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
from
Polygon
import
*
from
Polygon
import
*
...
@@ -24,13 +24,16 @@ def plotRhoT(pathfile,figname,fps,title,data_Classic=None, data_Voronoi=None):
...
@@ -24,13 +24,16 @@ def plotRhoT(pathfile,figname,fps,title,data_Classic=None, data_Voronoi=None):
plt
.
rc
(
'pdf'
,
fonttype
=
42
)
plt
.
rc
(
'pdf'
,
fonttype
=
42
)
if
data_Classic
is
not
None
:
if
data_Classic
is
not
None
:
plt
.
plot
(
data_Classic
[:,
0
]
/
fps
,
data_Classic
[:,
1
],
'b--'
,
label
=
"Classic method"
)
plt
.
plot
(
data_Classic
[:,
0
]
/
fps
,
data_Classic
[:,
1
],
'b--'
,
label
=
"Classic method"
)
y_max
=
np
.
max
(
data_Classic
[:,
1
])
if
data_Voronoi
is
not
None
:
if
data_Voronoi
is
not
None
:
plt
.
plot
(
data_Voronoi
[:,
0
]
/
fps
,
data_Voronoi
[:,
1
],
'r-'
,
lw
=
3
,
label
=
"Voronoi method"
)
plt
.
plot
(
data_Voronoi
[:,
0
]
/
fps
,
data_Voronoi
[:,
1
],
'r-'
,
lw
=
3
,
label
=
"Voronoi method"
)
plt
.
xlabel
(
"t [$s$]"
)
y_max
=
np
.
max
(
data_Voronoi
[:,
1
])
plt
.
ylabel
(
"density [$m^{-2}$]"
)
plt
.
xlabel
(
"$t\;\; [s$]"
,
size
=
18
)
plt
.
ylabel
(
r
"$\rho\;\; [m^{-2}$]"
,
size
=
18
)
plt
.
gca
().
set_xlim
(
left
=
0
)
plt
.
gca
().
set_xlim
(
left
=
0
)
#plt.gca().set_ylim(bottom=0)
#plt.gca().set_ylim(bottom=0)
plt
.
ylim
(
0
,
8
)
plt
.
ylim
(
0
,
y_max
+
0.5
)
plt
.
title
(
"%s"
%
title
)
plt
.
title
(
"%s"
%
title
)
plt
.
legend
()
plt
.
legend
()
plt
.
savefig
(
"%s/%s.png"
%
(
pathfile
,
figname
))
plt
.
savefig
(
"%s/%s.png"
%
(
pathfile
,
figname
))
...
@@ -45,8 +48,8 @@ def plotVT(pathfile,figname,fps,title,data_Classic=None, data_Voronoi=None):
...
@@ -45,8 +48,8 @@ def plotVT(pathfile,figname,fps,title,data_Classic=None, data_Voronoi=None):
plt
.
plot
(
data_Classic
[:,
0
]
/
fps
,
data_Classic
[:,
2
],
'b--'
,
label
=
"Classic method"
)
plt
.
plot
(
data_Classic
[:,
0
]
/
fps
,
data_Classic
[:,
2
],
'b--'
,
label
=
"Classic method"
)
if
data_Voronoi
is
not
None
:
if
data_Voronoi
is
not
None
:
plt
.
plot
(
data_Voronoi
[:,
0
]
/
fps
,
data_Voronoi
[:,
2
],
'r-'
,
lw
=
3
,
label
=
"Voronoi method"
)
plt
.
plot
(
data_Voronoi
[:,
0
]
/
fps
,
data_Voronoi
[:,
2
],
'r-'
,
lw
=
3
,
label
=
"Voronoi method"
)
plt
.
xlabel
(
"
t [$s$]"
)
plt
.
xlabel
(
"
$t\;\; [s]$"
,
size
=
18
)
plt
.
ylabel
(
"
velocity [$m/s$]"
)
plt
.
ylabel
(
"
$v\;\; [m/s]$"
,
size
=
18
)
plt
.
gca
().
set_xlim
(
left
=
0
)
plt
.
gca
().
set_xlim
(
left
=
0
)
#plt.gca().set_ylim(bottom=0)
#plt.gca().set_ylim(bottom=0)
plt
.
ylim
(
0
,
2
)
plt
.
ylim
(
0
,
2
)
...
@@ -70,7 +73,7 @@ if __name__ == '__main__':
...
@@ -70,7 +73,7 @@ if __name__ == '__main__':
figname_rho
=
"rho_t_%s_id_%s"
%
(
nametraj
,
ID
)
figname_rho
=
"rho_t_%s_id_%s"
%
(
nametraj
,
ID
)
figname_v
=
"v_t_%s_id_%s"
%
(
nametraj
,
ID
)
figname_v
=
"v_t_%s_id_%s"
%
(
nametraj
,
ID
)
title
=
"%s_id_%s"
%
(
nametraj
,
ID
)
title
=
"%s_id_%s"
%
(
nametraj
,
ID
)
data_Classic
=
loadtxt
(
fC
)
data_Classic
=
np
.
loadtxt
(
fC
)
plotRhoT
(
pathfile
,
figname_rho
,
fps
,
title
,
data_Classic
)
plotRhoT
(
pathfile
,
figname_rho
,
fps
,
title
,
data_Classic
)
plotVT
(
pathfile
,
figname_v
,
fps
,
title
,
data_Classic
)
plotVT
(
pathfile
,
figname_v
,
fps
,
title
,
data_Classic
)
...
@@ -80,10 +83,10 @@ if __name__ == '__main__':
...
@@ -80,10 +83,10 @@ if __name__ == '__main__':
figname_rho
=
"rho_t_%s_id_%s"
%
(
nametraj
,
ID
)
figname_rho
=
"rho_t_%s_id_%s"
%
(
nametraj
,
ID
)
figname_v
=
"v_t_%s_id_%s"
%
(
nametraj
,
ID
)
figname_v
=
"v_t_%s_id_%s"
%
(
nametraj
,
ID
)
title
=
"%s_id_%s"
%
(
nametraj
,
ID
)
title
=
"%s_id_%s"
%
(
nametraj
,
ID
)
data_Voronoi
=
loadtxt
(
fV
)
data_Voronoi
=
np
.
loadtxt
(
fV
)
fC
=
"%s/rho_v_Classic_%s_id_%s.dat"
%
(
pathfile
,
nametraj
,
ID
)
fC
=
"%s/rho_v_Classic_%s_id_%s.dat"
%
(
pathfile
,
nametraj
,
ID
)
if
(
os
.
path
.
isfile
(
fC
)):
if
(
os
.
path
.
isfile
(
fC
)):
data_Classic
=
loadtxt
(
fC
)
data_Classic
=
np
.
loadtxt
(
fC
)
plotRhoT
(
pathfile
,
figname_rho
,
fps
,
title
,
data_Classic
,
data_Voronoi
)
plotRhoT
(
pathfile
,
figname_rho
,
fps
,
title
,
data_Classic
,
data_Voronoi
)
plotVT
(
pathfile
,
figname_v
,
fps
,
title
,
data_Classic
,
data_Voronoi
)
plotVT
(
pathfile
,
figname_v
,
fps
,
title
,
data_Classic
,
data_Voronoi
)
else
:
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment