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!
 
Back
Top