Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plots in python notebook not appearing in gitlab

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.

like image 725
nsk Avatar asked Nov 14 '25 15:11

nsk


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.

like image 142
joelostblom Avatar answered Nov 17 '25 09:11

joelostblom


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.

like image 40
VonC Avatar answered Nov 17 '25 09:11

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!