Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra datasets #449

Merged
merged 36 commits into from
Sep 28, 2021
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b66c269
Update docstring for geom_point() function.
ASmirnov-HORIS Feb 16, 2021
b760969
Docstring: Update data, map and map_join parameters description.
ASmirnov-HORIS Feb 25, 2021
639b438
Updated core.py docstrings.
EArkhipova-HORIS Feb 26, 2021
7a6ba28
Minor fixes
EArkhipova-HORIS Mar 2, 2021
3003b51
Update examples in coord.py docstrings, update geom_extras.py docstrings
EArkhipova-HORIS Mar 3, 2021
f27c925
Docstrings: replace >>> to :linenos: in geom.py.
ASmirnov-HORIS Mar 12, 2021
19f7c85
Update examples in plot.py, update docstring in label.py.
EArkhipova-HORIS Mar 15, 2021
d33102b
Update docstring for the geocode() function.
ASmirnov-HORIS Mar 17, 2021
33afa10
Update docstrings in geo_data.
ASmirnov-HORIS Mar 19, 2021
b33d331
Add link to documentation page for formatting in tooltips and geom_te…
ASmirnov-HORIS Mar 24, 2021
ab0cb8c
Fix lists in docstrings notes (according to Numpydoc and rst rules).
ASmirnov-HORIS Mar 24, 2021
c8c1ced
Update links in docstrings.
ASmirnov-HORIS Mar 24, 2021
f019ead
Fix errors of the rebase conflicts resolving.
ASmirnov-HORIS Aug 20, 2021
e5b5038
Merge branch 'master' of github.com:JetBrains/lets-plot
ASmirnov-HORIS Aug 26, 2021
48361d9
Merge branch 'master' of github.com:JetBrains/lets-plot
ASmirnov-HORIS Aug 27, 2021
8013613
Move the notebook 'map_US_household_income' to the lets-plot-docs rep…
ASmirnov-HORIS Aug 30, 2021
0cb2498
Update docstrings for the stat_corr() function.
ASmirnov-HORIS Aug 30, 2021
26951f2
Update docstrings for geo_data and tilesets.
ASmirnov-HORIS Aug 31, 2021
b6ede67
Merge branch 'master' of github.com:JetBrains/lets-plot
ASmirnov-HORIS Sep 2, 2021
1744657
Merge branch 'master' into sphinx-doc
ASmirnov-HORIS Sep 2, 2021
1e7f7d5
Update examples in some docstrings (geometries).
ASmirnov-HORIS Sep 2, 2021
b1ff9c7
Tiny fix in the docstrings.
ASmirnov-HORIS Sep 10, 2021
b516830
Update links to the documentation site and remove the README_PYTHON.m…
ASmirnov-HORIS Sep 10, 2021
9c99338
Merge branch 'master' of github.com:JetBrains/lets-plot
ASmirnov-HORIS Sep 13, 2021
53d48da
Fix conflicts after merging with master.
ASmirnov-HORIS Sep 13, 2021
d44b269
Fix docstrings.
ASmirnov-HORIS Sep 13, 2021
837bf1c
Move example notebooks to the lets-plot-docs repository.
ASmirnov-HORIS Sep 20, 2021
73e520d
Tiny fix in docstrings for scales.
ASmirnov-HORIS Sep 21, 2021
cb78333
Merge branch 'master' of github.com:JetBrains/lets-plot
ASmirnov-HORIS Sep 21, 2021
3699a55
Merge branch 'master' into sphinx-doc
ASmirnov-HORIS Sep 21, 2021
a998004
Remove some markdown, images and notebooks from the docs/ directory. …
ASmirnov-HORIS Sep 23, 2021
839fac0
Merge branch 'master' of github.com:JetBrains/lets-plot
ASmirnov-HORIS Sep 24, 2021
9416a7f
Fix conflicts after merging with upstream/master.
ASmirnov-HORIS Sep 24, 2021
6f5efba
Merge branch 'master' of github.com:JetBrains/lets-plot
ASmirnov-HORIS Sep 27, 2021
83eda98
Merge branch 'master' into sphinx-doc
ASmirnov-HORIS Sep 27, 2021
f0178b3
Remove extra datasets from the docs/ directory.
ASmirnov-HORIS Sep 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docstrings for the stat_corr() function.
  • Loading branch information
