nansencenter / DAPPER

Data Assimilation with Python: a Package for Experimental Research

Home Page:https://nansencenter.github.io/DAPPER

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Liveplotting in Jupyter notebook ?

atantet opened this issue · comments

Is there a way to have the live plots work in a Jupyter notebook, or at least to have the replays?
Maybe something with the matplotlib backend?

Sorry if it is a naive question, I find this package amazing and am only learning to use it.

Hi! Thanks for the kind words!

I don't think actual live plotting is possible, because I don't think the mpl backends on Jupyter allow for it, at least not very well.

However, the replays work fine.

You can see it in action here:
https://github.com/nansencenter/DA-tutorials
In the README, click on "open in colab". In the first chapter (T1) there is an example.
Beware that it's using and older version of DAPPER, so the syntax has probably changed somewhat (ref examples/basic_1.py).

Also, if you want smooth curves in the replays, remember to set store_u=True

Thanks for the very quick reply.
I can see that replays indeed work on Colab, but when I try to run examples/basic_1.py converted as a notebook, I do not get the plot.
Maybe it's my own configuration.
I will continue with my own plots, but if it can help, attached is my conda list :

list.txt

I think it's not your config. Some settings have changed, since the version of DAPPER that is being used on Colab. I cannot get the liveplotting or replays to work within Jupyter either. I'm sorry, but atm. I'm not sure what the fix is. Will try to get back to you some other time, but I cannot say when exactly.

OK, no problem, I'll continue to work with my own static plots. Thanks for the feedback!

It is working now, by way of the merge commit linked above.

It's not perfect, but it seems the best possible until this is resolved.

Note that you will need to re-install DAPPER.

Note that you can click on the .py example scripts within Jupyter, which will open them as notebooks.

Thanks a lot !