0

I did my project locally in Jupyter Notebook using Python. During my research I plotted with Plotly Express which worked fine locally, but when I tried to upload this .ipynb file to GitHub - all plots disappeared.

I rechecked my project a few times, but it didn't help - locally everything is good, but after uploading plots were deleted every time.

  • 1
    Hard to tell because you don't link to an actual example or any code. If you did then maybe I could check if it is covered in [this solution of using nbviewer](https://stackoverflow.com/a/73297292/8508004) which is the Jupyter community's offered rendering for pre-run Jupyter Notebooks and generally handles display of Plotly plots that have the Javascript associated. Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask), especially pay attention to the section 'Help others reproduce the problem'. Github's view is best thought of as a preview for developers. – Wayne Sep 01 '23 at 12:45
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Sep 01 '23 at 21:29

1 Answers1

1

Notebooks are just code blocks that you execute. When executed, you obtain the output bellow the code block using the proper software (jupyter notebook for example).

However, github is just a "dumb" file host/sharing utility. When you upload the notebook to Github, it's just the code blocks, not the output of the code.

To upload the graph to github, download it locally after code execution and upload it as image to github.

Itération 122442
  • 2,644
  • 2
  • 27
  • 73
  • 1
    "download it locally after code execution and upload it as image to github"?While certainly that is a possibility. That may not be necessary. "github is just a "dumb" file host/sharing utility. When you upload the notebook to Github, it's just the code blocks, not the output of the code." That last quote isn't accurate. The output of the code can in fact be there but the GitHub viewer doesn't render it. – Wayne Sep 01 '23 at 12:41