1010
1111import dask .array as da
1212import numpy as np
13+ from IPython .core .pylabtools import figsize
1314from matplotlib import colors as plc
1415from matplotlib import pyplot as plt
1516from matplotlib .axes import Axes
@@ -35,6 +36,7 @@ def plot(
3536 ylim : tuple [Any , Any ] | None = None ,
3637 title : str | None = None ,
3738 fn : str | None = None ,
39+ plot_size : tuple [Any , Any ] | None = None ,
3840 show : bool = False ,
3941 * ,
4042 cbar_label : str | None = None ,
@@ -51,6 +53,7 @@ def plot(
5153 if projection is None :
5254 projection = self .projection
5355 fig , ax = plt .subplots (
56+ figsize = plot_size ,
5457 subplot_kw = {"projection" : projection },
5558 )
5659 cbar_kwargs = {}
@@ -130,14 +133,15 @@ def plot(
130133 ylim : tuple [Any , Any ] | None = None ,
131134 title : str | None = None ,
132135 fn : str | None = None ,
136+ plot_size : tuple [Any , Any ] | None = None ,
133137 show : bool = False ,
134138 * ,
135139 bins : int | None = None ,
136140 density : bool = False ,
137141 log : bool = False ,
138142 hist_range : tuple [Any , Any ] | None = None ,
139143 ) -> Figure :
140- fig , ax = plt .subplots ()
144+ fig , ax = plt .subplots (figsize = plot_size )
141145 data .plot .hist (
142146 ax = ax , bins = bins , range = hist_range , density = density , log = log
143147 )
@@ -166,6 +170,7 @@ def plot(
166170 ylim : tuple [Any , Any ] | None = None ,
167171 title : str | None = None ,
168172 fn : str | None = None ,
173+ plot_size : tuple [Any , Any ] | None = None ,
169174 show : bool = False ,
170175 * ,
171176 bins : tuple [int , int ] | None = None ,
@@ -177,7 +182,7 @@ def plot(
177182 vmin : Any | None = None ,
178183 vmax : Any | None = None ,
179184 ) -> Figure :
180- fig , ax = plt .subplots ()
185+ fig , ax = plt .subplots (figsize = plot_size )
181186 cbar_kwargs = {}
182187 if cbar_label is not None :
183188 cbar_kwargs ["label" ] = cbar_label
@@ -217,14 +222,15 @@ def plot(
217222 ylim : tuple [Any , Any ] | None = None ,
218223 title : str | None = None ,
219224 fn : str | None = None ,
225+ plot_size : tuple [Any , Any ] | None = None ,
220226 show : bool = False ,
221227 * ,
222228 point_alpha : Any | None = None ,
223229 point_color : str | None = None ,
224230 point_marker : str | None = "." ,
225231 sample_count : int = 4000 ,
226232 ) -> Figure :
227- fig , ax = plt .subplots ()
233+ fig , ax = plt .subplots (figsize = plot_size )
228234 rand (data , sample_count ).plot .scatter (
229235 ax = ax ,
230236 x = "x" ,
@@ -262,12 +268,13 @@ def plot(
262268 ylim : tuple | None = None ,
263269 title : str | None = None ,
264270 fn : str | None = None ,
271+ plot_size : tuple [Any , Any ] | None = None ,
265272 show : bool = False ,
266273 * ,
267274 point_marker : str = "." ,
268275 group_by : str | None = "time.month" ,
269276 ) -> Figure :
270- fig , ax = plt .subplots ()
277+ fig , ax = plt .subplots (figsize = plot_size )
271278
272279 if group_by is not None :
273280 for _ , period in time_series (data ).groupby (group_by ):
0 commit comments