Hacker News new | past | comments | ask | show | jobs | submit login

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?



This 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


Take a look at their "Convenience API" (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!


Half 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.


Seems like an easy thing to make a helper function for.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: