In [ ]:
"""fixture"""
import nose
import os
import string
from distutils.version import LooseVersion

from datetime import datetime, date, timedelta

from pandas import Series, DataFrame, MultiIndex, PeriodIndex, date_range
from pandas.compat import range, lrange, StringIO, lmap, lzip, u, zip
import pandas.util.testing as tm
from pandas.util.testing import ensure_clean
from pandas.core.config import set_option

import numpy as np
from numpy import random
from numpy.random import randn

from numpy.testing import assert_array_equal
from numpy.testing.decorators import slow
import pandas.tools.plotting as plotting

import matplotlib as mpl
mpl_le_1_2_1 = str(mpl.__version__) <= LooseVersion('1.2.1')
ts = tm.makeTimeSeries()
ts.name = 'ts'

series = tm.makeStringSeries()
series.name = 'series'

iseries = tm.makePeriodSeries()
iseries.name = 'iseries'

%matplotlib inline
In [ ]:
"""test_plot_figsize_and_title"""
ax = series.plot(title='Test', figsize=(16, 8))

assert ax.title.get_text() == 'Test'
assert_array_equal(np.round(ax.figure.get_size_inches()),
                           np.array((16., 8.)))
In [ ]:
"""test_bar_linewidth"""
df = DataFrame(randn(5, 5))

# regular
ax = df.plot(kind='bar', linewidth=2)
for r in ax.patches:
    assert r.get_linewidth() == 2

# stacked
ax = df.plot(kind='bar', stacked=True, linewidth=2)
for r in ax.patches:
    assert r.get_linewidth() == 2

# subplots
axes = df.plot(kind='bar', linewidth=2, subplots=True)
for ax in axes:
    for r in ax.patches:
        assert r.get_linewidth() == 2
In [ ]:
"""test_irregular_datetime"""
rng = date_range('1/1/2000', '3/1/2000')
rng = rng[[0, 1, 2, 3, 5, 9, 10, 11, 12]]
ser = Series(randn(len(rng)), rng)
ax = ser.plot()
xp = datetime(1999, 1, 1).toordinal()
ax.set_xlim('1/1/1999', '1/1/2001')
assert xp == ax.get_xlim()[0]
In [ ]:
"""failing test"""
1/0
a = 3