Skip to content

Commit ea48087

Browse files
committed
small colorlover+pandas edit
1 parent e275ddf commit ea48087

File tree

2 files changed

+31
-39
lines changed

2 files changed

+31
-39
lines changed

_posts/pandas/colorlover/2015-06-30-colorlover-with-pandas.html

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
permalink: pandas/colorlover/
2+
permalink: pandas/colorlover
33
description: How to easily add colorscales to pandas dataframe using Colorlover and Plotly.
44
title: Pandas Adding Colorscales with Colorlover | plotly
55
has_thumbnail: true
@@ -18,24 +18,21 @@
1818
</div>
1919
<div class="inner_cell">
2020
<div class="text_cell_render border-box-sizing rendered_html">
21-
<h2 id="Adding-Colorscales-to-Pandas-DataFrames">Adding Colorscales to Pandas DataFrames<a class="anchor-link" href="#Adding-Colorscales-to-Pandas-DataFrames">&#182;</a></h2><p><code>Colorlover</code> is a great library for easily accessing the colorscales. We can use it to conveniently provide the colorscales for Plotly Charts. We will be using <a href="https://github.com/santosjorge/cufflinks"><code>cufflinks</code></a> library, which binds Plotly directly to pandas dataframes.</p>
21+
<h2 id="Adding-Colorscales-to-Pandas-DataFrames">Adding Colorscales to Pandas DataFrames<a class="anchor-link" href="#Adding-Colorscales-to-Pandas-DataFrames">&#182;</a></h2><p><code>Colorlover</code> is a great library for easily accessing colorscales. We can use it to conveniently provide the colorscales for Plotly Charts! We will be using the <a href="https://github.com/santosjorge/cufflinks"><code>cufflinks</code></a> library, which binds Plotly directly to pandas dataframes.</p>
2222
<p>To install Cufflinks:</p>
2323

2424
</div>
2525
</div>
2626
</div>
27-
<div class="cell border-box-sizing code_cell rendered">
28-
<div class="input">
29-
<div class="prompt input_prompt">In&nbsp;[1]:</div>
27+
<div class="cell border-box-sizing text_cell rendered">
28+
<div class="prompt input_prompt">
29+
</div>
3030
<div class="inner_cell">
31-
<div class="input_area">
32-
<div class=" highlight hl-ipython2"><pre><span class="o">!</span> pip install cufflinks
33-
</pre></div>
31+
<div class="text_cell_render border-box-sizing rendered_html">
32+
<p><code>$ pip install cufflinks</code></p>
3433

3534
</div>
3635
</div>
37-
</div>
38-
3936
</div>
4037
<div class="cell border-box-sizing text_cell rendered">
4138
<div class="prompt input_prompt">
@@ -47,18 +44,15 @@ <h2 id="Adding-Colorscales-to-Pandas-DataFrames">Adding Colorscales to Pandas Da
4744
</div>
4845
</div>
4946
</div>
50-
<div class="cell border-box-sizing code_cell rendered">
51-
<div class="input">
52-
<div class="prompt input_prompt">In&nbsp;[2]:</div>
47+
<div class="cell border-box-sizing text_cell rendered">
48+
<div class="prompt input_prompt">
49+
</div>
5350
<div class="inner_cell">
54-
<div class="input_area">
55-
<div class=" highlight hl-ipython2"><pre><span class="o">!</span>pip install colorlover
56-
</pre></div>
51+
<div class="text_cell_render border-box-sizing rendered_html">
52+
<p><code>$ pip install colorlover</code></p>
5753

5854
</div>
5955
</div>
60-
</div>
61-
6256
</div>
6357
<div class="cell border-box-sizing text_cell rendered">
6458
<div class="prompt input_prompt">
@@ -100,7 +94,7 @@ <h3 id="Using-Colorlover-to-easily-access-colorscales:">Using Colorlover to easi
10094
</div>
10195
<div class="inner_cell">
10296
<div class="text_cell_render border-box-sizing rendered_html">
103-
<p>For example, To access all the colorscales with 9 colors:</p>
97+
<p>For example, to access all the colorscales with 9 colors:</p>
10498

10599
</div>
106100
</div>
@@ -197,7 +191,7 @@ <h3 id="Plotting-the-data-using-Plotly:">Plotting the data using Plotly:<a class
197191
<div class="output_area"><div class="prompt output_prompt">Out[8]:</div>
198192

199193
<div class="output_html rendered_html output_subarea output_execute_result">
200-
<iframe id="igraph" scrolling="no" style="border:none;" seamless="seamless" src="https://plot.ly/~tarzzz/1847.embed" height="587px" width="1116px"></iframe>
194+
<iframe id="igraph" scrolling="no" style="border:none;" seamless="seamless" src="https://plot.ly/~chelsea_lyn/11299.embed" height="525px" width="100%"></iframe>
201195
</div>
202196

203197
</div>
@@ -247,7 +241,7 @@ <h3 id="Adding-Colorscales-using-Colorlover:">Adding Colorscales using Colorlove
247241
<div class="output_area"><div class="prompt output_prompt">Out[10]:</div>
248242

249243
<div class="output_html rendered_html output_subarea output_execute_result">
250-
<iframe id="igraph" scrolling="no" style="border:none;" seamless="seamless" src="https://plot.ly/~tarzzz/1857.embed" height="587px" width="1116px"></iframe>
244+
<iframe id="igraph" scrolling="no" style="border:none;" seamless="seamless" src="https://plot.ly/~chelsea_lyn/11301.embed" height="525px" width="100%"></iframe>
251245
</div>
252246

