diff --git a/doc/python/LaTeX.md b/doc/python/LaTeX.md new file mode 100644 index 00000000000..7070cbf2d95 --- /dev/null +++ b/doc/python/LaTeX.md @@ -0,0 +1,68 @@ +--- +jupyter: + jupytext: + notebook_metadata_filter: all + text_representation: + extension: .md + format_name: markdown + format_version: '1.2' + jupytext_version: 1.4.2 + kernelspec: + display_name: Python 3 + language: python + name: python3 + language_info: + codemirror_mode: + name: ipython + version: 3 + file_extension: .py + mimetype: text/x-python + name: python + nbconvert_exporter: python + pygments_lexer: ipython3 + version: 3.7.7 + plotly: + description: How to add LaTeX to python graphs. + display_as: advanced_opt + language: python + layout: base + name: LaTeX + order: 5 + page_type: example_index + permalink: python/LaTeX/ + thumbnail: thumbnail/latex.jpg +--- + +#### LaTeX Typesetting + +```python +import plotly.express as px + +fig = px.line(x=[1, 2, 3, 4], y=[1, 4, 9, 16], title=r'$\alpha_{1c} = 352 \pm 11 \text{ km s}^{-1}$') +fig.update_layout( + xaxis_title=r'$\sqrt{(n_\text{c}(t|{T_\text{early}}))}$', + yaxis_title=r'$d, r \text{ (solar radius)}$' +) +fig.show() +``` + +```python +import plotly.graph_objs as go + +fig = go.Figure() +fig.add_trace(go.Scatter( + x=[1, 2, 3, 4], + y=[1, 4, 9, 16], + name=r'$\alpha_{1c} = 352 \pm 11 \text{ km s}^{-1}$' +)) +fig.add_trace(go.Scatter( + x=[1, 2, 3, 4], + y=[0.5, 2, 4.5, 8], + name=r'$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$' +)) +fig.update_layout( + xaxis_title=r'$\sqrt{(n_\text{c}(t|{T_\text{early}}))}$', + yaxis_title=r'$d, r \text{ (solar radius)}$' +) +fig.show() +``` diff --git a/doc/python/imshow.md b/doc/python/imshow.md index cf8639a65dd..1ca97b4b5f9 100644 --- a/doc/python/imshow.md +++ b/doc/python/imshow.md @@ -412,9 +412,7 @@ See the [tutorial on facet plots](/python/facet-plots/) for more information on ```python import plotly.express as px from skimage import io -from skimage.data import image_fetcher -path = image_fetcher.fetch('data/cells.tif') -data = io.imread(path) +data = io.imread("https://github.com/scikit-image/skimage-tutorials/raw/main/images/cells.tif") img = data[20:45:2] fig = px.imshow(img, facet_col=0, binary_string=True, facet_col_wrap=5) fig.show() @@ -446,9 +444,7 @@ For three-dimensional image datasets, obtained for example by MRI or CT in medic ```python import plotly.express as px from skimage import io -from skimage.data import image_fetcher -path = image_fetcher.fetch('data/cells.tif') -data = io.imread(path) +data = io.imread("https://github.com/scikit-image/skimage-tutorials/raw/main/images/cells.tif") img = data[25:40] fig = px.imshow(img, animation_frame=0, binary_string=True, labels=dict(animation_frame="slice")) fig.show() @@ -476,9 +472,7 @@ It is possible to view 4-dimensional datasets (for example, 3-D images evolving ```python import plotly.express as px from skimage import io -from skimage.data import image_fetcher -path = image_fetcher.fetch('data/cells.tif') -data = io.imread(path) +data = io.imread("https://github.com/scikit-image/skimage-tutorials/raw/main/images/cells.tif") data = data.reshape((15, 4, 256, 256))[5:] fig = px.imshow(data, animation_frame=0, facet_col=1, binary_string=True) fig.show() diff --git a/doc/python/ml-tsne-umap-projections.md b/doc/python/ml-tsne-umap-projections.md index 683897eb8c4..dfd7d78d866 100644 --- a/doc/python/ml-tsne-umap-projections.md +++ b/doc/python/ml-tsne-umap-projections.md @@ -5,8 +5,8 @@ jupyter: text_representation: extension: .md format_name: markdown - format_version: '1.1' - jupytext_version: 1.1.1 + format_version: '1.2' + jupytext_version: 1.4.2 kernelspec: display_name: Python 3 language: python diff --git a/doc/requirements.txt b/doc/requirements.txt index 14257257cd5..6e2f295857a 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,7 +6,7 @@ pandas==1.0.3 statsmodels==0.11.1 scipy==1.3.1 patsy==0.5.1 -numpy==1.16.0 +numpy==1.19.5 plotly-geo python-igraph geopandas==0.8.1 @@ -16,7 +16,7 @@ psutil requests networkx squarify -scikit-image +scikit-image==0.18.1 scikit-learn sphinx sphinx_bootstrap_theme @@ -27,7 +27,7 @@ datashader pyarrow cufflinks==0.17.3 kaleido -umap-learn +umap-learn==0.5.1 pooch wget nbconvert==5.6.1 diff --git a/packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_graph_objs.py b/packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_graph_objs.py index 3b79dd62826..bec7d01feee 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_graph_objs.py +++ b/packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_graph_objs.py @@ -7,7 +7,6 @@ "AngularAxis", "Annotation", "Annotations", - "Area", "Bar", "Box", "ColorBar", diff --git a/packages/python/plotly/setup.py b/packages/python/plotly/setup.py index 395111c03e9..b7df3e2ba64 100644 --- a/packages/python/plotly/setup.py +++ b/packages/python/plotly/setup.py @@ -245,7 +245,7 @@ def get_latest_publish_build_info(repo, branch): builds = [ j for j in branch_jobs - if j.get("workflows", {}).get("job_name", None) == "publish" + if j.get("workflows", {}).get("job_name", None) == "publish-dist" and j.get("status", None) == "success" ] build = builds[0] diff --git a/packages/python/plotly/tox.ini b/packages/python/plotly/tox.ini index 72169192a08..635cd9478c3 100644 --- a/packages/python/plotly/tox.ini +++ b/packages/python/plotly/tox.ini @@ -58,12 +58,12 @@ deps= retrying==1.3.3 pytest==3.5.1 pandas==0.24.2 + numpy==1.19.5 xarray==0.10.9 statsmodels==0.10.2 pillow==5.2.0 backports.tempfile==1.0 optional: --editable=file:///{toxinidir}/../plotly-geo - optional: numpy==1.16.5 optional: ipython[all]==5.1.0 optional: ipywidgets==7.2.0 optional: ipykernel==4.8.2