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")
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")
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")
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")
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")
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")
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")
def step_impl(context): canvas = toyplot.Canvas() axes = canvas.cartesian() axes.plot(context.x, context.y) testing.assert_canvas_equal(canvas, "tick-locator-default")
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")
def step_impl(context): testing.assert_canvas_equal(context.canvas, "axes-lines-annotation")
def step_impl(context): testing.assert_canvas_equal(context.canvas, "axes-fill-n-magnitudes-position-titles")
def step_impl(context): testing.assert_canvas_equal(context.canvas, "axes-fill-n-boundaries-titles")
def step_impl(context): testing.assert_canvas_equal(context.canvas, "axes-fill-one-boundary-position")
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")
def step_impl(context): axes = context.canvas.cartesian() axes.text(0, 0, u"L\u0302") testing.assert_canvas_equal(context.canvas, "unicode-cartesian-text")
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")
def step_impl(context): context.canvas.text(100, 100, u"L\u0302") testing.assert_canvas_equal(context.canvas, "unicode-canvas-text")
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")
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")
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")
def step_impl(context): testing.assert_canvas_equal( context.canvas, "axes-lines-annotation")
def step_impl(context): testing.assert_canvas_equal(context.canvas, "axes-fill-n-boundaries-position-along-y")
def step_impl(context): testing.assert_canvas_equal( context.canvas, "axes-lines-data")
def step_impl(context): testing.assert_canvas_equal(context.canvas, "axes-fill-one-magnitude-position")
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)
def step_impl(context): testing.assert_canvas_equal(context.canvas, "axes-fill-n-magnitudes-wiggle-baseline")
def step_impl(context, reference): testing.assert_canvas_equal(context.canvas, reference)
def step_impl(context): testing.assert_canvas_equal(context.canvas, "axes-lines-data")
def step_impl(context): axes = context.canvas.cartesian(label=u"L\u0302") testing.assert_canvas_equal(context.canvas, "unicode-cartesian-label")