This readme was generated automatically from a Jupyter notebook using this tutorial.
This is a notebook directly inspired from this tutorial.
It explains how to publish online a figure generated with matplotlib and its associated data very easily using Plotly. It can be usefull to share raw data of figures from scientific papers.
Visit the original tutorial for more details !
You can use the virtual environment of this tutorial:
conda env create -f environment.yml
Otherwise, in conda command prompt:
conda install plotly
conda install -c plotly chart-studio
import plotly.tools as tls
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("data/fluo_DDAO_01_08_2022.csv")
fig = plt.figure()
plt.plot(df["Unnamed: 6"], df["Emission_600"], label = r"$emission \; (\lambda_{exc} = 600)$")
plt.plot(df["Unnamed: 2"], df["Excitation_690"], label = r"$excitation \; (\lambda_{em} = 690)$")
plt.xlabel(r"$\lambda$")
plt.ylabel('')
plt.legend()
plt.show()
fig_px = tls.mpl_to_plotly(fig)
C:\Users\alien\anaconda3\envs\plotly\lib\site-packages\plotly\matplotlylib\renderer.py:611: UserWarning:
I found a path object that I don't think is part of a bar chart. Ignoring.
import chart_studio
import chart_studio.plotly as py
Fill the credential file with your data (sign-up to chart-studio here, find the API key in the settings).
#username = "fill your user name here"
#api_key = "fill your API key here"
#chart_studio.tools.set_credentials_file(username=username, api_key=api_key)
py.plot(fig_px, filename = 'excitation_DDAO', auto_open=True)