These are chat archives for sandialabs/toyplot

26th
Aug 2016
Timothy M. Shead
@tshead
Aug 26 2016 03:12
@johanndt: Easy as pie … if you don’t specify any layout when you add axes to a canvas they will fill the available space, except for 50px of padding on each side - you can change the amount using the gutter argument - probably ought to rename that. In this case, you want unequal padding, which you can’t do with gutter. Instead, you can use the bounds argument to explicitly specify the (xmin, xmax, ymin, ymax) canvas coordinates of your axes. You can use negative values to specify coordinates relative to the right and bottom edges of the canvas, so you don’t even have to do any math:
canvas = toyplot.Canvas(width=496, height=190, style={"background-color":"#e8e8e8”})
axes = canvas.cartesian(bounds=(50, -50, 5, -50))
axes.bars([50, 100, 150, 200, 250], along="y”)
Timothy M. Shead
@tshead
Aug 26 2016 03:22
This message was deleted
Timothy M. Shead
@tshead2
Aug 26 2016 03:24
This message was deleted
Timothy M. Shead
@tshead
Aug 26 2016 03:42
example results
Note the use of a canvas style to make the effect clearer. Pro-tip: when laying-out axes, you are actually laying-out their data range. Labels, spines, tick-marks, etc. are all contained in the gutter region. This makes it easier to line-up the data in adjacent plots.
Johann du Toit
@johanndt
Aug 26 2016 04:05
awesome, thanks @tshead! I knew I was missing something obvious.