4 ms·
Seems like a fair amount of boilerplate. You really have to specify that the axes are Cartesian with every simple two-axis plot you make?
by cwyers 9y ago
Seems like a fair amount of boilerplate. You really have to specify that the axes are Cartesian with every simple two-axis plot you make?
- ketralnis 9y agoThis is the code from the beginning of the tutorial: # make some test data import numpy x = numpy.linspace(0, 10) y = x ** 2 # plot it import toyplot canvas = toyplot.Canvas(width=300, height=300) axes = canvas.cartesian() mark = axes.plot(x, y) 3 lines excluding the import doesn't strike me as a remarkable amount of boilerplate
- bpicolo 9y agoSeems like an easy thing to make a helper function for.
- knlje 9y agoHalf of my plots use logarithmic scale. Makes sense to me. I really like the default axis styling where they have gone against the mainstream style of gnuplot/matlab. I'm definitely going to try this out sometime soon.
- shoyer 9y agoTake a look at their "Convenience API" (http://toyplot.readthedocs.io/en/stable/convenience-api.html http://toyplot.readthedocs.io/en/stable/convenience-api.html) that does indeed make simple two-axis plots a one-liner. toyplot.plot(x, y) seems pretty hard to beat!