Skip to content

Commit 915e16f

Browse files
committed
Colormaps: fixed/comp. documentation
1 parent 119df34 commit 915e16f

16 files changed

Lines changed: 113 additions & 32 deletions

File tree

doc/dev/guiqwt_to_plotpy.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ guiqwt v4,plotpy v2,API changes
3131
``guiqwt.pyplot``,``plotpy.pyplot``
3232
``guiqwt.styles``,``plotpy.styles``
3333
``guiqwt.tools``,``plotpy.tools``
34-
``guiqwt.colormap``,``plotpy.mathutils.colormap``
34+
``guiqwt.colormap``,``plotpy.mathutils.colormaps``
3535
``guiqwt.geometry``,``plotpy.mathutils.geometry``
3636
``guiqwt.qthelpers.exec_image_save_dialog``,``plotpy.widgets.imagefile.exec_image_save_dialog``
3737
``guiqwt.qthelpers.exec_image_open_dialog``,``plotpy.widgets.imagefile.exec_image_open_dialog``

doc/dev/v1_to_v2.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ plotpy v1,plotpy v2 (and v1.99+)
1818
``.gui.widgets.histogram.ContrastAdjustment``,``.panels.contrastadjustment.ContrastAdjustment``
1919
``.gui.widgets.io``,``.io``
2020
``.gui.widgets.io.eliminate_outliers``,*removed*
21-
``.gui.widgets.colormap``,``.mathutils.colormap``
21+
``.gui.widgets.colormap``,``.mathutils.colormaps``
2222
``.gui.widgets.debug``,*removed*
2323
``.gui.widgets.debug.buttons_to_str``,``.events.buttons_to_str``
2424
``.gui.widgets.debug.evt_type_to_str``,``.events.evt_type_to_str``

doc/features/colormapmanager.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. automodule:: plotpy.widgets.colormap

doc/features/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Plot widgets with integrated plot manager:
4747
tools/index
4848
styles/index
4949
panels/index
50+
colormapmanager
5051
fit
5152
pyplot
5253
resizedialog

doc/features/mathutils/colormap.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. automodule:: plotpy.mathutils.colormaps

doc/features/mathutils/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Utilities
77

88
geometry
99
scaler
10-
colormap
10+
colormaps

doc/features/tools/reference.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Reference
33

44
.. autoclass:: plotpy.tools.GuiTool
55
:members:
6+
.. autoclass:: plotpy.tools.GuiToolT
7+
:members:
68
.. autoclass:: plotpy.tools.InteractiveTool
79
:members:
810
.. autoclass:: plotpy.tools.CommandTool

plotpy/items/curve/base.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,11 @@ def __setstate__(self, state: tuple) -> None:
257257

258258
def serialize(
259259
self,
260-
writer: guidata.dataset.io.HDF5Writer
261-
| guidata.dataset.io.INIWriter
262-
| guidata.dataset.io.JSONWriter,
260+
writer: (
261+
guidata.dataset.io.HDF5Writer
262+
| guidata.dataset.io.INIWriter
263+
| guidata.dataset.io.JSONWriter
264+
),
263265
) -> None:
264266
"""Serialize object to HDF5 writer
265267
@@ -274,9 +276,11 @@ def serialize(
274276

275277
def deserialize(
276278
self,
277-
reader: guidata.dataset.io.HDF5Reader
278-
| guidata.dataset.io.INIReader
279-
| guidata.dataset.io.JSONReader,
279+
reader: (
280+
guidata.dataset.io.HDF5Reader
281+
| guidata.dataset.io.INIReader
282+
| guidata.dataset.io.JSONReader
283+
),
280284
) -> None:
281285
"""Deserialize object from HDF5 reader
282286
@@ -389,8 +393,8 @@ def set_data(self, x: np.ndarray, y: np.ndarray) -> None:
389393
x: X data
390394
y: Y data
391395
decimated_data: Set to True if CurveItem X and Y arrays are already set and
392-
this method is called to update decimated data (i.e. only update 1/N value
393-
with N set in CurveItem.param.decimation).
396+
this method is called to update decimated data (i.e. only update 1/N value
397+
with N set in CurveItem.param.decimation).
394398
"""
395399
self._x = np.array(x, copy=False)
396400
self._y = np.array(y, copy=False)

plotpy/mathutils/colormaps.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,32 @@
44
# (see plotpy/LICENSE for details)
55

66
"""
7-
This module provides utilities to interact with colormap. It provides functions
8-
to load/save colormaps from/to json files and to build icons representing the
9-
colormaps.
7+
Colormap functions
8+
------------------
9+
10+
Overview
11+
^^^^^^^^
12+
13+
The :py:mod:`.colormap` module contains definition of common colormaps and tools
14+
to manipulate and create them.
15+
16+
The following functions are available:
17+
18+
* :py:func:`.get_cmap`: get a colormap from its name
19+
* :py:func:`.cmap_exists`: check if a colormap exists
20+
* :py:func:`.add_cmap`: add a colormap to the list of available colormaps
21+
* :py:func:`.build_icon_from_cmap`: build an icon representing the colormap
22+
* :py:func:`.build_icon_from_cmap_name`: build an icon representing the colormap
23+
from its name
24+
25+
Reference
26+
^^^^^^^^^
27+
28+
.. autofunction:: get_cmap
29+
.. autofunction:: cmap_exists
30+
.. autofunction:: add_cmap
31+
.. autofunction:: build_icon_from_cmap
32+
.. autofunction:: build_icon_from_cmap_name
1033
"""
1134

1235
from __future__ import annotations

0 commit comments

Comments
 (0)