Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
xiangqipy.game_summary_plotters.GameSummaryPlotter Class Reference

Abstract base class for plotting data stored in pandas dataframes (one df for each player) to a numpy array of matplotlib Axes. More...

Inheritance diagram for xiangqipy.game_summary_plotters.GameSummaryPlotter:
Inheritance graph
Collaboration diagram for xiangqipy.game_summary_plotters.GameSummaryPlotter:
Collaboration graph

Public Member Functions

def __init__ (self, np.ndarray axes, Tuple[str,...] y_labels, int|Tuple[int,...] log_scale_rows=tuple(), pd.DataFrame red_data=None, pd.DataFrame black_data=None, bool add_plot_column_titles=True)
 
Dict[str, pd.DataFrame] dfs (self)
 
bool has_data (self, bindings.PieceColor player)
 
int num_players_with_data (self)
 
def validate_dfs (self)
 
def set_y_axes (self)
 
def set_x_axes (self)
 
Dict[bindings.PieceColor, int] player_plot_col (self)
 
pd.Index data_columns (self)
 
def match_y_limits_all_rows (self)
 
def plot_data (self)
 
def remove_second_plot_col_ylabels (self)
 
def set_plot_col_titles (self)
 
def plot (self)
 

Static Public Member Functions

def match_y_limits (np.ndarray axes_row)
 

Public Attributes

 axes
 
 y_labels
 
 log_scale_rows
 
 num_players_with_data
 

Static Public Attributes

dict evaluating_player_line_colors
 
dict player_text_labels
 
dict non_evaluating_player_line_colors
 

Protected Attributes

 _red_data
 
 _black_data
 
 _add_plot_column_titles
 

Detailed Description

Abstract base class for plotting data stored in pandas dataframes (one df for each player) to a numpy array of matplotlib Axes.

Definition at line 20 of file game_summary_plotters.py.

Constructor & Destructor Documentation

◆ __init__()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.__init__ (   self,
np.ndarray  axes,
Tuple[str, ...]  y_labels,
int | Tuple[int, ...]   log_scale_rows = tuple(),
pd.DataFrame   red_data = None,
pd.DataFrame   black_data = None,
bool   add_plot_column_titles = True 
)

Member Function Documentation

◆ data_columns()

pd.Index xiangqipy.game_summary_plotters.GameSummaryPlotter.data_columns (   self)

Definition at line 127 of file game_summary_plotters.py.

◆ dfs()

Dict[str, pd.DataFrame] xiangqipy.game_summary_plotters.GameSummaryPlotter.dfs (   self)

Definition at line 63 of file game_summary_plotters.py.

◆ has_data()

bool xiangqipy.game_summary_plotters.GameSummaryPlotter.has_data (   self,
bindings.PieceColor  player 
)

Definition at line 69 of file game_summary_plotters.py.

◆ match_y_limits()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.match_y_limits ( np.ndarray  axes_row)
static

Definition at line 133 of file game_summary_plotters.py.

◆ match_y_limits_all_rows()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.match_y_limits_all_rows (   self)

Definition at line 144 of file game_summary_plotters.py.

◆ num_players_with_data()

int xiangqipy.game_summary_plotters.GameSummaryPlotter.num_players_with_data (   self)

Definition at line 73 of file game_summary_plotters.py.

◆ player_plot_col()

Dict[bindings.PieceColor, int] xiangqipy.game_summary_plotters.GameSummaryPlotter.player_plot_col (   self)

Definition at line 112 of file game_summary_plotters.py.

◆ plot()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.plot (   self)

Definition at line 172 of file game_summary_plotters.py.

◆ plot_data()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.plot_data (   self)

◆ remove_second_plot_col_ylabels()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.remove_second_plot_col_ylabels (   self)

Definition at line 152 of file game_summary_plotters.py.

◆ set_plot_col_titles()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.set_plot_col_titles (   self)

Definition at line 158 of file game_summary_plotters.py.

◆ set_x_axes()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.set_x_axes (   self)

Definition at line 101 of file game_summary_plotters.py.

◆ set_y_axes()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.set_y_axes (   self)

Definition at line 88 of file game_summary_plotters.py.

◆ validate_dfs()

def xiangqipy.game_summary_plotters.GameSummaryPlotter.validate_dfs (   self)

Definition at line 81 of file game_summary_plotters.py.

Member Data Documentation

◆ _add_plot_column_titles

xiangqipy.game_summary_plotters.GameSummaryPlotter._add_plot_column_titles
protected

Definition at line 57 of file game_summary_plotters.py.

◆ _black_data

xiangqipy.game_summary_plotters.GameSummaryPlotter._black_data
protected

Definition at line 56 of file game_summary_plotters.py.

◆ _red_data

xiangqipy.game_summary_plotters.GameSummaryPlotter._red_data
protected

Definition at line 55 of file game_summary_plotters.py.

◆ axes

xiangqipy.game_summary_plotters.GameSummaryPlotter.axes

Definition at line 50 of file game_summary_plotters.py.

◆ evaluating_player_line_colors

dict xiangqipy.game_summary_plotters.GameSummaryPlotter.evaluating_player_line_colors
static
Initial value:
= {
bindings.PieceColor.kRed: "red",
bindings.PieceColor.kBlk: "black",
}

Definition at line 26 of file game_summary_plotters.py.

◆ log_scale_rows

xiangqipy.game_summary_plotters.GameSummaryPlotter.log_scale_rows

Definition at line 54 of file game_summary_plotters.py.

◆ non_evaluating_player_line_colors

dict xiangqipy.game_summary_plotters.GameSummaryPlotter.non_evaluating_player_line_colors
static
Initial value:
= {
bindings.PieceColor.kRed: "lightcoral",
bindings.PieceColor.kBlk: "darkgray",
}

Definition at line 36 of file game_summary_plotters.py.

◆ num_players_with_data

xiangqipy.game_summary_plotters.GameSummaryPlotter.num_players_with_data

Definition at line 82 of file game_summary_plotters.py.

◆ player_text_labels

dict xiangqipy.game_summary_plotters.GameSummaryPlotter.player_text_labels
static
Initial value:
= {
bindings.PieceColor.kRed: "Red Player",
bindings.PieceColor.kBlk: "Black Player",
}

Definition at line 31 of file game_summary_plotters.py.

◆ y_labels

xiangqipy.game_summary_plotters.GameSummaryPlotter.y_labels

Definition at line 51 of file game_summary_plotters.py.


The documentation for this class was generated from the following file: