File tree 2 files changed +31
-2
lines changed
2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -308,10 +308,21 @@ def _setup_subplots(self):
308
308
309
309
axes = _flatten (axes )
310
310
311
- if self .logx or self .loglog :
311
+ valid_log = [False , True , 'sym' , None ]
312
+
313
+ for i in (self .logx , self .logy , self .loglog ):
314
+ if i not in valid_log :
315
+ raise ValueError ("Valid inputs are boolean, None and 'sym'." )
316
+
317
+ if self .logx is True or self .loglog is True :
312
318
[a .set_xscale ('log' ) for a in axes ]
313
- if self .logy or self .loglog :
319
+ elif self .logx == 'sym' or self .loglog == 'sym' :
320
+ [a .set_xscale ('symlog' ) for a in axes ]
321
+
322
+ if self .logy is True or self .loglog is True :
314
323
[a .set_yscale ('log' ) for a in axes ]
324
+ elif self .logy == 'sym' or self .loglog == 'sym' :
325
+ [a .set_yscale ('symlog' ) for a in axes ]
315
326
316
327
self .fig = fig
317
328
self .axes = axes
Original file line number Diff line number Diff line change @@ -231,14 +231,32 @@ def test_plot_xy(self):
231
231
@pytest .mark .slow
232
232
def test_logscales (self ):
233
233
df = DataFrame ({'a' : np .arange (100 )}, index = np .arange (100 ))
234
+
234
235
ax = df .plot (logy = True )
235
236
self ._check_ax_scales (ax , yaxis = 'log' )
237
+ assert ax .get_yscale () == 'log'
238
+
239
+ ax = df .plot (logy = 'sym' )
240
+ self ._check_ax_scales (ax , yaxis = 'symlog' )
241
+ assert ax .get_yscale () == 'symlog'
236
242
237
243
ax = df .plot (logx = True )
238
244
self ._check_ax_scales (ax , xaxis = 'log' )
245
+ assert ax .get_xscale () == 'log'
246
+
247
+ ax = df .plot (logx = 'sym' )
248
+ self ._check_ax_scales (ax , xaxis = 'symlog' )
249
+ assert ax .get_xscale () == 'symlog'
239
250
240
251
ax = df .plot (loglog = True )
241
252
self ._check_ax_scales (ax , xaxis = 'log' , yaxis = 'log' )
253
+ assert ax .get_xscale () == 'log'
254
+ assert ax .get_yscale () == 'log'
255
+
256
+ ax = df .plot (loglog = 'sym' )
257
+ self ._check_ax_scales (ax , xaxis = 'symlog' , yaxis = 'symlog' )
258
+ assert ax .get_xscale () == 'symlog'
259
+ assert ax .get_yscale () == 'symlog'
242
260
243
261
@pytest .mark .slow
244
262
def test_xcompat (self ):
You can’t perform that action at this time.
0 commit comments