def configure_plot_parser(subparsers: argparse._SubParsersAction) -> None:
"""Add a logging parser to an existing argparser.
Args:
subparsers: The parser object to be appended to.
"""
parser = subparsers.add_parser('plot',
description='Generates summary graph(s) from a saved search json file',
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
allow_abbrev=False)
parser.add_argument('search_path',
metavar='<File Path>',
type=str,
help="The path to a json file summarizing a search object")
parser.add_argument('--ignore',
metavar='I',
type=str,
nargs='+',
help="The names of parameters or results to ignore when visualizing")
parser.add_argument('--title',
metavar='T',
type=str,
help="A custom title for the generated plot",
default=None)
parser.add_argument('--draw',
metavar='D',
choices=['cartesian', 'heatmap', 'parallel'],
help="Force the system to attempt to draw a particular type of plot. This may raise an error if"
" the given search instance is incompatible with the desired type of visualization. "
"Choices are 'cartesian', 'heatmap', or 'parallel'.",
default=None)
parser.add_argument('--color_by',
metavar='C',
type=str,
help="Override the key used to color parallel coordinate plots",
default=None)
parser.add_argument('-G',
'--group',
action='append',
type=str,
nargs='+',
help="Group multiple results onto the same cartesian plot")
save_group = parser.add_argument_group('output arguments')
save_x_group = save_group.add_mutually_exclusive_group(required=False)
save_x_group.add_argument(
'--save',
nargs='?',
metavar='<Save Dir>',
dest='save',
action=SaveAction,
default=False,
help="Save the output image. May be accompanied by a directory into \
which the file is saved. If no output directory is specified, the log \
directory will be used")
save_x_group.add_argument('--display',
dest='save',
action='store_false',
help="Render the image to the UI (rather than saving it)",
default=True)
save_x_group.set_defaults(save_dir=None)
parser.set_defaults(func=search)