Plots in python notebook not appearing in gitlab

Viewed 973

I have a bunch of seaborn plots in my python notebook. When I check them into GitLab, they don't appear in the GitLab UI. It just shows <matplotlib.axes._subplots.AxesSubplot at 0x7f28a20abb00>. I use %matplotlib inline. Is there anything more I need to do?

Interestingly, if I have a single plot it appears.

2 Answers

This is a bug in the GitLab interface, as reported here and here. It will be resolved once this merge request is approved, merged, and released in an upcoming version of GitLab.com.

Not only this has been fixed (since 2017, five years ago), but those graphs are now visible even in MR (Merge Request)

See GitLab 15.1 (June 2022):

Rendered images in Python notebook MRs

Python notebooks are key to data scientists’ and machine learning engineers’ workflows. These files commonly display charts and graphs via static images to help visualize the notebook.

With this release, we now render these images in the merge request and commit view enabling a better user experience when reviewing code changes including Python notebooks with images.

https://about.gitlab.com/images/15_1/create-code-review-python-notebook-images.png -- Rendered images in Python notebook MRs

See Documentation and Issue.

Related