<s> """<STR_LIT>""" <EOL> __version__ = "<STR_LIT>" <EOL> import argparse <EOL> import matplotlib . pyplot as plt <EOL> from utils import matplotlib_helper as mplh <EOL> from utils . colorspaces import COLORSPACES <EOL> from utils . private_colorspaces import PRIVATE_COLORSPACES <EOL> import itertools <EOL> import sys <EOL> class PlotThatChromaException ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def plot_that_chroma ( colorspaces , points , display_spectrum = False ) : <EOL> """<STR_LIT>""" <EOL> plt . xlabel ( '<STR_LIT>' ) <EOL> plt . ylabel ( '<STR_LIT>' ) <EOL> plt . title ( "<STR_LIT>" ) <EOL> plt . grid ( True ) <EOL> if colorspaces : <EOL> colors_it = itertools . cycle ( mplh . COLORS ) <EOL> for colorspace in colorspaces : <EOL> try : <EOL> merged_dict = dict ( COLORSPACES , ** PRIVATE_COLORSPACES ) <EOL> colorspace_obj = merged_dict [ colorspace ] <EOL> except KeyError : <EOL> raise PlotThatChromaException ( ( "<STR_LIT>" ) . <EOL> format ( colorspace ) ) <EOL> mplh . plot_colorspace_gamut ( colorspace_obj , <EOL> lines_color = colors_it . next ( ) ) <EOL> if points : <EOL> for point in points : <EOL> mplh . plot_points ( point [ <NUM_LIT:0> ] , point [ <NUM_LIT:1> ] ) <EOL> if display_spectrum : <EOL> mplh . plot_spectrum_locus_31 ( ) <EOL> plt . legend ( loc = <NUM_LIT:4> ) <EOL> plt . show ( ) <EOL> def __get_options ( ) : <EOL> """<STR_LIT>""" <EOL> description = '<STR_LIT>' <EOL> parser = argparse . ArgumentParser ( description = description ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = ( "<STR_LIT>" ) , <EOL> type = str , action = '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> choices = sorted ( COLORSPACES . keys ( ) + <EOL> PRIVATE_COLORSPACES . keys ( ) ) ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , type = float , nargs = <NUM_LIT:2> , <EOL> metavar = ( '<STR_LIT:x>' , '<STR_LIT:y>' ) , action = '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> return parser <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> PARSER = __get_options ( ) <EOL> ARGS = PARSER . parse_args ( ) <EOL> if len ( sys . argv ) < <NUM_LIT:2> : <EOL> print "<STR_LIT>" <EOL> PARSER . print_help ( ) <EOL> else : <EOL> plot_that_chroma ( ARGS . colorspaces , ARGS . points , ARGS . spectrum_locus ) </s>
