def plot_that_chroma(colorspaces, points, display_spectrum=False): """Plot chromaticities Args: colorspaces [colorspace]: a list of standard colorspaces """ # Init diagram plt.xlabel('chromaticity x') plt.ylabel('chromaticity y') plt.title("Standard Gamut") plt.grid(True) if colorspaces: # Init option colors_it = itertools.cycle(mplh.COLORS) for colorspace in colorspaces: try: merged_dict = dict(COLORSPACES, **PRIVATE_COLORSPACES) colorspace_obj = merged_dict[colorspace] except KeyError: raise PlotThatChromaException(("Unsupported {0} Colorspace !"). format(colorspace)) mplh.plot_colorspace_gamut(colorspace_obj, lines_color=colors_it.next()) if points: for point in points: mplh.plot_points(point[0], point[1]) if display_spectrum: mplh.plot_spectrum_locus_31() plt.legend(loc=4) plt.show()
def plot_that_chroma(colorspaces, points, display_spectrum=False): """Plot chromaticities Args: colorspaces [colorspace]: a list of standard colorspaces """ # Init diagram plt.xlabel('chromaticity x') plt.ylabel('chromaticity y') plt.title("Standard Gamut") plt.grid(True) if colorspaces: # Init option colors_it = itertools.cycle(mplh.COLORS) for colorspace in colorspaces: try: merged_dict = dict(COLORSPACES, **PRIVATE_COLORSPACES) colorspace_obj = merged_dict[colorspace] except KeyError: raise PlotThatChromaException( ("Unsupported {0} Colorspace !").format(colorspace)) mplh.plot_colorspace_gamut(colorspace_obj, lines_color=next(colors_it)) if points: for point in points: mplh.plot_points(point[0], point[1]) if display_spectrum: mplh.plot_spectrum_locus_31() plt.legend(loc=4) plt.show()
def test_chroma_plot(self): """Plot spectrum locus and standard gamut """ plt.xlabel('chromaticity x') plt.ylabel('chromaticity y') plt.title("Standard Gamut") plt.axis([-0.1, 0.8, -0.4, 0.65]) plt.grid(True) mplh.plot_spectrum_locus_76() mplh.plot_colorspace_gamut(colorspaces.ACES, lines_color="c", upvp_conversion=True) mplh.plot_colorspace_gamut(colorspaces.REC709, lines_color="m", upvp_conversion=True) plt.legend(loc=4) plt.show()