@@ -26,8 +26,9 @@ class TestTSPlot(TestPlotBase):
26
26
def setup_method (self , method ):
27
27
TestPlotBase .setup_method (self , method )
28
28
29
- freq = ['S' , 'T' , 'H' , 'D' , 'W' , 'M' , 'Q' , 'A' ]
30
- idx = [period_range ('12/31/1999' , freq = x , periods = 100 ) for x in freq ]
29
+ self .freq = ['S' , 'T' , 'H' , 'D' , 'W' , 'M' , 'Q' , 'A' ]
30
+ idx = [
31
+ period_range ('12/31/1999' , freq = x , periods = 100 ) for x in self .freq ]
31
32
self .period_ser = [Series (np .random .randn (len (x )), x ) for x in idx ]
32
33
self .period_df = [DataFrame (np .random .randn (len (x ), 3 ), index = x ,
33
34
columns = ['A' , 'B' , 'C' ])
@@ -209,6 +210,16 @@ def test_line_plot_period_series(self):
209
210
for s in self .period_ser :
210
211
_check_plot_works (s .plot , s .index .freq )
211
212
213
+ @pytest .mark .slow
214
+ @pytest .mark .parametrize (
215
+ 'frqncy' , ['1S' , '3S' , '5T' , '7H' , '4D' , '8W' , '11M' , '3A' ])
216
+ def test_line_plot_period_mlt_series (self , frqncy ):
217
+ # test period index line plot for series with multiples (`mlt`) of the
218
+ # frequency (`frqncy`) rule code. tests resolution of issue #14763
219
+ idx = period_range ('12/31/1999' , freq = frqncy , periods = 100 )
220
+ s = Series (np .random .randn (len (idx )), idx )
221
+ _check_plot_works (s .plot , s .index .freq .rule_code )
222
+
212
223
@pytest .mark .slow
213
224
def test_line_plot_datetime_series (self ):
214
225
for s in self .datetime_ser :
@@ -219,6 +230,19 @@ def test_line_plot_period_frame(self):
219
230
for df in self .period_df :
220
231
_check_plot_works (df .plot , df .index .freq )
221
232
233
+ @pytest .mark .slow
234
+ @pytest .mark .parametrize (
235
+ 'frqncy' , ['1S' , '3S' , '5T' , '7H' , '4D' , '8W' , '11M' , '3A' ])
236
+ def test_line_plot_period_mlt_frame (self , frqncy ):
237
+ # test period index line plot for DataFrames with multiples (`mlt`)
238
+ # of the frequency (`frqncy`) rule code. tests resolution of issue
239
+ # #14763
240
+ idx = period_range ('12/31/1999' , freq = frqncy , periods = 100 )
241
+ df = DataFrame (np .random .randn (len (idx ), 3 ), index = idx ,
242
+ columns = ['A' , 'B' , 'C' ])
243
+ freq = df .index .asfreq (df .index .freq .rule_code ).freq
244
+ _check_plot_works (df .plot , freq )
245
+
222
246
@pytest .mark .slow
223
247
def test_line_plot_datetime_frame (self ):
224
248
for df in self .datetime_df :
0 commit comments