

{"id":129,"date":"2021-12-25T23:31:01","date_gmt":"2021-12-26T04:31:01","guid":{"rendered":"https:\/\/sites.temple.edu\/vahid\/?p=129"},"modified":"2022-05-07T11:38:29","modified_gmt":"2022-05-07T15:38:29","slug":"interactive-plots-in-jupyterlab","status":"publish","type":"post","link":"https:\/\/sites.temple.edu\/vahid\/2021\/12\/25\/interactive-plots-in-jupyterlab\/","title":{"rendered":"Interactive Plots in JupyterLab"},"content":{"rendered":"\n<p>There are several ways to plot interactively in JupyterLab. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Altair<\/li><li>Plotly<\/li><li>Bokeh<\/li><li>ipywidgets<\/li><\/ul>\n\n\n\n<p>Between all the above, I found ipywidgets easier to use than the others.<\/p>\n\n\n\n<p>To be able to use ipywidgets, some installations are needed:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>If we work in user mode in Linux, then clone the actual environment with:<ul><li>conda create &#8211;name mytorch &#8211;clone torch<\/li><\/ul><\/li><li>Activate the new environment:<ul><li>conda activate mytorch<\/li><\/ul><\/li><li>Install all necessary software such as Jupyter-Lab if needed:<ul><li>conda install -c conda-forge jupyterlab<\/li><\/ul><\/li><li>Then install the following:<ul><li>conda install -c conda-forge ipympl<\/li><li>conda install -c conda-forge nodejs<\/li><li>jupyter labextension install @jupyter-widgets\/jupyterlab-manager<\/li><li>jupyter lab build<\/li><\/ul><\/li><li>Then add &#8220;%matplotlib widget&#8221; to your jupyter notebook.<\/li><\/ul>\n\n\n\n<p>Enjoy it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are several ways to plot interactively in JupyterLab. Altair Plotly Bokeh ipywidgets Between all the above, I found ipywidgets easier to use than the&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/sites.temple.edu\/vahid\/2021\/12\/25\/interactive-plots-in-jupyterlab\/\">Continue reading<span class=\"screen-reader-text\">Interactive Plots in JupyterLab<\/span><\/a><\/div>\n","protected":false},"author":18759,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[87,3,35,86],"class_list":["post-129","post","type-post","status-publish","format-standard","hentry","category-tools","tag-interactive-plot","tag-jupyter","tag-jupyterlab","tag-plotting","entry"],"_links":{"self":[{"href":"https:\/\/sites.temple.edu\/vahid\/wp-json\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.temple.edu\/vahid\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.temple.edu\/vahid\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.temple.edu\/vahid\/wp-json\/wp\/v2\/users\/18759"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.temple.edu\/vahid\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":0,"href":"https:\/\/sites.temple.edu\/vahid\/wp-json\/wp\/v2\/posts\/129\/revisions"}],"wp:attachment":[{"href":"https:\/\/sites.temple.edu\/vahid\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.temple.edu\/vahid\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.temple.edu\/vahid\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}