Пример #1
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(
        xticklocator=toyplot.locator.Explicit(labels=["red", "green", "blue"]))
    axes.y.ticks.locator = toyplot.locator.Explicit([-1, 1], ["-1", "1"])
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-explicit-labels")
Пример #2
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(
        xticklocator=toyplot.locator.Uniform(count=10, format="{:.3g}"))
    axes.y.ticks.locator = toyplot.locator.Uniform(count=3, format="{:.1f}")
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-basic")
Пример #3
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Explicit(
        labels=["red", "green", "blue"]))
    axes.y.ticks.locator = toyplot.locator.Explicit([-1, 1], ["-1", "1"])
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-explicit-labels")
Пример #4
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(
        xticklocator=toyplot.locator.Uniform(count=10, format="{:.3g}"))
    axes.y.ticks.locator = toyplot.locator.Uniform(count=3, format="{:.1f}")
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-basic")
Пример #5
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Explicit(
        locations=[0, numpy.pi, 2 * numpy.pi], labels=["0", "pi", "2pi"]))
    axes.y.ticks.locator = toyplot.locator.Explicit([-1, 1], ["-1", "1"])
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas,
                                "tick-locator-explicit-locations-labels")
Пример #6
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Explicit(
        locations=[0, numpy.pi, 2 * numpy.pi], labels=["0", "pi", "2pi"]))
    axes.y.ticks.locator = toyplot.locator.Explicit([-1, 1], ["-1", "1"])
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(
        canvas, "tick-locator-explicit-locations-labels")
Пример #7
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(
        xticklocator=toyplot.locator.Explicit(
            locations=[
                0,
                2,
                numpy.pi,
                4,
                6]))
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(
        canvas, "tick-locator-explicit-locations")
Пример #8
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Heckbert(count=10))
    axes.y.ticks.locator = toyplot.locator.Heckbert(count=3)
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-heckbert")
Пример #9
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian()
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-default")
Пример #10
0
def step_impl(context):
    axes = context.canvas.cartesian()
    axes.x.ticks.locator = toyplot.locator.Explicit([0], [u"L\u0302"])
    testing.assert_canvas_equal(context.canvas, "unicode-cartesian-tick-labels")
Пример #11
0
def step_impl(context):
    testing.assert_canvas_equal(context.canvas, "axes-lines-annotation")
Пример #12
0
def step_impl(context):
    testing.assert_canvas_equal(context.canvas,
                                "axes-fill-n-magnitudes-position-titles")
Пример #13
0
def step_impl(context):
    testing.assert_canvas_equal(context.canvas,
                                "axes-fill-n-boundaries-titles")
Пример #14
0
def step_impl(context):
    testing.assert_canvas_equal(context.canvas,
                                "axes-fill-one-boundary-position")
Пример #15
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Extended(count=12))
    axes.y.ticks.locator = toyplot.locator.Extended(count=5)
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-extended")
Пример #16
0
def step_impl(context):
    axes = context.canvas.cartesian()
    axes.text(0, 0, u"L\u0302")
    testing.assert_canvas_equal(context.canvas, "unicode-cartesian-text")
Пример #17
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Explicit(
        locations=[0, 2, numpy.pi, 4, 6]))
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-explicit-locations")
Пример #18
0
def step_impl(context):
    context.canvas.text(100, 100, u"L\u0302")
    testing.assert_canvas_equal(context.canvas, "unicode-canvas-text")
Пример #19
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Null())
    axes.y.ticks.locator = toyplot.locator.Null()
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-null")
Пример #20
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian()
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-default")
Пример #21
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Extended(count=12))
    axes.y.ticks.locator = toyplot.locator.Extended(count=5)
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-extended")
Пример #22
0
def step_impl(context):
    canvas, axes, mark = toyplot.plot(numpy.linspace(0, 1)**2,
                                      style={"stroke-dasharray": "5,5"})
    testing.assert_canvas_equal(canvas, "style-stroke-dasharray")
Пример #23
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Heckbert(count=10))
    axes.y.ticks.locator = toyplot.locator.Heckbert(count=3)
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-heckbert")
Пример #24
0
def step_impl(context):
    canvas, axes, mark = toyplot.plot(numpy.linspace(0, 1) ** 2, style={"stroke-dasharray":"5,5"})
    testing.assert_canvas_equal(canvas, "style-stroke-dasharray")
Пример #25
0
def step_impl(context):
    canvas = toyplot.Canvas()
    axes = canvas.cartesian(xticklocator=toyplot.locator.Null())
    axes.y.ticks.locator = toyplot.locator.Null()
    axes.plot(context.x, context.y)
    testing.assert_canvas_equal(canvas, "tick-locator-null")
Пример #26
0
def step_impl(context):
    testing.assert_canvas_equal(
        context.canvas, "axes-lines-annotation")
Пример #27
0
def step_impl(context):
    testing.assert_canvas_equal(context.canvas,
                                "axes-fill-n-boundaries-position-along-y")
Пример #28
0
def step_impl(context):
    testing.assert_canvas_equal(
        context.canvas, "axes-lines-data")
Пример #29
0
def step_impl(context):
    testing.assert_canvas_equal(context.canvas,
                                "axes-fill-one-magnitude-position")
Пример #30
0
def step_impl(context, reference):
    show_diff = context.config.userdata.getbool("show_diff", default=True)
    testing.assert_canvas_equal(context.canvas, reference, show_diff=show_diff)
Пример #31
0
def step_impl(context):
    testing.assert_canvas_equal(context.canvas,
                                "axes-fill-n-magnitudes-wiggle-baseline")
Пример #32
0
def step_impl(context, reference):
    testing.assert_canvas_equal(context.canvas, reference)
Пример #33
0
def step_impl(context):
    testing.assert_canvas_equal(context.canvas, "axes-lines-data")
Пример #34
0
def step_impl(context):
    axes = context.canvas.cartesian(label=u"L\u0302")
    testing.assert_canvas_equal(context.canvas, "unicode-cartesian-label")