11import pathlib
2- from typing import List , Union
2+ from typing import List , Optional , Union
33
44import matplotlib
55import matplotlib .pyplot as plt
@@ -25,8 +25,8 @@ def _violinplot(
2525 self ,
2626 data : dataType ,
2727 names : namesType ,
28- title : titleType = None ,
29- ax : matplotlib .axes .SubplotBase = None ,
28+ title : Optional [ titleType ] = None ,
29+ ax : Optional [ matplotlib .axes .Axes ] = None ,
3030 ) -> matplotlib .figure .Figure :
3131 """For making violinplots."""
3232
@@ -76,7 +76,7 @@ def _boxplot_xticks_labels(self):
7676 return [str (n ) for n in self .result_set .ranked_names ]
7777
7878 def boxplot (
79- self , title : titleType = None , ax : matplotlib .axes .SubplotBase = None
79+ self , title : Optional [ titleType ] = None , ax : Optional [ matplotlib .axes .Axes ] = None
8080 ) -> matplotlib .figure .Figure :
8181 """For the specific mean score boxplot."""
8282 data = self ._boxplot_dataset
@@ -98,7 +98,7 @@ def _winplot_dataset(self):
9898 return wins , ranked_names
9999
100100 def winplot (
101- self , title : titleType = None , ax : matplotlib .axes .SubplotBase = None
101+ self , title : Optional [ titleType ] = None , ax : Optional [ matplotlib .axes .Axes ] = None
102102 ) -> matplotlib .figure .Figure :
103103 """Plots the distributions for the number of wins for each strategy."""
104104
@@ -126,7 +126,7 @@ def _sdv_plot_dataset(self):
126126 return diffs , ranked_names
127127
128128 def sdvplot (
129- self , title : titleType = None , ax : matplotlib .axes .SubplotBase = None
129+ self , title : Optional [ titleType ] = None , ax : Optional [ matplotlib .axes .Axes ] = None
130130 ) -> matplotlib .figure .Figure :
131131 """Score difference violin plots to visualize the distributions of how
132132 players attain their payoffs."""
@@ -143,7 +143,7 @@ def _lengthplot_dataset(self):
143143 ]
144144
145145 def lengthplot (
146- self , title : titleType = None , ax : matplotlib .axes .SubplotBase = None
146+ self , title : Optional [ titleType ] = None , ax : Optional [ matplotlib .axes .Axes ] = None
147147 ) -> matplotlib .figure .Figure :
148148 """For the specific match length boxplot."""
149149 data = self ._lengthplot_dataset
@@ -174,8 +174,8 @@ def _payoff_heatmap(
174174 self ,
175175 data : dataType ,
176176 names : namesType ,
177- title : titleType = None ,
178- ax : matplotlib .axes .SubplotBase = None ,
177+ title : Optional [ titleType ] = None ,
178+ ax : Optional [ matplotlib .axes .Axes ] = None ,
179179 cmap : str = "viridis" ,
180180 ) -> matplotlib .figure .Figure :
181181 """Generic heatmap plot"""
@@ -202,15 +202,15 @@ def _payoff_heatmap(
202202 return figure
203203
204204 def pdplot (
205- self , title : titleType = None , ax : matplotlib .axes .SubplotBase = None
205+ self , title : Optional [ titleType ] = None , ax : Optional [ matplotlib .axes .Axes ] = None
206206 ) -> matplotlib .figure .Figure :
207207 """Payoff difference heatmap to visualize the distributions of how
208208 players attain their payoffs."""
209209 matrix , names = self ._pdplot_dataset
210210 return self ._payoff_heatmap (matrix , names , title = title , ax = ax )
211211
212212 def payoff (
213- self , title : titleType = None , ax : matplotlib .axes .SubplotBase = None
213+ self , title : Optional [ titleType ] = None , ax : Optional [ matplotlib .axes .Axes ] = None
214214 ) -> matplotlib .figure .Figure :
215215 """Payoff heatmap to visualize the distributions of how
216216 players attain their payoffs."""
@@ -223,9 +223,9 @@ def payoff(
223223 def stackplot (
224224 self ,
225225 eco ,
226- title : titleType = None ,
226+ title : Optional [ titleType ] = None ,
227227 logscale : bool = True ,
228- ax : matplotlib .axes .SubplotBase = None ,
228+ ax : Optional [ matplotlib .axes .Axes ] = None ,
229229 ) -> matplotlib .figure .Figure :
230230
231231 populations = eco .population_sizes
0 commit comments