Skip to content

Commit 2263e01

Browse files
committed
Merge branch 'feature/v0.4.3' into develop
2 parents 117d310 + a8625b5 commit 2263e01

13 files changed

+64
-55
lines changed

colour/plotting/characterisation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def plot_multi_colour_checkers(
193193
"compare_swatches": "Stacked" if compare_swatches else None,
194194
}
195195
settings.update(kwargs)
196-
settings["standalone"] = False
196+
settings["show"] = False
197197

198198
plot_multi_colour_swatches(colour_swatches, **settings)
199199

@@ -215,7 +215,7 @@ def plot_multi_colour_checkers(
215215
settings.update(
216216
{
217217
"axes": axes,
218-
"standalone": True,
218+
"show": True,
219219
"title": ", ".join(colour_checker_names),
220220
}
221221
)

colour/plotting/colorimetry.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def plot_visible_spectrum(
786786

787787
settings: Dict[str, Any] = {"bounding_box": bounding_box, "y_label": None}
788788
settings.update(kwargs)
789-
settings["standalone"] = False
789+
settings["show"] = False
790790

791791
_figure, axes = plot_single_sd(
792792
sd_ones(cmfs.shape),
@@ -800,7 +800,7 @@ def plot_visible_spectrum(
800800

801801
settings = {
802802
"axes": axes,
803-
"standalone": True,
803+
"show": True,
804804
"title": f"The Visible Spectrum - {cmfs.display_name}",
805805
"x_label": "Wavelength $\\lambda$ (nm)",
806806
}
@@ -1066,7 +1066,7 @@ def plot_blackbody_spectral_radiance(
10661066
"y_label": "W / (sr m$^2$) / m",
10671067
}
10681068
settings.update(kwargs)
1069-
settings["standalone"] = False
1069+
settings["show"] = False
10701070

10711071
plot_single_sd(sd, cmfs.name, **settings)
10721072

@@ -1087,11 +1087,11 @@ def plot_blackbody_spectral_radiance(
10871087
"y_ticker": False,
10881088
}
10891089
settings.update(kwargs)
1090-
settings["standalone"] = False
1090+
settings["show"] = False
10911091

10921092
figure, axes = plot_single_colour_swatch(RGB, **settings)
10931093

1094-
settings = {"axes": axes, "standalone": True}
1094+
settings = {"axes": axes, "show": True}
10951095
settings.update(kwargs)
10961096

10971097
return render(**settings)

colour/plotting/common.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
runtime_warning,
7777
validate_method,
7878
)
79+
from colour.utilities.deprecation import handle_arguments_deprecation
7980

8081
__author__ = "Colour Developers"
8182
__copyright__ = "Copyright 2013 Colour Developers"
@@ -564,7 +565,7 @@ class KwargsRender(TypedDict):
564565
Axes to apply the render elements onto.
565566
filename
566567
Figure will be saved using given ``filename`` argument.
567-
standalone
568+
show
568569
Whether to show the figure and call :func:`matplotlib.pyplot.show`
569570
definition.
570571
aspect
@@ -600,7 +601,7 @@ class KwargsRender(TypedDict):
600601
figure: plt.Figure
601602
axes: plt.Axes
602603
filename: str
603-
standalone: bool
604+
show: bool
604605
aspect: Literal["auto", "equal"] | float
605606
axes_visible: bool
606607
bounding_box: ArrayLike
@@ -636,10 +637,17 @@ def render(**kwargs: KwargsRender | Any) -> Tuple[plt.Figure, plt.Axes]:
636637
figure = cast(plt.Figure, kwargs.get("figure", plt.gcf()))
637638
axes = cast(plt.Axes, kwargs.get("axes", plt.gca()))
638639

640+
handle_arguments_deprecation(
641+
{
642+
"ArgumentRenamed": [["standalone", "show"]],
643+
},
644+
**kwargs,
645+
)
646+
639647
settings = Structure(
640648
**{
641649
"filename": None,
642-
"standalone": True,
650+
"show": True,
643651
"aspect": None,
644652
"axes_visible": True,
645653
"bounding_box": None,
@@ -683,11 +691,12 @@ def render(**kwargs: KwargsRender | Any) -> Tuple[plt.Figure, plt.Axes]:
683691

684692
if settings.transparent_background:
685693
figure.patch.set_alpha(0)
686-
if settings.standalone:
687-
if settings.filename is not None:
688-
figure.savefig(settings.filename)
689-
else:
690-
plt.show()
694+
695+
if settings.filename is not None:
696+
figure.savefig(settings.filename)
697+
698+
if settings.show:
699+
plt.show()
691700

692701
return figure, axes
693702

colour/plotting/corresponding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def plot_corresponding_chromaticities_prediction(
108108

109109
settings = {"axes": axes, "title": title}
110110
settings.update(kwargs)
111-
settings["standalone"] = False
111+
settings["show"] = False
112112

113113
plot_chromaticity_diagram_CIE1976UCS(**settings)
114114

@@ -164,7 +164,7 @@ def plot_corresponding_chromaticities_prediction(
164164

165165
settings.update(
166166
{
167-
"standalone": True,
167+
"show": True,
168168
"bounding_box": (-0.1, 0.7, -0.1, 0.7),
169169
}
170170
)

colour/plotting/diagrams.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -577,15 +577,15 @@ def plot_chromaticity_diagram(
577577
if show_diagram_colours:
578578
settings = {"axes": axes, "method": method, "diagram_colours": "RGB"}
579579
settings.update(kwargs)
580-
settings["standalone"] = False
580+
settings["show"] = False
581581
settings["cmfs"] = cmfs
582582

583583
plot_chromaticity_diagram_colours(**settings)
584584

585585
if show_spectral_locus:
586586
settings = {"axes": axes, "method": method}
587587
settings.update(kwargs)
588-
settings["standalone"] = False
588+
settings["show"] = False
589589
settings["cmfs"] = cmfs
590590

591591
plot_spectral_locus(**settings)
@@ -605,7 +605,7 @@ def plot_chromaticity_diagram(
605605
settings.update(
606606
{
607607
"axes": axes,
608-
"standalone": True,
608+
"show": True,
609609
"bounding_box": (0, 1, 0, 1),
610610
"title": title,
611611
"x_label": x_label,
@@ -913,7 +913,7 @@ def plot_sds_in_chromaticity_diagram(
913913
settings.update(
914914
{
915915
"axes": axes,
916-
"standalone": False,
916+
"show": False,
917917
"method": method,
918918
"cmfs": cmfs,
919919
}
@@ -1034,7 +1034,7 @@ def XYZ_to_ij(XYZ: NDArrayFloat) -> NDArrayFloat:
10341034

10351035
axes.annotate(sd.name, xy=ij, **annotate_settings)
10361036

1037-
settings.update({"standalone": True, "bounding_box": bounding_box})
1037+
settings.update({"show": True, "bounding_box": bounding_box})
10381038
settings.update(kwargs)
10391039

10401040
return render(**settings)

colour/plotting/models.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -535,14 +535,14 @@ def plot_RGB_colourspaces_in_chromaticity_diagram(
535535

536536
settings = {"axes": axes, "title": title, "method": method}
537537
settings.update(kwargs)
538-
settings["standalone"] = False
538+
settings["show"] = False
539539

540540
chromaticity_diagram_callable(**settings)
541541

542542
if show_pointer_gamut:
543543
settings = {"axes": axes, "method": method}
544544
settings.update(kwargs)
545-
settings["standalone"] = False
545+
settings["show"] = False
546546

547547
plot_pointer_gamut(**settings)
548548

@@ -653,7 +653,7 @@ def xy_to_ij(xy: NDArrayFloat) -> NDArrayFloat:
653653

654654
settings.update(
655655
{
656-
"standalone": True,
656+
"show": True,
657657
"legend": True,
658658
"bounding_box": bounding_box,
659659
}
@@ -1032,7 +1032,7 @@ def plot_RGB_chromaticities_in_chromaticity_diagram(
10321032
scatter_settings.update(scatter_kwargs)
10331033

10341034
settings = dict(kwargs)
1035-
settings.update({"axes": axes, "standalone": False})
1035+
settings.update({"axes": axes, "show": False})
10361036

10371037
colourspace = cast(
10381038
RGB_Colourspace,
@@ -1076,7 +1076,7 @@ def plot_RGB_chromaticities_in_chromaticity_diagram(
10761076

10771077
axes.scatter(ij[..., 0], ij[..., 1], **scatter_settings)
10781078

1079-
settings.update({"standalone": True})
1079+
settings.update({"show": True})
10801080
settings.update(kwargs)
10811081

10821082
return render(**settings)
@@ -1453,7 +1453,7 @@ def plot_ellipses_MacAdam1942_in_chromaticity_diagram(
14531453
_figure, axes = artist(**settings)
14541454

14551455
settings = dict(kwargs)
1456-
settings.update({"axes": axes, "standalone": False})
1456+
settings.update({"axes": axes, "show": False})
14571457

14581458
ellipses_coefficients = ellipses_MacAdam1942(method=method)
14591459

@@ -1512,7 +1512,7 @@ def plot_ellipses_MacAdam1942_in_chromaticity_diagram(
15121512
)
15131513
axes.add_artist(ellipse)
15141514

1515-
settings.update({"standalone": True})
1515+
settings.update({"show": True})
15161516
settings.update(kwargs)
15171517

15181518
return render(**settings)

colour/plotting/phenomena.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def plot_the_blue_sky(
195195
"y_label": "W / m-2 / nm-1",
196196
}
197197
settings.update(kwargs)
198-
settings["standalone"] = False
198+
settings["show"] = False
199199

200200
plot_single_sd(sd, cmfs, **settings)
201201

@@ -219,15 +219,15 @@ def plot_the_blue_sky(
219219
"y_ticker": False,
220220
}
221221
settings.update(kwargs)
222-
settings["standalone"] = False
222+
settings["show"] = False
223223

224224
blue_sky_color = XYZ_to_plotting_colourspace(sd_to_XYZ(sd))
225225

226226
figure, axes = plot_single_colour_swatch(
227227
ColourSwatch(normalise_maximum(blue_sky_color)), **settings
228228
)
229229

230-
settings = {"axes": axes, "standalone": True}
230+
settings = {"axes": axes, "show": True}
231231
settings.update(kwargs)
232232

233233
return render(**settings)

colour/plotting/quality.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def plot_multi_sds_colour_rendering_indexes_bars(
335335
sds_converted = sds_and_msds_to_sds(sds)
336336

337337
settings: Dict[str, Any] = dict(kwargs)
338-
settings.update({"standalone": False})
338+
settings.update({"show": False})
339339

340340
specifications = cast(
341341
List[ColourRendering_Specification_CRI],
@@ -474,7 +474,7 @@ def plot_multi_sds_colour_quality_scales_bars(
474474
sds_converted = sds_and_msds_to_sds(sds)
475475

476476
settings: Dict[str, Any] = dict(kwargs)
477-
settings.update({"standalone": False})
477+
settings.update({"show": False})
478478

479479
specifications = cast(
480480
List[ColourRendering_Specification_CQS],

colour/plotting/section.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ def plot_visible_spectrum_section(
596596
if show_section_colours:
597597
settings = {"axes": axes}
598598
settings.update(kwargs)
599-
settings["standalone"] = False
599+
settings["show"] = False
600600

601601
plot_hull_section_colours(
602602
hull, model, axis, origin, normalise, **settings
@@ -605,7 +605,7 @@ def plot_visible_spectrum_section(
605605
if show_section_contour:
606606
settings = {"axes": axes}
607607
settings.update(kwargs)
608-
settings["standalone"] = False
608+
settings["show"] = False
609609

610610
plot_hull_section_contour(
611611
hull, model, axis, origin, normalise, **settings
@@ -628,7 +628,7 @@ def plot_visible_spectrum_section(
628628
settings.update(
629629
{
630630
"axes": axes,
631-
"standalone": True,
631+
"show": True,
632632
"title": title,
633633
"x_label": x_label,
634634
"y_label": y_label,
@@ -749,7 +749,7 @@ def plot_RGB_colourspace_section(
749749
if show_section_colours:
750750
settings = {"axes": axes}
751751
settings.update(kwargs)
752-
settings["standalone"] = False
752+
settings["show"] = False
753753

754754
plot_hull_section_colours(
755755
hull, model, axis, origin, normalise, **settings
@@ -758,7 +758,7 @@ def plot_RGB_colourspace_section(
758758
if show_section_contour:
759759
settings = {"axes": axes}
760760
settings.update(kwargs)
761-
settings["standalone"] = False
761+
settings["show"] = False
762762

763763
plot_hull_section_contour(
764764
hull, model, axis, origin, normalise, **settings
@@ -780,7 +780,7 @@ def plot_RGB_colourspace_section(
780780
settings.update(
781781
{
782782
"axes": axes,
783-
"standalone": True,
783+
"show": True,
784784
"title": title,
785785
"x_label": x_label,
786786
"y_label": y_label,

colour/plotting/temperature.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def plot_planckian_locus_in_chromaticity_diagram(
509509

510510
settings = {"axes": axes, "method": method}
511511
settings.update(kwargs)
512-
settings["standalone"] = False
512+
settings["show"] = False
513513

514514
chromaticity_diagram_callable(**settings)
515515

@@ -618,7 +618,7 @@ def xy_to_ij(xy: NDArrayFloat) -> NDArrayFloat:
618618
settings.update(
619619
{
620620
"axes": axes,
621-
"standalone": True,
621+
"show": True,
622622
"bounding_box": bounding_box,
623623
"title": title,
624624
}

0 commit comments

Comments
 (0)