question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interface is very verbose, lots of boilerplate, lacks default behavior

See original GitHub issue

I love the look and feel of this library, and I have been looking for replacements to matplotlib. However, I find it frustrating to dig in because of the amount of boilerplate required.

Contrast

plt.plot(xs, ys)

with

sc_x = LinearScale()
sc_y = LinearScale()
scale = {'x': sc_x, 'y': sc_y}

ax_x = Axis(scale=sc_x)
ax_y = Axis(scale=sc_y, orientation='vertical')

line = Lines(x=xs, y=ys, scales=scale)
Figure(marks=[line], axes=[ax_x, ax_y])

to achieve virtually the same thing. I would really like to be able to just call Lines(xs, ys) and have it know I want a basic line plot with linear axes, and yes of course I want the y-axis vertical. Even x= and y= feels a bit redundant, 95% of line plots will be taking x and y as the first arguments (or better yet a (Nx2) array with x-y pairs as a single argument).

Additionally, the docstrings do not give a descriptive prototype, I just see args and kwargs, and thus I have to consult the api documentation to know what goes in there. I realize these may come across as a bit picky, but I think it’s small little UX niceties like this that make a library truly shine. Even just wrappers/aliases to emulate matplotlib like functionality/calls.

image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dmadekacommented, Dec 20, 2017

Doesn’t this work?

from bqplot import pyplot as blt

blt.plot(x, y_data)
blt.show()

Yes there’s an additional blt.show() line but I wouldn’t say its that much more verbose?

0reactions
dmadekacommented, Dec 29, 2017

So @xkortex the issue might be on your side

  • the doc shows for me
screen shot 2017-12-29 at 3 51 00 pm
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I get through the 2.5k lines of boilerplate code to do ...
I currently have a decent understanding of OpenGl 3.3 core (from learnopengl.org ), and I'm trying to learn Vulkan. The only material that...
Read more >
I suspect people see a lot of enterprise-y boilerplate ... - Hacker News
I'm generally of the opinion that Go is less verbose than Java as well, but I'm of the impression that a lot has...
Read more >
My reflections on Golang - DEV Community ‍ ‍
Too much boilerplate (not suitable for DRY) ... But this behavior is not very consistent as Maps and Slices by default are passed...
Read more >
Go: the Good, the Bad and the Ugly - Sylvain Wallez
So defensive copying to avoid race conditions will be difficult, requiring lots of boilerplate code. Go doesn't even have a Clone interface ......
Read more >
Golang: 4 Go Language Criticisms - Toptal
1. Lack of Function Overloading and Default Values for Arguments. I'll post a real code example here. · 2. Lack of Generics. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found