Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7fbecc6

Browse files
committed
fixing thumbnails
1 parent e2b5b60 commit 7fbecc6

File tree

3 files changed

+191
-4
lines changed

3 files changed

+191
-4
lines changed

_posts/python/3d-filled-line/2015-06-30-3d-filled-line.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
description: How to make 3D Filled Line Plots in Python
44
name: 3D Filled Line Plots in Python | plotly
55
has_thumbnail: true
6-
thumbnail: /images/ribbon-plot.png
6+
thumbnail: thumbnail/3d-filled-line-plot.jpg
77
layout: user-guide
88
name: 3D Filled Line Plots
99
language: python

_posts/python/3d-filled-line/3d-filled-line.ipynb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
},
105105
{
106106
"cell_type": "code",
107-
"execution_count": 4,
107+
"execution_count": 1,
108108
"metadata": {
109109
"collapsed": false
110110
},
@@ -138,14 +138,24 @@
138138
"output_type": "stream",
139139
"text": [
140140
"Collecting git+https://github.com/plotly/publisher.git\n",
141-
" Cloning https://github.com/plotly/publisher.git to /var/folders/j3/gt_q6y096cjfts4q8zq2dm2c0000gn/T/pip-AtpAGH-build\n",
141+
" Cloning https://github.com/plotly/publisher.git to /var/folders/j3/gt_q6y096cjfts4q8zq2dm2c0000gn/T/pip-PLJ3Bv-build\n",
142142
"Installing collected packages: publisher\n",
143143
" Found existing installation: publisher 0.10\n",
144144
" Uninstalling publisher-0.10:\n",
145145
" Successfully uninstalled publisher-0.10\n",
146146
" Running setup.py install for publisher\n",
147147
"Successfully installed publisher-0.10\n"
148148
]
149+
},
150+
{
151+
"name": "stderr",
152+
"output_type": "stream",
153+
"text": [
154+
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/nbconvert.py:13: ShimWarning: The `IPython.nbconvert` package has been deprecated. You should import from nbconvert instead.\n",
155+
" \"You should import from nbconvert instead.\", ShimWarning)\n",
156+
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/publisher/publisher.py:53: UserWarning: Did you \"Save\" this notebook before running this command? Remember to save, always save.\n",
157+
" warnings.warn('Did you \"Save\" this notebook before running this command? '\n"
158+
]
149159
}
150160
],
151161
"source": [
@@ -161,7 +171,7 @@
161171
" 'How to make 3D Filled Line Plots in Python',\n",
162172
" title = '3D Filled Line Plots in Python | plotly',\n",
163173
" name = '3D Filled Line Plots',\n",
164-
" has_thumbnail='true', thumbnail='/images/ribbon-plot.png', \n",
174+
" has_thumbnail='true', thumbnail='thumbnail/3d-filled-line-plot.jpg', \n",
165175
" language='python', page_type='example_index', \n",
166176
" display_as='3d_charts', order=4)"
167177
]
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"#### Basic Ribbon Plot"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {
14+
"collapsed": false
15+
},
16+
"outputs": [
17+
{
18+
"data": {
19+
"text/html": [
20+
"<iframe id=\"igraph\" scrolling=\"no\" style=\"border:none;\" seamless=\"seamless\" src=\"https://plot.ly/~demo_account/28.embed\" height=\"525px\" width=\"100%\"></iframe>"
21+
],
22+
"text/plain": [
23+
"<plotly.tools.PlotlyDisplay object>"
24+
]
25+
},
26+
"execution_count": 1,
27+
"metadata": {},
28+
"output_type": "execute_result"
29+
}
30+
],
31+
"source": [
32+
"import plotly.plotly as py\n",
33+
"import plotly.graph_objs as go\n",
34+
"import urllib\n",
35+
"\n",
36+
"import numpy as np\n",
37+
"\n",
38+
"url = \"https://raw.githubusercontent.com/plotly/datasets/master/spectral.csv\"\n",
39+
"f = urllib.urlopen(url)\n",
40+
"spectra=np.loadtxt(f, delimiter=',')\n",
41+
"\n",
42+
"traces = []\n",
43+
"y_raw = spectra[:, 0] # wavelength\n",
44+
"sample_size = spectra.shape[1]-1 \n",
45+
"for i in range(1, sample_size):\n",
46+
" z_raw = spectra[:, i]\n",
47+
" x = []\n",
48+
" y = []\n",
49+
" z = []\n",
50+
" ci = int(255/sample_size*i) # ci = \"color index\"\n",
51+
" for j in range(0, len(z_raw)):\n",
52+
" z.append([z_raw[j], z_raw[j]])\n",
53+
" y.append([y_raw[j], y_raw[j]])\n",
54+
" x.append([i*2, i*2+1])\n",
55+
" traces.append(dict(\n",
56+
" z=z,\n",
57+
" x=x,\n",
58+
" y=y,\n",
59+
" colorscale=[ [i, 'rgb(%d,%d,255)'%(ci, ci)] for i in np.arange(0,1.1,0.1) ],\n",
60+
" showscale=False,\n",
61+
" type='surface',\n",
62+
" ))\n",
63+
"\n",
64+
"fig = { 'data':traces, 'layout':{'title':'Ribbon Plot'} }\n",
65+
"py.iplot(fig, filename='ribbon-plot-python')"
66+
]
67+
},
68+
{
69+
"cell_type": "markdown",
70+
"metadata": {},
71+
"source": [
72+
"#### Reference"
73+
]
74+
},
75+
{
76+
"cell_type": "markdown",
77+
"metadata": {},
78+
"source": [
79+
"See https://plot.ly/python/reference/ for more information!"
80+
]
81+
},
82+
{
83+
"cell_type": "code",
84+
"execution_count": 2,
85+
"metadata": {
86+
"collapsed": false
87+
},
88+
"outputs": [
89+
{
90+
"data": {
91+
"text/html": [
92+
"<link href=\"//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Inconsolata|Ubuntu+Mono:400,700\" rel=\"stylesheet\" type=\"text/css\" />"
93+
],
94+
"text/plain": [
95+
"<IPython.core.display.HTML object>"
96+
]
97+
},
98+
"metadata": {},
99+
"output_type": "display_data"
100+
},
101+
{
102+
"data": {
103+
"text/html": [
104+
"<link rel=\"stylesheet\" type=\"text/css\" href=\"http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css\">"
105+
],
106+
"text/plain": [
107+
"<IPython.core.display.HTML object>"
108+
]
109+
},
110+
"metadata": {},
111+
"output_type": "display_data"
112+
},
113+
{
114+
"name": "stdout",
115+
"output_type": "stream",
116+
"text": [
117+
"Collecting git+https://github.com/plotly/publisher.git\n",
118+
" Cloning https://github.com/plotly/publisher.git to /var/folders/j3/gt_q6y096cjfts4q8zq2dm2c0000gn/T/pip-mVwKTQ-build\n",
119+
"Installing collected packages: publisher\n",
120+
" Found existing installation: publisher 0.10\n",
121+
" Uninstalling publisher-0.10:\n",
122+
" Successfully uninstalled publisher-0.10\n",
123+
" Running setup.py install for publisher\n",
124+
"Successfully installed publisher-0.10\n"
125+
]
126+
}
127+
],
128+
"source": [
129+
"from IPython.display import display, HTML\n",
130+
"\n",
131+
"display(HTML('<link href=\"//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Inconsolata|Ubuntu+Mono:400,700\" rel=\"stylesheet\" type=\"text/css\" />'))\n",
132+
"display(HTML('<link rel=\"stylesheet\" type=\"text/css\" href=\"http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css\">'))\n",
133+
"\n",
134+
"! pip install git+https://github.com/plotly/publisher.git --upgrade\n",
135+
"import publisher\n",
136+
"publisher.publish(\n",
137+
" 'ribbon.ipynb', 'python/ribbon-plots/', 'Python Ribbon Plots | plotly',\n",
138+
" 'How to make ribbon plots in Python. ',\n",
139+
" title = 'Python Ribbon Plots | plotly',\n",
140+
" name = 'Ribbon Plots',\n",
141+
" has_thumbnail='true', thumbnail='thumbnail/ribbon-plot.jpg', \n",
142+
" language='python', page_type='example_index', \n",
143+
" display_as='3d_charts', order=5)"
144+
]
145+
},
146+
{
147+
"cell_type": "code",
148+
"execution_count": null,
149+
"metadata": {
150+
"collapsed": true
151+
},
152+
"outputs": [],
153+
"source": []
154+
}
155+
],
156+
"metadata": {
157+
"kernelspec": {
158+
"display_name": "Python 2",
159+
"language": "python",
160+
"name": "python2"
161+
},
162+
"language_info": {
163+
"codemirror_mode": {
164+
"name": "ipython",
165+
"version": 2
166+
},
167+
"file_extension": ".py",
168+
"mimetype": "text/x-python",
169+
"name": "python",
170+
"nbconvert_exporter": "python",
171+
"pygments_lexer": "ipython2",
172+
"version": "2.7.9"
173+
}
174+
},
175+
"nbformat": 4,
176+
"nbformat_minor": 0
177+
}

0 commit comments

Comments
 (0)