Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xavier Garrido
CAMEL
Commits
9c845981
Commit
9c845981
authored
Apr 07, 2017
by
Matthieu Tristram
Browse files
Add multiple chains
parent
01685750
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
work/tools/python/camel.py
work/tools/python/camel.py
+8
-10
No files found.
work/tools/python/camel.py
View file @
9c845981
...
...
@@ -448,7 +448,7 @@ def posterior1d( chains, params, nbin=50, smooth=1,
# ax.legend(names, loc='upper right')
def
posterior2d
(
chain
,
par1
,
par2
,
*
args
,
**
kwargs
):
def
posterior2d
(
chain
s
,
par1
,
par2
,
*
args
,
**
kwargs
):
"""
Plot a 2-D histogram of samples.
...
...
@@ -675,10 +675,7 @@ def triangle( chains, params, nbin=50, parnames=None, names=[], colors=[], lines
def
rectangle
(
chains
,
par0
,
params
,
nbin
=
50
,
parnames
=
None
,
names
=
[],
colors
=
[],
linestyles
=
[],
smooth
=
1.
,
fontsize
=
12
,
contour
=
True
,
fill
=
False
,
cmaps
=
[],
Norm
=
True
,
weights
=
None
,
ylim
=
None
):
import
matplotlib.ticker
as
mtick
fig
=
plt
.
figure
()
plt
.
subplots_adjust
(
hspace
=
0.001
,
wspace
=
0.001
)
import
matplotlib.ticker
as
mtick
#force tuple
if
not
(
isinstance
(
chains
,
list
)
or
isinstance
(
chains
,
tuple
)):
...
...
@@ -687,6 +684,9 @@ def rectangle( chains, par0, params, nbin=50, parnames=None, names=[], colors=[]
nchain
=
len
(
chains
)
npar
=
len
(
params
)
fig
=
plt
.
figure
(
figsize
=
(
5
*
npar
,
5
))
plt
.
subplots_adjust
(
hspace
=
0.001
,
wspace
=
0.001
)
if
len
(
colors
)
<
nchain
:
colors
=
plt
.
rcParams
[
'axes.color_cycle'
]
...
...
@@ -751,11 +751,9 @@ def rectangle( chains, par0, params, nbin=50, parnames=None, names=[], colors=[]
# ax.xaxis.set_major_formatter(mtick.FormatStrFormatter('%.0e'))
#write legend
## if len(names) == nchain:
## ax=plt.subplot( npar, npar, int(0.25*npar)*npar+0.85*npar-1)
## for c in range(nchain):
## plt.text(0.5,1.-0.2*(c+1), names[c], color=colors[c])
## ax.axis('off')
if
len
(
names
)
==
nchain
:
for
c
in
range
(
nchain
):
ax
.
text
(
0.9
,
1.
-
0.1
*
(
c
+
1
),
names
[
c
],
color
=
colors
[
c
],
transform
=
ax
.
transAxes
,
horizontalalignment
=
'right'
)
return
(
fig
)
...
...
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