253247
</div>
@@ -261,8 +255,8 @@ <h3 id="Adding-Colorscales-using-Colorlover:">Adding Colorscales using Colorlove
261255
</div>
262256
<div class="inner_cell">
263257
<div class="text_cell_render border-box-sizing rendered_html">
264-
<p>List of all the colorscales supported by <code>colorlover</code> is available <a href="https://plot.ly/ipython-notebooks/color-scales/#All-colors" target="_blank">Here</a></p>
258+
<p>A list of all the colorscales supported by <code>colorlover</code> is available <a href="http://nbviewer.jupyter.org/gist/jackparmer/4696226c9b6b931bbdf6#All-colors" target="_blank">here!</a></p>
265259

266260
</div>
267261
</div>
268-
</div>{% endraw %}
262+
</div>{% endraw %}

_posts/pandas/colorlover/colorlover-with-pandas.ipynb

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,18 @@
66
"source": [
77
"## Adding Colorscales to Pandas DataFrames\n",
88
"\n",
9-
"`Colorlover` is a great library for easily accessing the colorscales. We can use it to conveniently provide the colorscales for Plotly Charts. We will be using [`cufflinks`](https://github.com/santosjorge/cufflinks) library, which binds Plotly directly to pandas dataframes.\n",
9+
"`Colorlover` is a great library for easily accessing colorscales. We can use it to conveniently provide the colorscales for Plotly Charts! We will be using the [`cufflinks`](https://github.com/santosjorge/cufflinks) library, which binds Plotly directly to pandas dataframes.\n",
1010
"\n",
1111
"To install Cufflinks:"
1212
]
1313
},
1414
{
15-
"cell_type": "code",
16-
"execution_count": 1,
15+
"cell_type": "markdown",
1716
"metadata": {
1817
"collapsed": false
1918
},
20-
"outputs": [],
2119
"source": [
22-
"! pip install cufflinks"
20+
"`$ pip install cufflinks`"
2321
]
2422
},
2523
{
@@ -30,14 +28,12 @@
3028
]
3129
},
3230
{
33-
"cell_type": "code",
34-
"execution_count": 2,
31+
"cell_type": "markdown",
3532
"metadata": {
3633
"collapsed": false
3734
},
38-
"outputs": [],
3935
"source": [
40-
"!pip install colorlover"
36+
"`$ pip install colorlover`"
4137
]
4238
},
4339
{
@@ -73,7 +69,7 @@
7369
"cell_type": "markdown",
7470
"metadata": {},
7571
"source": [
76-
"For example, To access all the colorscales with 9 colors:"
72+
"For example, to access all the colorscales with 9 colors:"
7773
]
7874
},
7975
{
@@ -142,13 +138,14 @@
142138
"cell_type": "code",
143139
"execution_count": 8,
144140
"metadata": {
145-
"collapsed": false
141+
"collapsed": false,
142+
"scrolled": true
146143
},
147144
"outputs": [
148145
{
149146
"data": {
150147
"text/html": [
151-
"<iframe id=\"igraph\" scrolling=\"no\" style=\"border:none;\" seamless=\"seamless\" src=\"https://plot.ly/~tarzzz/1847.embed\" height=\"587px\" width=\"1116px\"></iframe>"
148+
"<iframe id=\"igraph\" scrolling=\"no\" style=\"border:none;\" seamless=\"seamless\" src=\"https://plot.ly/~chelsea_lyn/11299.embed\" height=\"525px\" width=\"100%\"></iframe>"
152149
],
153150
"text/plain": [
154151
"<plotly.tools.PlotlyDisplay object>"
@@ -185,13 +182,14 @@
185182
"cell_type": "code",
186183
"execution_count": 10,
187184
"metadata": {
188-
"collapsed": false
185+
"collapsed": false,
186+
"scrolled": true
189187
},
190188
"outputs": [
191189
{
192190
"data": {
193191
"text/html": [
194-
"<iframe id=\"igraph\" scrolling=\"no\" style=\"border:none;\" seamless=\"seamless\" src=\"https://plot.ly/~tarzzz/1857.embed\" height=\"587px\" width=\"1116px\"></iframe>"
192+
"<iframe id=\"igraph\" scrolling=\"no\" style=\"border:none;\" seamless=\"seamless\" src=\"https://plot.ly/~chelsea_lyn/11301.embed\" height=\"525px\" width=\"100%\"></iframe>"
195193
],
196194
"text/plain": [
197195
"<plotly.tools.PlotlyDisplay object>"
@@ -210,12 +208,12 @@
210208
"cell_type": "markdown",
211209
"metadata": {},
212210
"source": [
213-
"List of all the colorscales supported by `colorlover` is available <a href=\"http://nbviewer.jupyter.org/gist/jackparmer/4696226c9b6b931bbdf6#All-colors\" target=\"_blank\">Here</a>"
211+
"A list of all the colorscales supported by `colorlover` is available <a href=\"http://nbviewer.jupyter.org/gist/jackparmer/4696226c9b6b931bbdf6#All-colors\" target=\"_blank\">here!</a>"
214212
]
215213
},
216214
{
217215
"cell_type": "code",
218-
"execution_count": 15,
216+
"execution_count": 12,
219217
"metadata": {
220218
"collapsed": false
221219
},

0 commit comments

Comments
 (0)