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()
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()
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()
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()
def plot(i): return (qplot(x, y, color=colors[i], xlab='x', ylab='y') + lims(color=(1, 7)) + labs(color='color') + theme_minimal() + _theme )
def plot(i): return (qplot(x, y, color=colors[i], xlab='x', ylab='y') + lims(color=(1, 7)) + labs(color='color') + theme_minimal() + _theme )
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'
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'
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'
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 )
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 )
def test_range(): p = qplot(x=range(5), y=range(5)) assert p == 'range'
def test_string_arrays(): p = qplot(x='np.arange(5)', y='np.arange(5)') assert p == 'string-arrays'
def test_arrays(): p = qplot(x=np.arange(5), y=np.arange(5)) assert p == 'arrays'
def test_scalars(): p = qplot(x=2, y=3) assert p == 'scalars'
def test_arrays(): p = qplot(x=np.arange(5), y=np.arange(5)) assert p == 'arrays'
def test_sample(): p = qplot(sample='np.arange(5)') assert p == 'sample'
def test_range(): p = qplot(x=range(5), y=range(5)) assert p == 'range'
def test_scalars(): p = qplot(x=2, y=3) assert p == 'scalars'
def test_onlyx(): p = qplot(x='np.arange(5)') assert p == 'onlyx'
def test_onlyy(): p = qplot(y=np.arange(5)) # Small displacement in x-label on travis assert p == ('range', {'tol': 8})
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'
def test_onlyx(): p = qplot(x='np.arange(5)') assert p == 'onlyx'
def test_onlyy(): p = qplot(y=np.arange(5)) # Small displacement in x-label on travis assert p == ('range', {'tol': 8})
def test_string_arrays(): p = qplot(x='np.arange(5)', y='np.arange(5)') assert p == 'string-arrays'
def test_onlyx(): p = qplot(x='np.arange(5)') with pytest.warns(PlotnineWarning): assert p == 'onlyx'
def test_sample(): p = qplot(sample='np.arange(5)') assert p == 'sample'