
    -ji	                        S SK Jr  S SKJr  S SKrS SKJr  S SKJ	r	  S SK
Jr  S SK
Jr  S SKJr  \R                  " 5       (       a  S S	KJr  S S
KJr  \" S5            SS j5       r    SS jrg)    )annotations)SequenceN)experimental_func)Study)_get_hypervolume_history_info)_HypervolumeHistoryInfo)_imports)Axes)pltz3.3.0c                6   [         R                  " 5         U R                  5       (       d  [        S5      e[	        U5      [	        U R
                  5      :w  a  [        S5      e[        U [        R                  " U[        R                  S95      n[        U5      $ )af  Plot hypervolume history of all trials in a study with Matplotlib.

.. note::
    You need to adjust the size of the plot by yourself using ``plt.tight_layout()`` or
    ``plt.savefig(IMAGE_NAME, bbox_inches='tight')``.

Args:
    study:
        A :class:`~optuna.study.Study` object whose trials are plotted for their hypervolumes.
        The number of objectives must be 2 or more.

    reference_point:
        A reference point to use for hypervolume computation.
        The dimension of the reference point must be the same as the number of objectives.

Returns:
    A :class:`matplotlib.axes.Axes` object.
zoStudy must be multi-objective. For single-objective optimization, please use plot_optimization_history instead.zRThe dimension of the reference point must be the same as the number of objectives.)dtype)r	   check_is_multi_objective
ValueErrorlen
directionsr   npasarrayfloat64_get_hypervolume_history_plot)studyreference_pointinfos      n/home/james-whalen/.local/lib/python3.13/site-packages/optuna/visualization/matplotlib/_hypervolume_history.pyplot_hypervolume_historyr      s    0 NN$$&&<
 	

 ?s5#3#344`
 	
 )

?RTR\R\0]^D(..    c                ^   [         R                  R                  S5        [         R                  " 5       u  pUR	                  S5        UR                  S5        UR                  S5        [         R                  " S5      nUR                  U R                  U R                  SU" S5      SS	9  U$ )
NggplotzHypervolume History PlotTrialHypervolumetab10or   g      ?)markercoloralpha)r   styleusesubplots	set_title
set_xlabel
set_ylabelget_cmapplottrial_numbersvalues)r   _axcmaps       r   r   r   <   s     IIMM(LLNEALL+,MM'MM- << DGG1g   Ir   )r   r   r   zSequence[float]return'Axes')r   r   r3   r4   )
__future__r   collections.abcr   numpyr   optuna._experimentalr   optuna.studyr   )optuna.visualization._hypervolume_historyr   r   3optuna.visualization.matplotlib._matplotlib_importsr	   is_successfulr
   r   r   r    r   r   <module>r>      s}    " $  2  S M H HG 7%/%/$%/ %/ %/P
!r   