Matplotlib in a fortran jupyter notebook

If I have a fortran notebook that generates some result, and I want to make a figure using that, it would be nice to use matplotlib. Is this possible ? If not what other ways are there ?

1 Like

Welcome to our Discourse @praveen! Could you clarify what you mean by ā€œFortran jupyter notebookā€?

Are you using lfortranā€™s jupyter functionality or are you using Jupyter notebooks calling to Fortran in some other way?

I installed lfortran using conda and then created a jupyter notebook by selecting New ā†’ Fortran.

If I now generate some data, I am not able to plot it using matplotlib in the same notebook.

Is there a way to compute with fortran code and analyze/plot with python/matplotlib in the same notebook ?

This repo GitHub - jacobwilliams/pyplot-fortran: For generating plots from Fortran using Python's matplotlib.pyplot šŸ“ˆ should do it but Iā€™m not sure if youā€™ll be able to use modules. Last time I checked, which was a while back, lfortran jupyter had not implemented that feature yet.

1 Like