Skip to content

Commit

Permalink
Documentation for lux.config.plotting_scale (#379)
Browse files Browse the repository at this point in the history
* Use altair/Choropleth.py in MatpltlibRenderer.py to render choropleths; include warning

* Docs for scale factor

* Clean diff

* Resolve comments
  • Loading branch information
micahtyong authored May 26, 2021
1 parent 28eb354 commit 65fa234
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions doc/source/reference/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,43 @@ If you try to set the default_display to anything other than 'lux' or 'pandas,'
:width: 700
:align: center


Change the plotting scale
~~~~~~~~~~~~~~~~~~~~~~~~~~~

We can adjust the sizes of charts displayed in the Lux widget based on a :code:`plotting_scale` applied to all charts. The default plotting scale is set to 1, displayed as followed:

.. image:: https://github.com/lux-org/lux-resources/blob/master/doc_img/scale-0.png?raw=true
:width: 700
:align: center

In the following block, we set the :code:`plotting_scale` to 2. We see that the Lux widget displays charts two times larger than the default.

.. code-block:: python
lux.config.plotting_scale = 2
df
.. image:: https://github.com/lux-org/lux-resources/blob/master/doc_img/scale-1.png?raw=true
:width: 700
:align: center

When further operations are performed (e.g., specifying intent), the user-defined plotting scale continues to apply to both the current visualization and recommended charts. In addition to specifying :code:`plotting_scale` as a positive float (i.e., >1.0, enlarging the charts), :code:`plotting_scale` can also take in any positive float between [0,1] to shrink the size of the charts.


.. code-block:: python
lux.config.plotting_scale = 0.5
df
.. image:: https://github.com/lux-org/lux-resources/blob/master/doc_img/scale-3.png?raw=true
:width: 700
:align: center

The :code:`plotting_scale` config takes in any positive float or integer and functions for both Altair and Matplotlib plotting backends.



Change plotting backend for rendering visualizations in Lux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
3 changes: 2 additions & 1 deletion doc/source/reference/gen/lux._config.config.Config.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lux.\_config.config.Config
lux.\_config.config.Config
==========================

.. currentmodule:: lux._config.config
Expand Down Expand Up @@ -32,6 +32,7 @@ lux.\_config.config.Config
~Config.interestingness_fallback
~Config.pandas_fallback
~Config.plotting_backend
~Config.plotting_scale
~Config.sampling
~Config.sampling_cap
~Config.sampling_start
Expand Down

0 comments on commit 65fa234

Please sign in to comment.