class_docstr: Main class producing plots. Each create_*() method reads group data from base_path and creates a plot at the
  save_path. create_all_plots() runs all these functions at once.
class_docstr_tok: ["Main","class","producing","plots",".","Each","create_","*","(",")","method","reads","group","data","from","base_path","and","creates","a","plot","at","the","save_path",".","create_all_plots","(",")","runs","all","these","functions","at","once","."]
docstr: Plot the accuracy of each scenario over some model property (e.g., number of parameters).
  Args:
      property_name: Property name displayed as x-label.
      model_name_to_property: A function that maps the name of the model to the property we use for the plot.
      cumulative: Plot the best accuracy achieved by a model with at most that property values (useful for dates).
      logscale: Whether we use a logscale for the x-axis.
      annotate_models: For each unique property value, add a text annotation with the corresponding model names.
docstr_tok: ["Plot","the","accuracy","of","each","scenario","over","some","model","property","(","e.g.",",","number","of","parameters",")",".","Args",":","property_name",":","Property","name","displayed","as","x-label",".","model_name_to_property",":","A","function","that","maps","the","name","of","the","model","to","the","property","we","use","for","the","plot",".","cumulative",":","Plot","the","best","accuracy","achieved","by","a","model","with","at","most","that","property","values","(","useful","for","dates",")",".","logscale",":","Whether","we","use","a","logscale","for","the","x-axis",".","annotate_models",":","For","each","unique","property","value",",","add","a","text","annotation","with","the","corresponding","model","names","."]
code: def create_accuracy_v_model_property_plot(
      self,
      property_name: str,
      model_name_to_property: Callable[[str], Any],
      cumulative: bool = False,
      logscale: bool = False,
      annotate_models: bool = True,
  ):
      """
      Plot the accuracy of each scenario over some model property (e.g., number of parameters).
      Args:
          property_name: Property name displayed as x-label.
          model_name_to_property: A function that maps the name of the model to the property we use for the plot.
          cumulative: Plot the best accuracy achieved by a model with at most that property values (useful for dates).
          logscale: Whether we use a logscale for the x-axis.
          annotate_models: For each unique property value, add a text annotation with the corresponding model names.
      """
      fig, ax = plt.subplots(1, 1, figsize=(11, 4))
      milestones: Dict[Any, Set[str]] = defaultdict(
          set
      )  # keep track of the models with each property value
      table = self.get_group_tables("core_scenarios")["Accuracy"]
      palette = get_color_palette(len(table.columns))
      for column, color in zip(table.columns, palette):
          data: List[Tuple[Any, float]] = []
          for model_name, accuracy in zip(
              table.adapters, column.values
          ):
              key = model_name_to_property(model_name)
              if key is None or np.isnan(accuracy):
                  continue
              data.append((key, accuracy))
              milestones[key].add(model_name)
          data.sort()
          xs: List[Any] = []
          ys: List[float] = []
          if cumulative:
              for now in list(dict.fromkeys(key for key, _ in data)):
                  xs.append(now)
                  ys.append(max(y for (x, y) in data if x <= now))
          else:
              for x, y in data:
                  xs.append(x)
                  ys.append(y)
          plot_func = ax.semilogx if logscale else ax.plot
          plot_func(xs, ys, label=column.group, color=color, marker="o")
  
      for key, model_names in sorted(milestones.items()):
          ax.axvline(x=key, ls="--", c="#bbb", zorder=0)
          if annotate_models:
              ax.text(key, 1.01, "/".join(model_names), rotation=40)
  
      # sort the legend according to the left-most value of each plot (makes it easier to visually map names to lines)
      handles, labels = ax.get_legend_handles_labels()
      legend_order = np.argsort([-h.get_data()[1][-1] for h in handles])
      ax.legend(
          [handles[i] for i in legend_order],
          [labels[i] for i in legend_order],
          loc="upper left",
          bbox_to_anchor=(1.02, 1),
      )
      property_save_name = property_name.replace(" ", "_").lower()
      ax.set_xlabel(property_name)
      ax.set_ylabel("Accuracy")
      ax.set_ylim(0, 1)
      self.save_figure(fig, f"accuracy_over_{property_save_name}")
  
imports: import argparse
  from collections import defaultdict
  from dataclasses import dataclass
  from datetime import date
  import json
  import os
  from typing import List, Dict, Optional, Any, Callable, Union, Mapping, Tuple, Set
  import colorcet
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from scipy.stats import pearsonr
  import seaborn
  from helm.common.hierarchical_logger import hlog
  from helm.benchmark.presentation.schema import read_schema
  from helm.benchmark.presentation.summarize import AGGREGATE_WIN_RATE_COLUMN
label_desc: Use image node_id 7 for calling the Plotter obj's underlying member method code with example usage: obj.create_accuracy_v_model_property_plot(property_name, model_name_to_property, cumulative, logscale, annotate_models) without return types