Inspiration

Creating multiple subplots in matplotlib can be extremely tedious, since you have to specify the position for each subplot in the figure. For large numbers of subplots, this becomes painful and repetitive, so we decided that we would implement an API that would take care of the positioning and formatting for you.

What it does

It simply takes in the number of subplots you want, and returns an iterable list of SubplotSpecs, which you can attach a function to that will be illustrated after a call to plt.plot(). It essentially abstracts away the positioning of multiple subplots by giving preset strategies ie. the RectangularStrategy, which will put all subplots into a rectangle.

How we built it

It is built as a python module, so other developers can install it using pip. We first created the classes that represent the strategies that would be used, like the abstract GridStrategy and the implemented SquareStrategy. Then, we set up all of the necessary tools that we needed for automated testing, code coverage, changing code format using black formatter etc. We then added documentation with Sphinx, and uploaded it to PyPI so users can install it.

Challenges we ran into

Working with git proved troublesome at times, as we had to rebase multiple times throughout the project, and many commits were duplicated in some pull requests, and we had to modify the history of commits. Another challenge was understanding how Azure pipelines and coverage worked and how to implement it into the project.

Accomplishments that I'm proud of

Finished minimum viable product and we use industry leading best practices to ensure quality in the repository. This was everyone' first time contributing to open source, and we built a fully functioning Python module publicly available on PyPI.

What I learned

How to set up a python module and prepare it so it can go live on PyPI. More about how git works and how it keeps track of commits and branches. The complete procedure of building a python package from scratch and the how to design a workflow.

What's next for grid_strategy

We are hoping to improve the API so it is more obvious how to use it, and eventually, we want this to be independent of matplotlib, so it can be used to plot with bqplot, or altair as well. We also want to incorporate higher dimension graphs instead of just 2D plots.

Built With

+ 6 more
Share this project:

Updates