Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LAMBERT Jean-charles
uns_projects
Commits
c390ae61
Commit
c390ae61
authored
Nov 07, 2016
by
LAMBERT Jean-charles
Browse files
fix a sort bug issue when plotting
parent
58a9dd51
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/modules/simulations/ccod.py
View file @
c390ae61
...
...
@@ -412,7 +412,7 @@ class CCod:
# plot
# first plot: plot distance between 2 halos on whole simulation
plt
.
subplot
(
211
)
plt
.
plot
(
data1
[
time1_sort
][:,
0
],
distance
[
time1_sort
],
'b
.
'
)
plt
.
plot
(
data1
[
time1_sort
][:,
0
],
distance
[
time1_sort
],
'b'
)
plt
.
axvline
(
merging_time
,
color
=
'g'
,
dashes
=
(
10
,
3
),
label
=
"merging"
)
plt
.
title
(
'Distance between 2 Halos : '
+
simname
)
plt
.
xlabel
(
'Gyears'
)
...
...
@@ -425,13 +425,13 @@ class CCod:
#plt.title('Distance between 2 Halos')
plt
.
xlabel
(
'Gyears'
)
plt
.
ylabel
(
'Kpc'
)
select_t
=
data1
[
time1_sort
][:,
0
]
>
merging_time
plt
.
plot
(
data1
[
select_t
][:,
0
],
distance
[
select_t
],
'b.'
)
select_t
=
(
data1
[
time1_sort
][:,
0
]
>
merging_time
)
plt
.
plot
(
data1
[
time1_sort
[
select_t
]][:,
0
],
distance
[
time1_sort
[
select_t
]],
'b'
)
plt
.
axvline
(
merging_time
,
color
=
'g'
,
dashes
=
(
10
,
3
))
ax
=
plt
.
axis
()
# get axis coordinates
plt
.
text
(
merging_time
+
0.01
,(
ax
[
3
]
-
ax
[
2
])
/
2
,
"%.3f"
%
(
merging_time
))
# print merging time
plt
.
tight_layout
()
#plt.show()
if
txtfile
is
not
None
:
m_txt
=
outdir
+
"/"
+
txtfile
...
...
Write
Preview
Supports
Markdown
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