diff --git a/doc/python/3d-mesh.md b/doc/python/3d-mesh.md index a543b9cd02..36d5b79877 100644 --- a/doc/python/3d-mesh.md +++ b/doc/python/3d-mesh.md @@ -42,7 +42,7 @@ import plotly.graph_objects as go import numpy as np # Download data set from plotly repo -pts = np.loadtxt(np.DataSource().open('https://raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt')) +pts = np.loadtxt(np.lib.npyio.DataSource().open('https://raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt')) x, y, z = pts.T fig = go.Figure(data=[go.Mesh3d(x=x, y=y, z=z, color='lightpink', opacity=0.50)]) @@ -58,7 +58,7 @@ The `alphahull` parameter sets the shape of the mesh. If the value is -1 (defaul import plotly.graph_objects as go import numpy as np -pts = np.loadtxt(np.DataSource().open('https://raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt')) +pts = np.loadtxt(np.lib.npyio.DataSource().open('https://raw.githubusercontent.com/plotly/datasets/master/mesh_dataset.txt')) x, y, z = pts.T fig = go.Figure(data=[go.Mesh3d(x=x, y=y, z=z, diff --git a/doc/python/colorscales.md b/doc/python/colorscales.md index b47fbb5f1c..282aa38c74 100644 --- a/doc/python/colorscales.md +++ b/doc/python/colorscales.md @@ -443,7 +443,7 @@ fig.show() ```python import plotly.graph_objects as go -import urllib +import urllib.request import json response = urllib.request.urlopen( @@ -535,7 +535,7 @@ Like axes, you can customize the color bar ticks, labels, and values with `ticks ```python import plotly.graph_objects as go -import urllib +import urllib.request import json # Load heatmap data @@ -570,7 +570,7 @@ By default, color bars are displayed vertically. You can change a color bar to b ```python import plotly.graph_objects as go -import urllib +import urllib.request import json # Load heatmap data @@ -647,7 +647,7 @@ See the positioning section of [the figure data structure page](/python/figure-s ```python import plotly.graph_objects as go -import urllib +import urllib.request import json # Load heatmap data diff --git a/doc/python/graphing-multiple-chart-types.md b/doc/python/graphing-multiple-chart-types.md index a1f7fca1c7..610e498af7 100644 --- a/doc/python/graphing-multiple-chart-types.md +++ b/doc/python/graphing-multiple-chart-types.md @@ -173,7 +173,7 @@ import plotly.graph_objects as go # Load data import json -import urllib +import urllib.request response = urllib.request.urlopen( "https://raw.githubusercontent.com/plotly/datasets/master/steepest.json") diff --git a/doc/python/sankey-diagram.md b/doc/python/sankey-diagram.md index 5159c645c0..e384208a72 100644 --- a/doc/python/sankey-diagram.md +++ b/doc/python/sankey-diagram.md @@ -66,7 +66,7 @@ fig.show() ```python import plotly.graph_objects as go -import urllib, json +import urllib.request, json url = 'https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/mocks/sankey_energy.json' response = urllib.request.urlopen(url) @@ -126,7 +126,7 @@ This example also uses [hovermode](https://plotly.com/python/reference/layout/#l ```python import plotly.graph_objects as go -import urllib, json +import urllib.request, json url = 'https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/mocks/sankey_energy.json' response = urllib.request.urlopen(url)