Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Packages
chemical_checker
Commits
5c80b60b
Commit
5c80b60b
authored
Dec 03, 2021
by
Martino Bertoni
🌋
Browse files
added density subsample argument for a faster guassian_kde estimation
parent
a1fe77b5
Pipeline
#2588
failed with stages
in 64 minutes and 9 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
package/chemicalchecker/util/plot/util.py
View file @
5c80b60b
...
...
@@ -194,7 +194,8 @@ def make_cbar_ax(ax, cmap=plt.get_cmap('viridis'), title=''):
cbar
.
ax
.
set_aspect
(
0.04
)
def
projection
(
front
,
back
=
None
,
front_kwargs
=
[],
back_kwargs
=
{},
ax
=
None
):
def
projection
(
front
,
back
=
None
,
front_kwargs
=
[],
back_kwargs
=
{},
ax
=
None
,
density_subsample
=
1000
):
def
_proj_lims
(
P
):
xlim
=
[
np
.
min
(
P
[:,
0
]),
np
.
max
(
P
[:,
0
])]
...
...
@@ -231,7 +232,7 @@ def projection(front, back=None, front_kwargs=[], back_kwargs={}, ax=None):
color
=
'black'
if
density
:
xy
=
np
.
vstack
([
x
,
y
])
z
=
gaussian_kde
(
xy
)(
xy
)
z
=
gaussian_kde
(
xy
[:,
:
density_subsample
]
)(
xy
)
idx
=
z
.
argsort
()
x
,
y
,
z
=
x
[
idx
],
y
[
idx
],
z
[
idx
]
ax
.
scatter
(
x
,
y
,
c
=
z
,
s
=
minmax_scale
(
z
,
(
s_min
,
s_max
)),
...
...
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