ASmirnov-HORIS committed Aug 30, 2021
commit 0cb2498b6fee319395a8bc32f8f5275bd9213dc4
114 changes: 84 additions & 30 deletions python-package/lets_plot/plot/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,107 @@ def stat_corr(mapping=None, *, data=None, geom=None, position=None, show_legend=
threshold=None,
**other_args):
"""
Computes correlations between numeric variables in the 'data'
and draws a correlation matrix.
By default uses the 'tile' geometry.

The correlation statistic computes the following variables that can be used in
the aesthetic mapping:
- '..x..' : X coordinates
- '..y..' : Y coordinates
- '..corr..' : correlation (in range -1..1)
- '..corr_abs..' : absolute value of correlation (in range 0..1)
Computes correlations between numeric variables in the `data` and draws a correlation matrix.
By default uses the `tile` geometry.

Parameters
----------
mapping : set of aesthetic mappings created by aes() function.
mapping : `FeatureSpec`
Set of aesthetic mappings created by `aes()` function.
Aesthetic mappings describe the way that variables in the data are
mapped to plot "aesthetics".
data : dictionary or pandas DataFrame, optional
data : dict or `DataFrame` or `GeoDataFrame`
The data to be displayed in this layer. If None, the default, the data
is inherited from the plot data as specified in the call to ggplot.
geom : string, optional
The name of 'geometry' used to draw correlation matrix.
geom : str
The name of geometry used to draw correlation matrix.
For example: 'tile' or 'point' or 'text'.
position : string, optional
Position adjustment, either as a string ("identity", "stack", "dodge",...), or the result of a call to a
position adjustment function.
show_legend: bool
position : str or `FeatureSpec`
Position adjustment, either as a string ('identity', 'stack', 'dodge', ...),
or the result of a call to a position adjustment function.
show_legend : bool, default=True
False - do not show legend for this layer.
sampling : result of the call to the sampling_xxx() function.
Value 'none' will disable sampling for this layer.
tooltips : result of the call to the layer_tooltips() function.
sampling : `FeatureSpec`
Result of the call to the `sampling_xxx()` function.
Value None (or 'none') will disable sampling for this layer.
tooltips : `layer_tooltips`
Result of the call to the `layer_tooltips()` function.
Specifies appearance, style and content.
type : string
Type of matrix. Possible values - "upper", "lower", "full".
Default - "full".
diag : Boolean
type : {'upper', 'lower', 'full'}, default='full'
Type of matrix.
diag : bool
Determines whether to fill the main diagonal with values.
Default - True if 'full' matrix, else - False.
flip : Boolean
flip : bool, default=True
If True the y axis is flipped.
Default - True.
threshold: Double
threshold : float, default=0.0
Minimal correlation abs value to be included in result.
Default - 0.0.

Returns
-------
geom object specification
`LayerSpec`
Geom object specification.

Note
----
The correlation statistic computes the following variables that can be used in the aesthetic mapping:

- ..x.. : X coordinates.
- ..y.. : Y coordinates.
- ..corr.. : correlation (in range -1..1).
- ..corr_abs.. : absolute value of correlation (in range 0..1).

Examples
--------
.. jupyter-execute::
:linenos:
:emphasize-lines: 6

import numpy as np
from lets_plot import *
LetsPlot.setup_html()
np.random.seed(42)
data = {var: np.random.poisson(size=10) for var in 'abcdef'}
ggplot(data) + stat_corr() + coord_fixed()

|

.. jupyter-execute::
:linenos:
:emphasize-lines: 7-9

import numpy as np
from lets_plot import *
LetsPlot.setup_html()
np.random.seed(42)
data = {var: np.random.uniform(size=10) for var in 'abcd'}
ggplot(data) + \\
stat_corr(type='upper', diag=True, color='white') + \\
stat_corr(aes(size='..corr_abs..'), geom='text', \\
type='upper', diag=True, color='black') + \\
scale_fill_brewer(type='div', palette='RdYlBu', limits=[-1, 1]) + \\
coord_fixed()

|

.. jupyter-execute::
:linenos:
:emphasize-lines: 7-10

import numpy as np
from lets_plot import *
LetsPlot.setup_html()
np.random.seed(42)
data = {var: np.random.normal(size=10) for var in 'abcdef'}
ggplot(data) + \\
stat_corr(aes(size='..corr_abs..'), geom='point', \\
type='upper', flip=False, threshold=.4) + \\
stat_corr(geom='text', type='lower', \\
flip=False, threshold=.4) + \\
scale_color_gradient2(low='#d73027', mid='#ffffbf', \\
high='#1a9850', limits=[-1, 1]) + \\
coord_fixed()

"""

geom = geom if geom else "tile"
Expand Down