Skip to content

Commit

Permalink
Merge branch 'feature/v0.4.3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Feb 16, 2023
2 parents 8790e15 + 49b1f55 commit 635e610
Show file tree
Hide file tree
Showing 17 changed files with 111 additions and 106 deletions.
7 changes: 2 additions & 5 deletions colour/difference/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
- :cite:`Lindbloom2003c` : Lindbloom, B. (2003). Delta E (CIE 1976).
Retrieved February 24, 2014, from
http://brucelindbloom.com/Eqn_DeltaE_CIE76.html
- :cite:`Lindbloom2009e` : Lindbloom, B. (2009). Delta E (CIE 2000).
Retrieved February 24, 2014, from
http://brucelindbloom.com/Eqn_DeltaE_CIE2000.html
- :cite:`Lindbloom2009f` : Lindbloom, B. (2009). Delta E (CMC). Retrieved
February 24, 2014, from http://brucelindbloom.com/Eqn_DeltaE_CMC.html
- :cite:`Lindbloom2011a` : Lindbloom, B. (2011). Delta E (CIE 1994).
Expand Down Expand Up @@ -110,8 +107,8 @@
References
----------
:cite:`ASTMInternational2007`, :cite:`Li2017`, :cite:`Lindbloom2003c`,
:cite:`Lindbloom2011a`, :cite:`Lindbloom2009e`, :cite:`Lindbloom2009f`,
:cite:`Luo2006b`, :cite:`Melgosa2013b`, :cite:`Wikipedia2008b`
:cite:`Lindbloom2011a`, :cite:`Lindbloom2009f`, :cite:`Luo2006b`,
:cite:`Melgosa2013b`, :cite:`Wikipedia2008b`
Aliases:
Expand Down
2 changes: 1 addition & 1 deletion colour/plotting/blindness.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def plot_cvd_simulation_Machado2009(
>>> import numpy as np
>>> RGB = np.random.rand(32, 32, 3)
>>> plot_cvd_simulation_Machado2009(RGB) # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_CVD_Simulation_Machado2009.png
:align: center
Expand Down
4 changes: 2 additions & 2 deletions colour/plotting/characterisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def plot_single_colour_checker(
Examples
--------
>>> plot_single_colour_checker("ColorChecker 2005") # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Single_Colour_Checker.png
:align: center
Expand Down Expand Up @@ -131,7 +131,7 @@ def plot_multi_colour_checkers(
--------
>>> plot_multi_colour_checkers(["ColorChecker 1976", "ColorChecker 2005"])
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Multi_Colour_Checkers.png
:align: center
Expand Down
34 changes: 20 additions & 14 deletions colour/plotting/colorimetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def plot_single_sd(
... }
>>> sd = SpectralDistribution(data, name="Custom")
>>> plot_single_sd(sd) # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Single_SD.png
:align: center
Expand Down Expand Up @@ -350,7 +350,7 @@ def plot_multi_sds(
... ]
>>> plot_multi_sds([sd_1, sd_2], plot_kwargs=plot_kwargs)
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Multi_SDS.png
:align: center
Expand Down Expand Up @@ -471,7 +471,7 @@ def plot_single_cmfs(
--------
>>> plot_single_cmfs("CIE 1931 2 Degree Standard Observer")
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Single_CMFS.png
:align: center
Expand Down Expand Up @@ -525,7 +525,7 @@ def plot_multi_cmfs(
... "CIE 1964 10 Degree Standard Observer",
... ]
>>> plot_multi_cmfs(cmfs) # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Multi_CMFS.png
:align: center
Expand Down Expand Up @@ -631,7 +631,7 @@ def plot_single_illuminant_sd(
Examples
--------
>>> plot_single_illuminant_sd("A") # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Single_Illuminant_SD.png
:align: center
Expand Down Expand Up @@ -688,7 +688,7 @@ def plot_multi_illuminant_sds(
Examples
--------
>>> plot_multi_illuminant_sds(["A", "B", "C"]) # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Multi_Illuminant_SDS.png
:align: center
Expand Down Expand Up @@ -771,7 +771,7 @@ def plot_visible_spectrum(
Examples
--------
>>> plot_visible_spectrum() # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Visible_Spectrum.png
:align: center
Expand All @@ -796,7 +796,13 @@ def plot_visible_spectrum(
)

# Removing wavelength line as it doubles with the axes spine.
axes.lines.pop(0)
# NOTE: Support for Matplotlib < 3.7
try:
axes.lines.pop(0)
except AttributeError:
# NOTE: Support for Matplotlib >= 3.7
for line in axes.lines:
line.remove()

settings = {
"axes": axes,
Expand Down Expand Up @@ -838,7 +844,7 @@ def plot_single_lightness_function(
Examples
--------
>>> plot_single_lightness_function("CIE 1976") # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Single_Lightness_Function.png
:align: center
Expand Down Expand Up @@ -883,7 +889,7 @@ def plot_multi_lightness_functions(
--------
>>> plot_multi_lightness_functions(["CIE 1976", "Wyszecki 1963"])
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Multi_Lightness_Functions.png
:align: center
Expand Down Expand Up @@ -933,7 +939,7 @@ def plot_single_luminance_function(
Examples
--------
>>> plot_single_luminance_function("CIE 1976") # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Single_Luminance_Function.png
:align: center
Expand Down Expand Up @@ -978,7 +984,7 @@ def plot_multi_luminance_functions(
--------
>>> plot_multi_luminance_functions(["CIE 1976", "Newhall 1943"])
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Multi_Luminance_Functions.png
:align: center
Expand Down Expand Up @@ -1042,7 +1048,7 @@ def plot_blackbody_spectral_radiance(
--------
>>> plot_blackbody_spectral_radiance(3500, blackbody="VY Canis Major")
... # doctest: +ELLIPSIS
(<Figure size ... with 2 Axes>, <...AxesSubplot...>)
(<Figure size ... with 2 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Blackbody_Spectral_Radiance.png
:align: center
Expand Down Expand Up @@ -1139,7 +1145,7 @@ def plot_blackbody_colours(
--------
>>> plot_blackbody_colours(SpectralShape(150, 12500, 50))
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Blackbody_Colours.png
:align: center
Expand Down
14 changes: 8 additions & 6 deletions colour/plotting/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def colour_style(use_style: bool = True) -> dict:
"lines.markersize": constants.geometry.short * 3,
"lines.markeredgewidth": constants.geometry.short * 0.75,
# Cycle
"axes.prop_cycle": matplotlib.cycler(color=constants.colour.cycle),
"axes.prop_cycle": matplotlib.cycler( # pyright: ignore
color=constants.colour.cycle
),
}

if use_style:
Expand Down Expand Up @@ -1136,7 +1138,7 @@ def plot_single_colour_swatch(
--------
>>> RGB = ColourSwatch((0.45620519, 0.03081071, 0.04091952))
>>> plot_single_colour_swatch(RGB) # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Single_Colour_Swatch.png
:align: center
Expand Down Expand Up @@ -1218,7 +1220,7 @@ def plot_multi_colour_swatches(
>>> RGB_1 = ColourSwatch((0.45293517, 0.31732158, 0.26414773))
>>> RGB_2 = ColourSwatch((0.77875824, 0.57726450, 0.50453169))
>>> plot_multi_colour_swatches([RGB_1, RGB_2]) # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Multi_Colour_Swatches.png
:align: center
Expand Down Expand Up @@ -1410,7 +1412,7 @@ def plot_single_function(
>>> from colour.models import gamma_function
>>> plot_single_function(partial(gamma_function, exponent=1 / 2.2))
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Single_Function.png
:align: center
Expand Down Expand Up @@ -1484,7 +1486,7 @@ def plot_multi_functions(
... }
>>> plot_multi_functions(functions)
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Multi_Functions.png
:align: center
Expand Down Expand Up @@ -1615,7 +1617,7 @@ def plot_image(
... "Ishihara_Colour_Blindness_Test_Plate_3.png",
... )
>>> plot_image(read_image(path)) # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Image.png
:align: center
Expand Down
2 changes: 1 addition & 1 deletion colour/plotting/corresponding.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def plot_corresponding_chromaticities_prediction(
--------
>>> plot_corresponding_chromaticities_prediction(1, "Von Kries")
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_\
Plot_Corresponding_Chromaticities_Prediction.png
Expand Down
20 changes: 10 additions & 10 deletions colour/plotting/diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def plot_spectral_locus(
Examples
--------
>>> plot_spectral_locus(spectral_locus_colours="RGB") # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Spectral_Locus.png
:align: center
Expand Down Expand Up @@ -422,7 +422,7 @@ def plot_chromaticity_diagram_colours(
--------
>>> plot_chromaticity_diagram_colours(diagram_colours="RGB")
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Chromaticity_Diagram_Colours.png
:align: center
Expand Down Expand Up @@ -557,7 +557,7 @@ def plot_chromaticity_diagram(
Examples
--------
>>> plot_chromaticity_diagram() # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Chromaticity_Diagram.png
:align: center
Expand Down Expand Up @@ -661,7 +661,7 @@ def plot_chromaticity_diagram_CIE1931(
Examples
--------
>>> plot_chromaticity_diagram_CIE1931() # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Chromaticity_Diagram_CIE1931.png
:align: center
Expand Down Expand Up @@ -717,7 +717,7 @@ def plot_chromaticity_diagram_CIE1960UCS(
Examples
--------
>>> plot_chromaticity_diagram_CIE1960UCS() # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Chromaticity_Diagram_CIE1960UCS.png
:align: center
Expand Down Expand Up @@ -773,7 +773,7 @@ def plot_chromaticity_diagram_CIE1976UCS(
Examples
--------
>>> plot_chromaticity_diagram_CIE1976UCS() # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_Chromaticity_Diagram_CIE1976UCS.png
:align: center
Expand Down Expand Up @@ -895,7 +895,7 @@ def plot_sds_in_chromaticity_diagram(
... [A, D65], annotate_kwargs=annotate_kwargs, plot_kwargs=plot_kwargs
... )
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_Plot_SDS_In_Chromaticity_Diagram.png
:align: center
Expand Down Expand Up @@ -1134,7 +1134,7 @@ class instances or a list of :class:`colour.SpectralDistribution` class
>>> D65 = SDS_ILLUMINANTS["D65"]
>>> plot_sds_in_chromaticity_diagram_CIE1931([A, D65])
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_\
Plot_SDS_In_Chromaticity_Diagram_CIE1931.png
Expand Down Expand Up @@ -1245,7 +1245,7 @@ class instances or a list of :class:`colour.SpectralDistribution` class
>>> D65 = SDS_ILLUMINANTS["D65"]
>>> plot_sds_in_chromaticity_diagram_CIE1960UCS([A, D65])
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_\
Plot_SDS_In_Chromaticity_Diagram_CIE1960UCS.png
Expand Down Expand Up @@ -1356,7 +1356,7 @@ class instances or a list of :class:`colour.SpectralDistribution` class
>>> D65 = SDS_ILLUMINANTS["D65"]
>>> plot_sds_in_chromaticity_diagram_CIE1976UCS([A, D65])
... # doctest: +ELLIPSIS
(<Figure size ... with 1 Axes>, <...AxesSubplot...>)
(<Figure size ... with 1 Axes>, <...>)
.. image:: ../_static/Plotting_\
Plot_SDS_In_Chromaticity_Diagram_CIE1976UCS.png
Expand Down
Loading

0 comments on commit 635e610

Please sign in to comment.