Select to view content in your preferred language

Python Notebook - Pandas plots not drawing when imported to Pro

436
2
08-23-2024 05:54 AM
Labels (2)
JCGuarneri
Frequent Contributor

I'm developing a notebook for our environmental science team to extract, visualize, and analyze well level readings. I got it most of the way there using the web-based Jupyter editor and plots were looking good.

I brought the notebook into Pro 3.2 to finish developing it and make it easier to share. Now that it's in Pro, when I run the plot() method on the Pandas dataframe, the plots do not show. It looks like it's creating the plot object successfully, just not drawing it. Interestingly, the plots that had already been generated in the web version are still showing in Pro (see below).

I did confirm that there is actually data in the dataframe I'm trying to plot. Does anyone know how I can force it to draw.

 

JCGuarneri_0-1724417070525.png

 

0 Kudos
2 Replies
jcarlson
MVP Esteemed Contributor

What about using matplotlib together with .plot()?

https://pandas.pydata.org/pandas-docs/version/0.13/visualization.html

Does it make any difference to put plt.figure() in the same cell before calling the plot method?

- Josh Carlson
Kendall County GIS
JCGuarneri
Frequent Contributor

I haven't tried pulling in matplotlib yet. I'm hoping to just stick with the Pandas tools to keep the code simpler for the end users. But that's a good suggestion.

Edit:

I just tried the method suggested. It did not make a difference.

0 Kudos