Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

What configurations and dependencies should I ensure in my GitHub Actions setup to guarantee that matplotlib figures render correctly in my nbdev?

markwilliams21

Mark Williams
New Member
Hello everyone,

I'm working on a machine learning project where I use nbdev to process Jupyter notebooks. Locally, my matplotlib figures render correctly, but when the notebooks are processed and viewed on GitHub, some figures appear as text representations (e.g., <Figure size 1000x600 with 1 Axes>).

I'm running GitHub Actions for continuous integration, and I suspect the issue might be related to the configuration of my GitHub Actions environment. Specifically, I want to ensure that the matplotlib figures are rendered correctly in the processed notebooks.

My Environment Details:​

  • Local Environment:
    • ipykernel version: 6.29.4
    • matplotlib version: 3.7.5
    • matplotlib-inline version: 0.1.6
  • GitHub Actions Environment:
    • Versions may differ slightly from local setup.

What I've Tried:​

  • Explicitly setting %matplotlib inline in the notebooks.
  • Using plt.show() to ensure figures are explicitly rendered.
  • Verifying the backend as module://matplotlib_inline.backend_inline.
What configurations and dependencies should I ensure in my GitHub Actions setup to guarantee that matplotlib figures render correctly in my nbdev processed notebooks? Are there specific versions of packages or additional steps I need to include in my workflow to avoid rendering issues?

Any advice or examples of working configurations would be greatly appreciated!
 
Top