Skip to content

Commit 4e49f07

Browse files
committed
Add docs for several flags
Add documentation for the point-size, scale-function, and spacing flags. Also rename the pointsize flag to point-size to keep the flag naming consistent.
1 parent b73387a commit 4e49f07

12 files changed

+89
-2
lines changed

blendplot/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def blendplot(app):
2626
app.params.z
2727
]
2828
spacing = app.params.spacing
29-
point_size = app.params.pointsize
29+
point_size = app.params.point_size
3030
category_column = app.params.category
3131
scale_function = app.params.scale_function
3232

@@ -40,7 +40,7 @@ def blendplot(app):
4040

4141
blendplot.add_param("-r", "--rows", help="number of rows from the data file to plot", default=None, type=int)
4242
blendplot.add_param("--spacing", help="the scaling factor to space the data out by", default=2.0, type=float)
43-
blendplot.add_param("--pointsize", help="the size to use for the data points", default=0.0625, type=float)
43+
blendplot.add_param("--point-size", help="the size to use for the data points", default=0.0625, type=float)
4444
blendplot.add_param("-c", "--category", help="the column to use for point categorization", default=None, type=str)
4545
blendplot.add_param("--scale-function", help="the function to use for scaling the data, valid options are \"maxabs_scale\", \"minmax_scale\", \"normalize\", \"robust_scale\", \"scale\", and \"none\"", default="scale", type=str)
4646

docs/more_features.rst

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,90 @@ For example, the following command will plot only the first 20 points in the dat
2828
::
2929

3030
blendplot data.csv model.obj height weight cost --rows 20
31+
32+
Changing the Point Size
33+
-----------------------
34+
35+
If you have data that is particularly dense or spread out and want to change the size of the cubes generated for each point, then you can use the ``--pointsize`` flag. When you use the flag and specify a point size, then all of the points will be of that size. The default point size is ``0.0625``.
36+
37+
For example, the following command will increase the size of the points to ``0.2``
38+
39+
::
40+
41+
blendplot data.csv model.obj height weight cost --point-size 0.2
42+
43+
+-----------------------------------------+----------------------------------------+
44+
| 0.0625 | 0.2 |
45+
+-----------------------------------------+----------------------------------------+
46+
| .. image:: ../img/point_size_normal.png | .. image:: ../img/point_size_large.png |
47+
| :height: 321px | :height: 321px |
48+
| :width: 280px | :width: 280px |
49+
| :scale: 100 % | :scale: 100 % |
50+
| :align: center | :align: center |
51+
+-----------------------------------------+----------------------------------------+
52+
53+
54+
Changing the Spacing of the Points
55+
----------------------------------
56+
57+
If you want to change the spacing between the points, then there are two related flags that you can use to change it ``--scale-function`` and ``--spacing``.
58+
59+
Scale Function
60+
~~~~~~~~~~~~~~
61+
62+
Blendplot applies a scaling function to the input data to get it tofit into a reasonable space and account for differences in the magnitude of different variables. By default, it uses the ``preprocessing.scale`` function from the ``sklearn`` library, however using the ``--scale-function`` flag it can be configured to use other scaling functions or no scaling function at all.
63+
64+
For example, the following command will plot the dataset using the ``normalize`` scaling function.
65+
66+
::
67+
68+
blendplot data.csv model.obj height weight cost --scale-function normalize
69+
70+
The following scaling functions are supported.
71+
72+
+---------------------------------------------------+---------------------------------------------------+
73+
| maxabs_scale | minmax_scale |
74+
+---------------------------------------------------+---------------------------------------------------+
75+
| .. image:: ../img/scale_function_maxabs_scale.png | .. image:: ../img/scale_function_minmax_scale.png |
76+
| :height: 321px | :height: 321px |
77+
| :width: 280px | :width: 280px |
78+
| :scale: 100 % | :scale: 100 % |
79+
| :align: center | :align: center |
80+
+---------------------------------------------------+---------------------------------------------------+
81+
| normalize | robust_scale |
82+
+---------------------------------------------------+---------------------------------------------------+
83+
| .. image:: ../img/scale_function_normalize.png | .. image:: ../img/scale_function_robust_scale.png |
84+
| :height: 321px | :height: 321px |
85+
| :width: 280px | :width: 280px |
86+
| :scale: 100 % | :scale: 100 % |
87+
| :align: center | :align: center |
88+
+---------------------------------------------------+---------------------------------------------------+
89+
| scale | none |
90+
+---------------------------------------------------+---------------------------------------------------+
91+
| .. image:: ../img/scale_function_scale.png | .. image:: ../img/scale_function_none.png |
92+
| :height: 321px | :height: 321px |
93+
| :width: 280px | :width: 280px |
94+
| :scale: 100 % | :scale: 100 % |
95+
| :align: center | :align: center |
96+
+---------------------------------------------------+---------------------------------------------------+
97+
98+
Spacing
99+
~~~~~~~
100+
101+
You can also change the point spacing by setting a spacing ratio using the ``--spacing`` flag. The (x,y,z) coordinates for each point are multiplied by the spacing ratio in order to control the spacing between data points. By default, a spacing ratio of ``2.0`` is used.
102+
103+
For example, the following command will plot the data with a larger spacing ratio of ``4.0``.
104+
105+
::
106+
107+
blendplot data.csv model.obj height weight cost --spacing 4.0
108+
109+
+--------------------------------------+-------------------------------------+
110+
| 2.0 | 4.0 |
111+
+--------------------------------------+-------------------------------------+
112+
| .. image:: ../img/spacing_normal.png | .. image:: ../img/spacing_large.png |
113+
| :height: 321px | :height: 321px |
114+
| :width: 280px | :width: 280px |
115+
| :scale: 100 % | :scale: 100 % |
116+
| :align: center | :align: center |
117+
+--------------------------------------+-------------------------------------+

img/point_size_large.png

26.6 KB
Loading

img/point_size_normal.png

19.4 KB
Loading
13.7 KB
Loading
20.1 KB
Loading

img/scale_function_none.png

25.1 KB
Loading

img/scale_function_normalize.png

6.45 KB
Loading
11.9 KB
Loading

img/scale_function_scale.png

19.4 KB
Loading

0 commit comments

Comments
 (0)