@@ -149,10 +149,12 @@ class Plot:
149
149
_limits : dict [str , tuple [Any , Any ]]
150
150
_labels : dict [str , str | Callable [[str ], str ] | None ]
151
151
152
- _subplot_spec : dict [str , Any ] # TODO values type
153
152
_facet_spec : FacetSpec
154
153
_pair_spec : PairSpec
155
154
155
+ _figure_spec : dict [str , Any ]
156
+ _subplot_spec : dict [str , Any ]
157
+
156
158
def __init__ (
157
159
self ,
158
160
* args : DataSource | VariableSpec ,
@@ -175,10 +177,12 @@ def __init__(
175
177
self ._limits = {}
176
178
self ._labels = {}
177
179
178
- self ._subplot_spec = {}
179
180
self ._facet_spec = {}
180
181
self ._pair_spec = {}
181
182
183
+ self ._subplot_spec = {}
184
+ self ._figure_spec = {}
185
+
182
186
self ._target = None
183
187
184
188
def _resolve_positionals (
@@ -242,10 +246,12 @@ def _clone(self) -> Plot:
242
246
new ._labels .update (self ._labels )
243
247
new ._limits .update (self ._limits )
244
248
245
- new ._subplot_spec .update (self ._subplot_spec )
246
249
new ._facet_spec .update (self ._facet_spec )
247
250
new ._pair_spec .update (self ._pair_spec )
248
251
252
+ new ._figure_spec .update (self ._figure_spec )
253
+ new ._subplot_spec .update (self ._subplot_spec )
254
+
249
255
new ._target = self ._target
250
256
251
257
return new
@@ -612,8 +618,7 @@ def configure(
612
618
613
619
new = self ._clone ()
614
620
615
- # TODO this is a hack; make a proper figure spec object
616
- new ._figsize = figsize # type: ignore
621
+ new ._figure_spec ["figsize" ] = figsize
617
622
618
623
if sharex is not None :
619
624
new ._subplot_spec ["sharex" ] = sharex
@@ -825,9 +830,8 @@ def _setup_figure(self, p: Plot, common: PlotData, layers: list[Layer]) -> None:
825
830
self ._subplots = subplots = Subplots (subplot_spec , facet_spec , pair_spec )
826
831
827
832
# --- Figure initialization
828
- figure_kws = {"figsize" : getattr (p , "_figsize" , None )} # TODO fix
829
833
self ._figure = subplots .init_figure (
830
- pair_spec , self .pyplot , figure_kws , p ._target ,
834
+ pair_spec , self .pyplot , p . _figure_spec , p ._target ,
831
835
)
832
836
833
837
# --- Figure annotation
0 commit comments