コード例 #1
0
ファイル: test_animation.py プロジェクト: jwhendy/plotnine
    def plot(i):
        if i == 2:
            p = qplot(x, y, xlab='x', ylab='y')
        else:
            p = (qplot(x, y, color=colors[i], xlab='x', ylab='y')
                 + lims(color=(1, 7))
                 + labs(color='color'))

        return p + theme_minimal()
コード例 #2
0
    def plot(i):
        if i == 2:
            p = qplot(x, y, xlab='x', ylab='y')
        else:
            p = (qplot(x, y, color=colors[i], xlab='x', ylab='y')
                 + lims(color=(1, 7))
                 + labs(color='color'))

        return p + theme_minimal()
コード例 #3
0
 def plot(i):
     c = colors[i]
     if i == 2:
         p = (qplot(x, y, color=c, xlab='x', ylab='y')
              + lims(color=(1, 7))
              + labs(color='color'))
     else:
         p = (qplot(x, y, stroke=c, xlab='x', ylab='y')
              + lims(stroke=(1, 7))
              + labs(stroke='stroke'))
     return p + theme_minimal()
コード例 #4
0
ファイル: test_animation.py プロジェクト: jwhendy/plotnine
 def plot(i):
     c = colors[i]
     if i == 2:
         p = (qplot(x, y, color=c, xlab='x', ylab='y')
              + lims(color=(1, 7))
              + labs(color='color'))
     else:
         p = (qplot(x, y, stroke=c, xlab='x', ylab='y')
              + lims(stroke=(1, 7))
              + labs(stroke='stroke'))
     return p + theme_minimal()
コード例 #5
0
 def plot(i):
     return (qplot(x, y, color=colors[i], xlab='x', ylab='y')
             + lims(color=(1, 7))
             + labs(color='color')
             + theme_minimal()
             + _theme
             )
コード例 #6
0
ファイル: test_animation.py プロジェクト: jwhendy/plotnine
 def plot(i):
     return (qplot(x, y, color=colors[i], xlab='x', ylab='y')
             + lims(color=(1, 7))
             + labs(color='color')
             + theme_minimal()
             + _theme
             )
コード例 #7
0
ファイル: test_qplot.py プロジェクト: wilmckoy/plotnine
def test_series_labelling():
    df = pd.DataFrame({
        'x_axis_label': [1, 2, 3],
        'y_axis_label': [1, 2, 3],
        'color_label': ['a', 'b', 'c']
    })
    p = qplot(df.x_axis_label, df.y_axis_label, color=df.color_label)
    assert p + _theme == 'series_labelling'
コード例 #8
0
ファイル: test_qplot.py プロジェクト: yejianye/plotnine
def test_multiple_geoms():
    n = 3
    m = 10
    # n stairs of points, each m points high
    df = pd.DataFrame({'x': np.repeat(range(n), m),
                       'y': np.linspace(0, n, n*m)})
    p = qplot('factor(x)', 'y', data=df, geom=("boxplot", "point"))
    assert p == 'multiple_geoms'
コード例 #9
0
ファイル: test_qplot.py プロジェクト: jwhendy/plotnine
def test_multiple_geoms():
    n = 3
    m = 10
    # n stairs of points, each m points high
    df = pd.DataFrame({'x': np.repeat(range(n), m),
                       'y': np.linspace(0, n, n*m)})
    p = qplot('factor(x)', 'y', data=df, geom=("boxplot", "point"))
    assert p == 'multiple_geoms'
コード例 #10
0
ファイル: test_animation.py プロジェクト: jwhendy/plotnine
 def plot(i):
     if i == 2:
         _lims = lims(color=(3, 7))
     else:
         _lims = lims(color=(1, 7))
     return (qplot(x, y, color=colors[i], xlab='x', ylab='y')
             + _lims
             + labs(color='color')
             + theme_minimal()
             + _theme
             )
コード例 #11
0
 def plot(i):
     if i == 2:
         _lims = lims(color=(3, 7))
     else:
         _lims = lims(color=(1, 7))
     return (qplot(x, y, color=colors[i], xlab='x', ylab='y')
             + _lims
             + labs(color='color')
             + theme_minimal()
             + _theme
             )
コード例 #12
0
ファイル: test_qplot.py プロジェクト: wilmckoy/plotnine
def test_range():
    p = qplot(x=range(5), y=range(5))

    assert p == 'range'
コード例 #13
0
ファイル: test_qplot.py プロジェクト: wilmckoy/plotnine
def test_string_arrays():
    p = qplot(x='np.arange(5)', y='np.arange(5)')
    assert p == 'string-arrays'
コード例 #14
0
ファイル: test_qplot.py プロジェクト: wilmckoy/plotnine
def test_arrays():
    p = qplot(x=np.arange(5), y=np.arange(5))
    assert p == 'arrays'
コード例 #15
0
ファイル: test_qplot.py プロジェクト: wilmckoy/plotnine
def test_scalars():
    p = qplot(x=2, y=3)
    assert p == 'scalars'
コード例 #16
0
ファイル: test_qplot.py プロジェクト: jwhendy/plotnine
def test_arrays():
    p = qplot(x=np.arange(5), y=np.arange(5))
    assert p == 'arrays'
コード例 #17
0
ファイル: test_qplot.py プロジェクト: wilmckoy/plotnine
def test_sample():
    p = qplot(sample='np.arange(5)')
    assert p == 'sample'
コード例 #18
0
ファイル: test_qplot.py プロジェクト: jwhendy/plotnine
def test_range():
    p = qplot(x=range(5), y=range(5))

    assert p == 'range'
コード例 #19
0
ファイル: test_qplot.py プロジェクト: jwhendy/plotnine
def test_scalars():
    p = qplot(x=2, y=3)
    assert p == 'scalars'
コード例 #20
0
ファイル: test_qplot.py プロジェクト: jwhendy/plotnine
def test_onlyx():
    p = qplot(x='np.arange(5)')
    assert p == 'onlyx'
コード例 #21
0
ファイル: test_qplot.py プロジェクト: jwhendy/plotnine
def test_onlyy():
    p = qplot(y=np.arange(5))

    # Small displacement in x-label on travis
    assert p == ('range', {'tol': 8})
コード例 #22
0
ファイル: test_qplot.py プロジェクト: jwhendy/plotnine
def test_series_labelling():
    df = pd.DataFrame({'x_axis_label': [1, 2, 3],
                       'y_axis_label': [1, 2, 3],
                       'color_label': ['a', 'b', 'c']})
    p = qplot(df.x_axis_label, df.y_axis_label, color=df.color_label)
    assert p + _theme == 'series_labelling'
コード例 #23
0
ファイル: test_qplot.py プロジェクト: wilmckoy/plotnine
def test_onlyx():
    p = qplot(x='np.arange(5)')
    assert p == 'onlyx'
コード例 #24
0
ファイル: test_qplot.py プロジェクト: wilmckoy/plotnine
def test_onlyy():
    p = qplot(y=np.arange(5))

    # Small displacement in x-label on travis
    assert p == ('range', {'tol': 8})
コード例 #25
0
ファイル: test_qplot.py プロジェクト: jwhendy/plotnine
def test_string_arrays():
    p = qplot(x='np.arange(5)', y='np.arange(5)')
    assert p == 'string-arrays'
コード例 #26
0
def test_onlyx():
    p = qplot(x='np.arange(5)')
    with pytest.warns(PlotnineWarning):
        assert p == 'onlyx'
コード例 #27
0
ファイル: test_qplot.py プロジェクト: jwhendy/plotnine
def test_sample():
    p = qplot(sample='np.arange(5)')
    assert p == 'sample'