
    (^i	                        d dl mZ d dlmZ d dlZd dlmZ d dlm	Z	 d dl
mZ d dl
mZ d dlmZ  ej                         rd d	lmZ d d
lmZ  ed      	 	 	 	 	 	 dd       Z	 	 	 	 ddZy)    )annotations)SequenceN)experimental_func)Study)_get_hypervolume_history_info)_HypervolumeHistoryInfo)_imports)Axes)pltz3.3.0c                ,   t        j                          | j                         st        d      t	        |      t	        | j
                        k7  rt        d      t        | t        j                  |t        j                              }t        |      S )a  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      u/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/optuna/visualization/matplotlib/_hypervolume_history.pyplot_hypervolume_historyr      s    0 NN$$&<
 	

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

?RTR\R\0]^D(..    c                b   t         j                  j                  d       t        j                         \  }}|j	                  d       |j                  d       |j                  d       t        j                  d      }|j                  | j                  | j                  d |d      d	       |S )
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(LLNEAr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 8HG 7%/%/$%/ %/ %/P
!r   