Skip to content

latex docs #3157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions doc/python/LaTeX.md
Original file line number Diff line number Diff line change
@@ -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()
```
12 changes: 3 additions & 9 deletions doc/python/imshow.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions doc/python/ml-tsne-umap-projections.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,7 +16,7 @@ psutil
requests
networkx
squarify
scikit-image
scikit-image==0.18.1
scikit-learn
sphinx
sphinx_bootstrap_theme
Expand All @@ -27,7 +27,7 @@ datashader
pyarrow
cufflinks==0.17.3
kaleido
umap-learn
umap-learn==0.5.1
pooch
wget
nbconvert==5.6.1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"AngularAxis",
"Annotation",
"Annotations",
"Area",
"Bar",
"Box",
"ColorBar",
Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down