Issue
I am trying to create a simple plot using matplotlib to draw a figure in Jupyter Lab. Below is a snapshot of the code.
I create two figure objects (fig_1 and fig_2) and then add axes to them. The axes show up in the first case when I have both the fig_1 and ax_1 objects in the same cell.
But in the second case, the image is not rendered, if the objects (fig_2 and ax_2 are in different cells).
The scope of these objects should extend beyond the cells.
Why does the image not appear in the second case?
Forgive me, if this sounds too trivial. But I am new to Jupyter Notebooks, Python and matplotlib. I am using Anaconda 4.5 with Python 3.6.5. I did try to look around but could not find an answer.
Solution
I don't know enough about the notebook's internal to answer the question why, but I can tell you that if you want to display the figure in another cell, after its creation, just just have to call its instance in the cell:
Answered By - Diziet Asahi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.