Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Documentation conversion into Mkdocs #5384

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

Open
daexs wants to merge 176 commits into plotly:live-docs
base: live-docs
Choose a base branch
Loading
from daexs:mkdocs-conversion
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
a2787a0
- Move contents of `commands.py` to scripts in new `bin` directory an...
gvwilson Jul 10, 2025
3dced44
preload _plotly_utils
LiamConnors Jul 22, 2025
bc32c86
add docstrings directly to px functions
LiamConnors Dec 2, 2024
174b0e9
change docstring style
LiamConnors Jul 22, 2025
badb199
Merge pull request #5292 from plotly/plotly.express-docstrings
gvwilson Jul 22, 2025
86f69f1
Merge branch 'mkdocs-conversion' into preload-plotly-utils
gvwilson Jul 22, 2025
c0237f6
Merge pull request #5290 from plotly/preload-plotly-utils
gvwilson Jul 22, 2025
76b36dd
feat: numpy documentation style
gvwilson Jul 22, 2025
96af9f6
feat: regenerating Python code with .js fixes
gvwilson Jul 22, 2025
9525f6a
feat: converting doc/python/*.md using bin/run_markdown.py
gvwilson Jul 23, 2025
80792d8
better verbosity
gvwilson Jul 26, 2025
9386750
feat: conditionalize Makefile target for testing
gvwilson Jul 29, 2025
6d1e5c8
Merge remote-tracking branch 'origin/fix-docs' into mkdocs-conversion
gvwilson Jul 30, 2025
20c60ef
Merge remote-tracking branch 'origin/add-missing-imports' into mkdocs...
gvwilson Jul 30, 2025
a07ea45
feat: script to check all examples in doc/python.
gvwilson Jul 30, 2025
5cad013
use _parse_md function
LiamConnors Jul 30, 2025
2e38a9a
don't process code block in region sections
LiamConnors Jul 30, 2025
e45f54c
Merge pull request #5307 from plotly/update-script
gvwilson Jul 31, 2025
73a8291
modify tests to import from graph_objects
gvwilson Jul 30, 2025
36ee5e9
add trivial test to make sure plotly.graph_objects import works
gvwilson Aug 1, 2025
57d923c
updating notes
gvwilson Aug 1, 2025
ca37382
swapping graph_objs and graph_objects
gvwilson Aug 5, 2025
31b73ce
Added backslashes to descriptions with '[][]'
daexs Aug 12, 2025
fae9563
Fixed markdown formatting for valType 'info_array'
daexs Aug 14, 2025
c2e20c7
Added backslashes to descriptions with '[][]'
daexs Aug 12, 2025
0f9b311
Fixed markdown formatting for valType 'info_array'
daexs Aug 14, 2025
3f5ee9f
regenerating with latest changes
gvwilson Aug 14, 2025
f345aef
Fixed double bracket error for regular expressions
daexs Aug 14, 2025
f840f11
Minor code cleanup
daexs Aug 14, 2025
4a7873c
Fixed double bracket error in 'basedatatypes.py'
daexs Aug 14, 2025
b0cd2f9
Merge branch 'mkdocs-conversion' of https://github.com/plotly/plotly....
daexs Aug 14, 2025
cd623aa
Regenerated code after basevalidators.py changes
daexs Aug 14, 2025
98fab98
Fix SyntaxWarning and adjusted valType 'enumerated' docstring format.
daexs Aug 14, 2025
9ddde0f
Fixed formatting issues with nested enumerated docstrings in info_arr...
daexs Aug 15, 2025
683643c
Fixed list format in 'Dash' and 'String' properties.
daexs Aug 18, 2025
efde201
Fixed formatting for 'Compound' and 'color' properties.
daexs Aug 18, 2025
01da1c6
Fixed formatting for 'Integer' types.
daexs Aug 18, 2025
8d12a05
Fixed formatting for 'Colorscale', 'CompoundArray', and 'BaseData' ty...
daexs Aug 19, 2025
6690116
Fixed confusing indentation & some formatting
daexs Aug 19, 2025
4154910
Fixed formatting issues and consistency
daexs Aug 19, 2025
df9cc3a
feat: allow `--schema path` option to code generation
gvwilson Aug 20, 2025
77d19bb
Merge pull request #17 from gvwilson/mkdocs-conversion
daexs Aug 20, 2025
bdd049b
Fixed code block and type annotation formatting.
daexs Aug 21, 2025
cbd983d
Minor code cleanup
daexs Aug 21, 2025
95ea818
Fixed example parsing error
daexs Aug 22, 2025
31c8a2f
Fixed formatting issues and modified json file for double bracket error.
daexs Aug 25, 2025
f35c9fa
Fixed **kwargs bold formatting issue
daexs Aug 26, 2025
eef950e
Fixed types for parameters 'annotation', 'annotation_position', and '...
daexs Aug 26, 2025
e339098
Merge branch 'main' into mkdocs-conversion
gvwilson Aug 27, 2025
3e5ee8b
Merge branch 'main' into mkdocs-conversion
gvwilson Aug 27, 2025
a943429
saving generated example files
gvwilson Aug 27, 2025
569b6d7
feat: build YAML table of contents for examples
gvwilson Aug 27, 2025
6d2f32f
fix: switch to relative paths in examples
gvwilson Aug 27, 2025
dc0418a
feat: fixing some dangling references in doc/python example files
gvwilson Aug 28, 2025
66208c6
Added pages to nav bar and extra css styling
daexs Aug 28, 2025
d116e27
Fixed warnings and errors
daexs Aug 29, 2025
8607d4a
feat: allow bin/run_markdown.py to take a single block number for tes...
gvwilson Aug 29, 2025
9a40907
Fixed small import and missing module errors
daexs Sep 2, 2025
b215b37
Fixed small missing import and variable errors. Also added 'getting-s...
daexs Sep 3, 2025
1847061
Added permalinks to replace empty md files
daexs Sep 3, 2025
9da9b2d
Fixed Image not JSON serializable error
daexs Sep 3, 2025
883c0d9
Edited comment for clarity
daexs Sep 3, 2025
63882d0
Fixed deprecation warning for 'type' found when county-choropleth.md ...
daexs Sep 3, 2025
7e8a638
Fixed 403 Error from Wikimedia when reading image
daexs Sep 4, 2025
77e76af
Made variable state shared across codeblocks and cleaned up previous ...
daexs Sep 4, 2025
1d1620c
Fixed html image rendering and reading image from wikimedia
daexs Sep 4, 2025
2310f66
Replaced image rendering from IPython's image display and overrided P...
daexs Sep 5, 2025
a673e59
Fixed pip install invalid syntax error
daexs Sep 5, 2025
0fa35da
Fixed some references and absolute links that were broken
daexs Sep 8, 2025
1d89e17
Removed ' install' and added versions. Also changed the umap module i...
daexs Sep 9, 2025
373e1bc
Removed from the navigation bar and reverted previous changes to pac...
daexs Sep 10, 2025
6e300ad
Configured mkdocs to be able to resolve absolute links and set them r...
daexs Sep 11, 2025
c3a98b6
Edited navigation bar to make section names more user friendly.
daexs Sep 17, 2025
64b30da
Reorganized the navigation bar to match the existing Python docs.
daexs Sep 17, 2025
8f43c74
add some links, css, and restructure content
LiamConnors Sep 17, 2025
e712a01
Update is-plotly-free.md
LiamConnors Sep 17, 2025
6aeb223
Update mkdocs.yml
LiamConnors Sep 17, 2025
1fadabe
Update mkdocs.yml
LiamConnors Sep 18, 2025
d970523
Update is-plotly-free.md
LiamConnors Sep 18, 2025
3514472
Manually added new script that generates the API Reference markdown p...
daexs Sep 19, 2025
8beee0d
Excluded some markdown files from docs nav bar build to prevent log m...
daexs Sep 19, 2025
a4dc547
Merge branch 'mkdocs-conversion' into update-names
LiamConnors Sep 22, 2025
6c8ea1b
Merge pull request #48 from daexs/update-names
LiamConnors Sep 22, 2025
d6fc630
Fix lists not rendering properly in some examples
daexs Sep 22, 2025
4f0c61a
Fixed minor mistake in the Makefile when running 'examples-force'
daexs Sep 22, 2025
566c835
Added syntax highlighting to python code blocks
daexs Sep 22, 2025
430e485
add plotly studio and dash club info
LiamConnors Sep 22, 2025
5deca22
Update mkdocs.yml
LiamConnors Sep 22, 2025
b4c5cb4
delete generated images
LiamConnors Sep 23, 2025
0c3d202
add dataset from docs generation
LiamConnors Sep 23, 2025
259a8e1
only generate html
LiamConnors Sep 23, 2025
0fac168
update html generation
LiamConnors Sep 23, 2025
6cf3ff4
move examples
LiamConnors Sep 23, 2025
ee82f48
remove duplicate files
LiamConnors Sep 23, 2025
8de444f
regen files
LiamConnors Sep 23, 2025
b8319de
Reinclude pages not directly accessible from navigation and suppress ...
daexs Sep 23, 2025
7994893
Merge pull request #68 from daexs/add-banner
LiamConnors Sep 23, 2025
d74a371
Merge pull request #70 from daexs/add-gh-repo
LiamConnors Sep 23, 2025
c6099ed
Merge branch 'mkdocs-conversion' into restructure-2
LiamConnors Sep 23, 2025
0d19bd5
Merge pull request #72 from daexs/restructure-2
LiamConnors Sep 23, 2025
d88da53
add missing reference pages
LiamConnors Sep 23, 2025
c24f7d6
Update mkdocs.yml
LiamConnors Sep 23, 2025
a2d466e
Update mkdocs.yml
LiamConnors Sep 23, 2025
d077940
Fixed internal links for axes.md
daexs Sep 23, 2025
ecc2b1f
Fixed some internal links and fixed 'figure-structure.md' content bei...
daexs Sep 23, 2025
816001b
Merge pull request #73 from daexs/add-back-missing-ref
LiamConnors Sep 24, 2025
36bd491
Changed 'https://plotly.com/python/' links into internal links and fi...
daexs Sep 25, 2025
fb5d918
removing out-of-date notes
gvwilson Sep 25, 2025
4fdae5b
Changed links pointing to 'https://plot.ly' into internal links
daexs Sep 25, 2025
402d03f
Merge branch 'mkdocs-conversion' of https://github.com/daexs/plotly.p...
daexs Sep 25, 2025
ea587d9
refactor: small cleanups to build process
gvwilson Sep 26, 2025
1d2046a
Remove image base64 conversion code from the examples
daexs Sep 26, 2025
28d14dd
feat: remove unused metadata in Markdown files
gvwilson Sep 26, 2025
c1e1a1b
Replaced all links to 'https://plotly.com/python-api-reference/' into...
daexs Sep 26, 2025
44e72d0
Update run_markdown.py
LiamConnors Sep 29, 2025
4d2be36
Fixed missing import statements for plotly.express and urllib.request
daexs Sep 29, 2025
f6bf056
Fixed links rendering as regular text and lists not rendering correctly.
daexs Sep 29, 2025
8db0756
Added custom formatter and styling to hide code blocks with 'hide_cod...
daexs Sep 30, 2025
9161db0
Fixed 'docs' rule
daexs Sep 30, 2025
a265548
Changed the docstring style of the plotly figure_factory module to numpy
daexs Oct 1, 2025
f17cb33
Fixed links to correctly reference their respective files and render ...
daexs Oct 1, 2025
362eba4
Fixed html rendering in codeblocks
daexs Oct 1, 2025
b7b3f28
Reformatted dash code blocks to allow the code snippets and charts to...
daexs Oct 1, 2025
01036e1
Remove previously added custom formatter to hide Dash code
daexs Oct 1, 2025
3ba7f1e
Added styling to remove maplibre controls container under the interac...
daexs Oct 2, 2025
16f34ec
Merge pull request #81 from daexs/fix-mathjax
LiamConnors Oct 3, 2025
a79bdb8
add redirects
LiamConnors Oct 3, 2025
064a52f
Merge pull request #88 from daexs/add-redirects
daexs Oct 3, 2025
a5a1c00
Added plotly studio image to the nav bar.
daexs Oct 6, 2025
108933b
Cleaned up 'plotly-styles.css' file and removed the arrow indicating ...
daexs Oct 6, 2025
e2464dd
Fixed dash_bio figures not rendering in 'doc/python/bio-clustergram.md'.
daexs Oct 6, 2025
db53d9b
Merge branch 'mkdocs-conversion' of https://github.com/daexs/plotly.p...
daexs Oct 6, 2025
8cc3b51
Fixed headings that weren't rendering in Markdown properly.
daexs Oct 7, 2025
4bc8eed
Added back orca-management.md into the navigation
daexs Oct 8, 2025
29e6b84
Resolved more links and added a new redirect for 'mapbox-layers'
daexs Oct 8, 2025
abb898f
Added footer and adjusted height of plotly studio image
daexs Oct 9, 2025
38e69f4
Fixed minor link typo in footer
daexs Oct 9, 2025
68c6d16
Added header and dash banner image
daexs Oct 14, 2025
03120e6
Minor fix to navigation page titles
daexs Oct 16, 2025
d8e18b2
Merge pull request #86 from daexs/fix-plotly-module-formatting
daexs Oct 16, 2025
66eea0e
Merge pull request #87 from daexs/fix-html-and-dash-render
daexs Oct 16, 2025
270fade
Merging mkdocs-conversion into this branch and resolving merge conflicts
daexs Oct 16, 2025
001cb53
Merge pull request #80 from daexs/remove-unused-metadata
daexs Oct 16, 2025
e22fbb7
Adjusted title of pages in graph_objects module figure overview
daexs Oct 16, 2025
0fa6e72
Merge pull request #98 from daexs/adjust-styling-and-format
daexs Oct 16, 2025
37aacd4
Fixed minor naming error for header div.
daexs Oct 16, 2025
55db0a6
Added index pages to each category in the nav bar.
daexs Oct 20, 2025
3204832
Converted redirect links into internal links.
daexs Oct 21, 2025
51eb8fc
Resolved links and removed Dash banner from the bottom of the 'Overvi...
daexs Oct 21, 2025
faf9bfb
Added dash examples to select index pages and updated dash banner logic
daexs Oct 21, 2025
622af18
Added more redirects, changed redirect links in markdown files, resol...
daexs Oct 22, 2025
ef612af
Redisplay external link arrows on dash banner and plotly studio ad. S...
daexs Oct 22, 2025
e64dc40
Changed the text for all internal links that used to be 'https://plot...
daexs Oct 22, 2025
3caa780
Remove page that was accidentally added.
daexs Oct 22, 2025
2eb1590
Changed name of 'migrate-to-maplibre.md' to remain consistent with li...
daexs Oct 23, 2025
79f7440
Updated page name reference for mapbox to maplibre migration.
daexs Oct 23, 2025
654fde1
Resolved more links, added a redirect, and fixed list render
daexs Oct 23, 2025
9ff8730
Fix list rendering
daexs Oct 23, 2025
eb6ed26
Added styling for footer text when page is in dark mode.
daexs Oct 23, 2025
ae2f80b
Added extensions to allow proper LaTeX rendering
daexs Oct 23, 2025
ae54f18
Converted callouts into admonitions
daexs Oct 24, 2025
a7a5122
Fixed graph rendering in creating-and-updating-figures.md
daexs Oct 27, 2025
e1ac526
Added more admonitions
daexs Oct 27, 2025
3f03d07
Remove empty python blocks
daexs Oct 27, 2025
9fe8873
Added more admonitions, including those for warning messages
daexs Oct 27, 2025
9643249
Updated plotly ad on nav bar
daexs Oct 27, 2025
2c8f030
Added css styling to keep tables within the width of the page's body/
daexs Oct 27, 2025
fea9b38
Added an 'edit this page' button
daexs Oct 27, 2025
edf2b1a
Fixed styling of icon in edit button
daexs Oct 27, 2025
3ae43db
Merge branch 'mkdocs-conversion' into update-link-text
daexs Oct 28, 2025
89b3dd4
Merge pull request #102 from daexs/update-link-text
daexs Oct 28, 2025
87da393
Merge remote-tracking branch 'upstream/live-docs' into mkdocs-conversion
daexs Oct 28, 2025
c28d17a
Update meta descriptions for files in pages/, rename markdown files i...
daexs Oct 30, 2025
305e674
Minor formatting change and added missing function into 'plotly/expre...
daexs Oct 31, 2025
fe05438
Fixed graph rendering
daexs Oct 31, 2025
f5a4c3e
Patched img.show to embed the images generated properly.
daexs Nov 1, 2025
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
Prev Previous commit
Next Next commit
Made variable state shared across codeblocks and cleaned up previous ...
...fixes to imports/variables missing in subsequent code blocks.
  • Loading branch information
daexs committed Sep 4, 2025
commit 77e76af45f60495aa337cfd9d41866335e1fab41
16 changes: 10 additions & 6 deletions bin/run_markdown.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,15 @@ def _report(condition, message):
def _run_all_blocks(args, code_blocks, stem=None, block_number=None):
"""Run blocks found in a file."""
execution_results = []
env = {
"__name__": "__main__",
"__file__": "<markdown_code>",
}
figure_counter = 0
for i, block in enumerate(code_blocks):
if block_number is None:
_report(args.verbose > 1, f"- Executing block {i}/{len(code_blocks)}")
figure_counter, result = _run_code(block["code"], args.outdir, figure_counter, stem)
figure_counter, result = _run_code(block["code"], args.outdir, figure_counter, stem, env)
execution_results.append(result)
_report(args.verbose > 0 and bool(result["error"]), f" - Warning: block {i} had an error")
_report(args.verbose > 1 and bool(result["images"]), f" - Generated {len(result['images'])} image(s)")
Expand All @@ -224,7 +228,7 @@ def _run_all_blocks(args, code_blocks, stem=None, block_number=None):
return execution_results


def _run_code(code, output_dir, figure_counter, stem):
def _run_code(code, output_dir, figure_counter, stem, exec_globals):
"""Execute code capturing output and generated files."""
# Capture stdout and stderr
stdout_buffer = io.StringIO()
Expand All @@ -239,10 +243,10 @@ def _run_code(code, output_dir, figure_counter, stem):
try:

# Create a namespace for code execution
exec_globals = {
"__name__": "__main__",
"__file__": "<markdown_code>",
}
# exec_globals = {
# "__name__": "__main__",
# "__file__": "<markdown_code>",
# }

# Execute the code with output capture
with redirect_stdout(stdout_buffer), redirect_stderr(stderr_buffer):
Expand Down
4 changes: 0 additions & 4 deletions doc/python/creating-and-updating-figures.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,6 @@ fig.show()
Note that the following `update_layout()` operations are equivalent:

```python
import plotly.graph_objects as go

fig = go.Figure(data=go.Bar(x=[1, 2, 3], y=[1, 3, 2]))

fig.update_layout(title_text="update_layout() Syntax Example",
title_font_size=30)

Expand Down
3 changes: 0 additions & 3 deletions doc/python/ecdf-plots.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ In `standard` mode (the default), the right-most point is at 1 (or the total cou

```python
import plotly.express as px
df = px.data.tips()
fig = px.ecdf(df, x=[1,2,3,4], markers=True, ecdfmode="standard",
title="ecdfmode='standard' (Y=fraction at or below X value, this the default)")
fig.show()
Expand All @@ -106,7 +105,6 @@ In `reversed` mode, the right-most point is at 1 (or the total count/sum, depend

```python
import plotly.express as px
df = px.data.tips()
fig = px.ecdf(df, x=[1,2,3,4], markers=True, ecdfmode="reversed",
title="ecdfmode='reversed' (Y=fraction at or above X value)")
fig.show()
Expand All @@ -116,7 +114,6 @@ In `complementary` mode, the right-most point is at 0 and no points are at 1 (or

```python
import plotly.express as px
df = px.data.tips()
fig = px.ecdf(df, x=[1,2,3,4], markers=True, ecdfmode="complementary",
title="ecdfmode='complementary' (Y=fraction above X value)")
fig.show()
Expand Down
2 changes: 0 additions & 2 deletions doc/python/figure-introspection.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ print(full_fig.data[0])
We see that this is an instance of `go.Scatter` (as expected, given the input) and that it has an attribute we've maybe never heard of called `cliponaxis` which by default seems to be set to `True` in this case. Let's find out more about this attribute using the built-in Python `help()` function

```python
import plotly.graph_objects as go
help(go.Scatter.cliponaxis)
```

Expand All @@ -131,7 +130,6 @@ fig.show()
We can use this technique (of making a figure, and querying Plotly.js for the "full" version of that figure, and then exploring the attributes that are automatically set for us) to learn more about the range of possibilities that the figure schema makes available. We can drill down into `layout` attributes also:

```python
import plotly.graph_objects as go
help(go.layout.XAxis.autorange)
```

Expand Down
38 changes: 0 additions & 38 deletions doc/python/figurewidget.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,14 @@ f
Add traces or update the layout and then watch the output above update in real time.

```python
import plotly.graph_objects as go
f = go.FigureWidget()

f.add_scatter(y=[2, 1, 4, 3])
```

```python
import plotly.graph_objects as go
f = go.FigureWidget()
f.add_scatter(y=[2, 1, 4, 3])

f.add_bar(y=[1, 4, 3, 2])
```

```python
import plotly.graph_objects as go
f = go.FigureWidget()
f.add_scatter(y=[2, 1, 4, 3])
f.add_bar(y=[1, 4, 3, 2])

f.layout.title = 'Hello FigureWidget'
```

Expand All @@ -85,42 +73,18 @@ f.layout.title = 'Hello FigureWidget'
#### Update the Data and the Layout

```python
import plotly.graph_objects as go
f = go.FigureWidget()
f.add_scatter(y=[2, 1, 4, 3])
f.add_bar(y=[1, 4, 3, 2])
f.layout.title = 'Hello FigureWidget'

# update scatter data
scatter = f.data[0]
scatter.y = [3, 1, 4, 3]
```

```python
import plotly.graph_objects as go
f = go.FigureWidget()
f.add_scatter(y=[2, 1, 4, 3])
f.add_bar(y=[1, 4, 3, 2])
f.layout.title = 'Hello FigureWidget'
scatter = f.data[0]
scatter.y = [3, 1, 4, 3]

# update bar data
bar = f.data[1]
bar.y = [5, 3, 2, 8]
```

```python
import plotly.graph_objects as go
f = go.FigureWidget()
f.add_scatter(y=[2, 1, 4, 3])
f.add_bar(y=[1, 4, 3, 2])
f.layout.title = 'Hello FigureWidget'
scatter = f.data[0]
scatter.y = [3, 1, 4, 3]
bar = f.data[1]
bar.y = [5, 3, 2, 8]

f.layout.title.text = 'This is a new title'
```

Expand Down Expand Up @@ -150,7 +114,5 @@ f2
See [these Jupyter notebooks](https://github.com/jonmmease/plotly_ipywidget_notebooks) for even more FigureWidget examples.

```python
import plotly.graph_objects as go

help(go.FigureWidget)
```
10 changes: 0 additions & 10 deletions doc/python/network-graphs.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,8 @@ G = nx.random_geometric_graph(200, 0.125)
Add edges as disconnected lines in a single trace and nodes as a scatter trace

```python
import plotly.graph_objects as go
import networkx as nx

G = nx.random_geometric_graph(200, 0.125)
edge_x = []
edge_y = []

for edge in G.edges():
x0, y0 = G.nodes[edge[0]]['pos']
x1, y1 = G.nodes[edge[1]]['pos']
Expand Down Expand Up @@ -120,16 +115,11 @@ Another option would be to size points by the number of connections
i.e. ```node_trace.marker.size = node_adjacencies```

```python
import networkx as nx

G = nx.random_geometric_graph(200, 0.125)
node_adjacencies = []
node_text = []

for node, adjacencies in enumerate(G.adjacency()):
node_adjacencies.append(len(adjacencies[1]))
node_text.append('# of connections: '+str(len(adjacencies[1])))

node_trace.marker.color = node_adjacencies
node_trace.text = node_text
```
Expand Down
2 changes: 0 additions & 2 deletions doc/python/px-arguments.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ df.head()
By default `px.data` functions return a pandas `DataFrame` object, but you can specify an alternative dataframe type using `return_type`. `pandas`, `polars`, `pyarrow`, `modin`, and `cuDF` are supported return types.

```python
import plotly.express as px

df = px.data.iris(return_type='polars')
df.head()
```
Expand Down
10 changes: 0 additions & 10 deletions doc/python/static-image-export.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -204,23 +204,13 @@ Here's the bytes object displayed using `IPython.display.Image`:

```python
from IPython.display import Image
import plotly.express as px
data_canada = px.data.gapminder().query("country == 'Canada'")
fig = px.bar(data_canada, x='year', y='pop')
img_bytes = fig.to_image(format="png")

Image(img_bytes)
```

## Specify Image Dimensions and Scale
In addition to the image format, the `to_image` and `write_image` functions provide arguments to specify the image `width` and `height` in logical pixels. They also provide a `scale` parameter that can be used to increase (`scale` > 1) or decrease (`scale` < 1) the physical resolution of the resulting image.

```python
from IPython.display import Image
import plotly.express as px
data_canada = px.data.gapminder().query("country == 'Canada'")
fig = px.bar(data_canada, x='year', y='pop')

img_bytes = fig.to_image(format="png", width=600, height=350, scale=2)
Image(img_bytes)
```
Expand Down
6 changes: 0 additions & 6 deletions doc/python/ternary-contour.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ fig.show()
Two modes are available in order to interpolate between data points: interpolation in Cartesian space (`interp_mode='cartesian'`) or interpolation using the [isometric log-ratio transformation](https://link.springer.com/article/10.1023/A:1023818214614) (see also [preprint](https://www.researchgate.net/profile/Leon_Parent2/post/What_is_the_best_approach_for_diagnosing_nutrient_disorders_and_formulating_fertilizer_recommendations/attachment/59d62a69c49f478072e9cf3f/AS%3A272541220835360%401441990298625/download/Egozcue+et+al+2003.pdf)), `interp_mode='ilr'`. The `ilr` transformation preserves metrics in the [simplex](https://en.wikipedia.org/wiki/Simplex) but is not defined on its edges.

```python
import numpy as np
import plotly.figure_factory as ff

a, b = np.mgrid[0:1:20j, 0:1:20j]
mask = a + b <= 1
a, b = a[mask], b[mask]
Expand All @@ -141,9 +138,6 @@ fig.show()
```

```python
import numpy as np
import plotly.figure_factory as ff

a, b = np.mgrid[0:1:20j, 0:1:20j]
mask = a + b <= 1
a, b = a[mask], b[mask]
Expand Down
6 changes: 0 additions & 6 deletions doc/python/ternary-scatter-contour.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ print(clean_data({'L1': ['.03 0.5 0.47','0.4 0.5 0.1']}))

```python
import plotly.graph_objects as go
import pandas as pd

scatter_raw_data = pd.read_json('https://raw.githubusercontent.com/plotly/datasets/master/scatter_data.json')
scatter_data = scatter_raw_data['Data']

a_list = []
b_list = []
Expand Down Expand Up @@ -117,9 +113,7 @@ fig.show()

```python
import plotly.graph_objects as go
import pandas as pd

contour_raw_data = pd.read_json('https://raw.githubusercontent.com/plotly/datasets/master/contour_data.json')
contour_dict = contour_raw_data['Data']

# Defining a colormap:
Expand Down
2 changes: 0 additions & 2 deletions doc/python/v4-migration.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ fig.show()

```python
# Restore default theme
import plotly.io as pio

pio.templates.default = "plotly"
```

Expand Down

AltStyle によって変換されたページ (->オリジナル) /