8000 Merge pull request #1083 from plotly/orca-change · plotly/documentation@6715299 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6715299

Browse files
authored
Merge pull request #1083 from plotly/orca-change
change orca typo in static-output python doc
2 parents e0f0e59 + 9c2bbfa commit 6715299

File tree

2 files changed

+36
-24
lines changed

2 files changed

+36
-24
lines changed

_posts/python/fundamentals/static-image/2015-06-30-static-image-export.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
</div>
2020
<div class="inner_cell">
2121
<div class="text_cell_render border-box-sizing rendered_html">
22-
<h4 id="New-to-Plotly?">New to Plotly?<a class="anchor-link" href="#New-to-Plotly?">&#182;</a></h4><p>Plotly's Python library is free and open source! <a href="https://plot.ly/python/getting-started/">Get started</a> by downloading the client and <a href="https://plot.ly/python/getting-started/">reading the primer</a>.
22+
<h4 id="New-to-Plotly?">New to Plotly?<a class="anchor-link" href="#New-to-Plotly?">&#194;&#182;</a></h4><p>Plotly's Python library is free and open source! <a href="https://plot.ly/python/getting-started/">Get started</a> by downloading the client and <a href="https://plot.ly/python/getting-started/">reading the primer</a>.
2323
<br>You can set up Plotly to work in <a href="https://plot.ly/python/getting-started/#initialization-for-online-plotting">online</a> or <a href="https://plot.ly/python/getting-started/#initialization-for-offline-plotting">offline</a> mode, or in <a href="https://plot.ly/python/getting-started/#start-plotting-online">jupyter notebooks</a>.
2424
<br>We also have a quick-reference <a href="https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf">cheatsheet</a> (new!) to help you get started!</p>
25-
<h3 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check">&#182;</a></h3><p>Note: The static image export API is available in version <b>3.2.0.+</b><br></p>
25+
<h3 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check">&#194;&#182;</a></h3><p>Note: The static image export API is available in version <b>3.2.0.+</b><br></p>
2626

2727
</div>
2828
</div>
@@ -66,17 +66,17 @@ <h3 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check"
6666
</div>
6767
<div class="inner_cell">
6868
<div class="text_cell_render border-box-sizing rendered_html">
69-
<h3 id="Static-Image-Export">Static Image Export<a class="anchor-link" href="#Static-Image-Export">&#182;</a></h3><p>New in version 3.2.0. It's now possible to programmatically export figures as high quality static images while fully offline.</p>
70-
<h4 id="Install-Dependencies">Install Dependencies<a class="anchor-link" href="#Install-Dependencies">&#182;</a></h4><p>Static image generation requires the <a href="https://github.com/plotly/orca">orca</a> commandline utility and the <a href="https://github.com/giampaolo/psutil">psutil</a> Python library. There are 3 general approach to installing these dependencies.</p>
71-
<h5 id="conda">conda<a class="anchor-link" href="#conda">&#182;</a></h5><p>Using the <a href="https://conda.io/docs/">conda</a> package manager, you can install these dependencies in a single command:</p>
69+
<h3 id="Static-Image-Export">Static Image Export<a class="anchor-link" href="#Static-Image-Export">&#194;&#182;</a></h3><p>New in version 3.2.0. It's now possible to programmatically export figures as high quality static images while fully offline.</p>
70+
<h4 id="Install-Dependencies">Install Dependencies<a class="anchor-link" href="#Install-Dependencies">&#194;&#182;</a></h4><p>Static image generation requires the <a href="https://github.com/plotly/orca">orca</a> commandline utility and the <a href="https://github.com/giampaolo/psutil">psutil</a> Python library. There are 3 general approach to installing these dependencies.</p>
71+
<h5 id="conda">conda<a class="anchor-link" href="#conda">&#194;&#182;</a></h5><p>Using the <a href="https://conda.io/docs/">conda</a> package manager, you can install these dependencies in a single command:</p>
7272

73-
<pre><code>$ conda install -c plotly-orca psutil</code></pre>
73+
<pre><code>$ conda install -c plotly plotly-orca psutil</code></pre>
7474
<p><strong>Note:</strong> Even if you don't want to use conda to manage your Python dependencies, it is still useful as a cross platform tool for managing native libraries and command-line utilities (e.g. git, wget, graphviz, boost, gcc, nodejs, cairo, etc.). For this use-case, start with <a href="https://conda.io/miniconda.html">Miniconda</a> (~60MB) and tell the installer to add itself to your system <code>PATH</code>. Then run <code>conda install plotly-orca</code> and the orca executable will be available system wide.</p>
75-
<h5 id="npm-+-pip">npm + pip<a class="anchor-link" href="#npm-+-pip">&#182;</a></h5><p>You can use the <a href="https://www.npmjs.com/get-npm">npm</a> package manager to install <code>orca</code> (and its <code>electron</code> dependency), and then use pip to install <code>psutil</code>:</p>
75+
<h5 id="npm-+-pip">npm + pip<a class="anchor-link" href="#npm-+-pip">&#194;&#182;</a></h5><p>You can use the <a href="https://www.npmjs.com/get-npm">npm</a> package manager to install <code>orca</code> (and its <code>electron</code> dependency), and then use pip to install <code>psutil</code>:</p>
7676

7777
<pre><code>$ npm install -g electron@1.8.4 orca
7878
$ pip install psutil</code></pre>
79-
<h5 id="Standalone-Binaries-+-pip">Standalone Binaries + pip<a class="anchor-link" href="#Standalone-Binaries-+-pip">&#182;</a></h5><p>If you are unable to install conda or npm, you can install orca as a precompiled binary for your operating system. Follow the instructions in the orca <a href="https://github.com/plotly/orca">README</a> to install orca and add it to your system <code>PATH</code>. Then use pip to install <code>psutil</code>.</p>
79+
<h5 id="Standalone-Binaries-+-pip">Standalone Binaries + pip<a class="anchor-link" href="#Standalone-Binaries-+-pip">&#194;&#182;</a></h5><p>If you are unable to install conda or npm, you can install orca as a precompiled binary for your operating system. Follow the instructions in the orca <a href="https://github.com/plotly/orca">README</a> to install orca and add it to your system <code>PATH</code>. Then use pip to install <code>psutil</code>.</p>
8080

8181
<pre><code>$ pip install psutil</code></pre>
8282

@@ -87,7 +87,7 @@ <h5 id="Standalone-Binaries-+-pip">Standalone Binaries + pip<a class="anchor-lin
8787
</div>
8888
<div class="inner_cell">
8989
<div class="text_cell_render border-box-sizing rendered_html">
90-
<h3 id="Create-a-Figure">Create a Figure<a class="anchor-link" href="#Create-a-Figure">&#182;</a></h3><p>Now let's create a simple scatter plot with 100 random points of variying color and size.</p>
90+
<h3 id="Create-a-Figure">Create a Figure<a class="anchor-link" href="#Create-a-Figure">&#194;&#182;</a></h3><p>Now let's create a simple scatter plot with 100 random points of variying color and size.</p>
9191

9292
</div>
9393
</div>
@@ -209,7 +209,7 @@ <h3 id="Create-a-Figure">Create a Figure<a class="anchor-link" href="#Create-a-F
209209
</div>
210210
<div class="inner_cell">
211211
<div class="text_cell_render border-box-sizing rendered_html">
212-
<h3 id="Write-Image-File">Write Image File<a class="anchor-link" href="#Write-Image-File">&#182;</a></h3><p>The <code>plotly.io.write_image</code> function is used to write an image to a file or file-like python object.</p>
212+
<h3 id="Write-Image-File">Write Image File<a class="anchor-link" href="#Write-Image-File">&#194;&#182;</a></h3><p>The <code>plotly.io.write_image</code> function is used to write an image to a file or file-like python object.</p>
213213
<p>Let's first create an output directory to store our images</p>
214214

215215
</div>
@@ -242,7 +242,7 @@ <h3 id="Write-Image-File">Write Image File<a class="anchor-link" href="#Write-Im
242242
</div>
243243
<div class="inner_cell">
244244
<div class="text_cell_render border-box-sizing rendered_html">
245-
<h4 id="Raster-Formats:-PNG,-JPEG,-and-WebP">Raster Formats: PNG, JPEG, and WebP<a class="anchor-link" href="#Raster-Formats:-PNG,-JPEG,-and-WebP">&#182;</a></h4>
245+
<h4 id="Raster-Formats:-PNG,-JPEG,-and-WebP">Raster Formats: PNG, JPEG, and WebP<a class="anchor-link" href="#Raster-Formats:-PNG,-JPEG,-and-WebP">&#194;&#182;</a></h4>
246246
</div>
247247
</div>
248248
</div>
@@ -316,7 +316,7 @@ <h4 id="Raster-Formats:-PNG,-JPEG,-and-WebP">Raster Formats: PNG, JPEG, and WebP
316316
</div>
317317
<div class="inner_cell">
318318
<div class="text_cell_render border-box-sizing rendered_html">
319-
<h4 id="Vector-Formats:-SVG-and-PDF...">Vector Formats: SVG and PDF...<a class="anchor-link" href="#Vector-Formats:-SVG-and-PDF...">&#182;</a></h4>
319+
<h4 id="Vector-Formats:-SVG-and-PDF...">Vector Formats: SVG and PDF...<a class="anchor-link" href="#Vector-Formats:-SVG-and-PDF...">&#194;&#182;</a></h4>
320320
</div>
321321
</div>
322322
</div>
@@ -399,7 +399,7 @@ <h4 id="Vector-Formats:-SVG-and-PDF...">Vector Formats: SVG and PDF...<a class="
399399
</div>
400400
<div class="inner_cell">
401401
<div class="text_cell_render border-box-sizing rendered_html">
402-
<h3 id="Get-Image-as-Bytes">Get Image as Bytes<a class="anchor-link" href="#Get-Image-as-Bytes">&#182;</a></h3><p>The <code>plotly.io.to_image</code> function is used to return an image as a bytes object.</p>
402+
<h3 id="Get-Image-as-Bytes">Get Image as Bytes<a class="anchor-link" href="#Get-Image-as-Bytes">&#194;&#182;</a></h3><p>The <code>plotly.io.to_image</code> function is used to return an image as a bytes object.</p>
403403
<p>Let convert the figure to a <strong>PNG</strong> bytes object...</p>
404404

405405
</div>
@@ -464,7 +464,7 @@ <h3 id="Get-Image-as-Bytes">Get Image as Bytes<a class="anchor-link" href="#Get-
464464
</div>
465465
<div class="inner_cell">
466466
<div class="text_cell_render border-box-sizing rendered_html">
467-
<h4 id="Display-Bytes-as-Image-Using-IPython.display.Image">Display Bytes as Image Using <code>IPython.display.Image</code><a class="anchor-link" href="#Display-Bytes-as-Image-Using-IPython.display.Image">&#182;</a></h4><p>A bytes object representing a PNG image can be displayed directly in the notebook using the <code>IPython.display.Image</code> class. This also works in the <a href="https://qtconsole.readthedocs.io/en/stable/">Qt Console for Jupyter</a>!</p>
467+
<h4 id="Display-Bytes-as-Image-Using-IPython.display.Image">Display Bytes as Image Using <code>IPython.display.Image</code><a class="anchor-link" href="#Display-Bytes-as-Image-Using-IPython.display.Image">&#194;&#182;</a></h4><p>A bytes object representing a PNG image can be displayed directly in the notebook using the <code>IPython.display.Image</code> class. This also works in the <a href="https://qtconsole.readthedocs.io/en/stable/">Qt Console for Jupyter</a>!</p>
468468

469469
</div>
470470
</div>
@@ -509,7 +509,7 @@ <h4 id="Display-Bytes-as-Image-Using-IPython.display.Image">Display Bytes as Ima
509509
</div>
510510
<div class="inner_cell">
511511
<div class="text_cell_render border-box-sizing rendered_html">
512-
<h3 id="Change-Image-Dimensions-and-Scale">Change Image Dimensions and Scale<a class="anchor-link" href="#Change-Image-Dimensions-and-Scale">&#182;</a></h3><p>In addition to the image format, the <code>to_image</code> and <code>write_image</code> functions provide arguments to specify the image <code>width</code> and <code>height</code> in logical pixels. They also provide a <code>scale</code> parameter that can be used to increase (<code>scale</code> &gt; 1) or decrease (<code>scale</code> &lt; 1) the physical resolution of the resulting image.</p>
512+
<h3 id="Change-Image-Dimensions-and-Scale">Change Image Dimensions and Scale<a class="anchor-link" href="#Change-Image-Dimensions-and-Scale">&#194;&#182;</a></h3><p>In addition to the image format, the <code>to_image</code> and <code>write_image</code> functions provide arguments to specify the image <code>width</code> and <code>height</code> in logical pixels. They also provide a <code>scale</code> parameter that can be used to increase (<code>scale</code> &gt; 1) or decrease (<code>scale</code> &lt; 1) the physical resolution of the resulting image.</p>
513513

514514
</div>
515515
</div>
@@ -554,7 +554,7 @@ <h3 id="Change-Image-Dimensions-and-Scale">Change Image Dimensions and Scale<a c
554554
</div>
555555
<div class="inner_cell">
556556
<div class="text_cell_render border-box-sizing rendered_html">
557-
<h3 id="Summary">Summary<a class="anchor-link" href="#Summary">&#182;</a></h3><p>In summary, to export high-quality static images from plotly.py all you need to do is install orca and psutil and then use the <code>plotly.io.write_image</code> and <code>plotly.io.to_image</code> functions.</p>
557+
<h3 id="Summary">Summary<a class="anchor-link" href="#Summary">&#194;&#182;</a></h3><p>In summary, to export high-quality static images from plotly.py all you need to do is install orca and psutil and then use the <code>plotly.io.write_image</code> and <code>plotly.io.to_image</code> functions.</p>
558558
<p>If you want to know more about how the orca integration works, or if you need to troubleshoot an issue, please check out the <a href="../orca-management/">Orca Management</a> section.</p>
559559

560560
</div>

_posts/python/fundamentals/static-image/static-image-export.ipynb

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"##### conda\n",
4949
"Using the [conda](https://conda.io/docs/) package manager, you can install these dependencies in a single command:\n",
5050
"```\n",
51-
"$ conda install -c plotly-orca psutil\n",
51+
"$ conda install -c plotly plotly-orca psutil\n",
5252
"```\n",
5353
"\n",
5454
"**Note:** Even if you don't want to use conda to manage your Python dependencies, it is still useful as a cross platform tool for managing native libraries and command-line utilities (e.g. git, wget, graphviz, boost, gcc, nodejs, cairo, etc.). For this use-case, start with [Miniconda](https://conda.io/miniconda.html) (~60MB) and tell the installer to add itself to your system `PATH`. Then run `conda install plotly-orca` and the orca executable will be available system wide.\n",
@@ -857,7 +857,7 @@
857857
},
858858
{
859859
"cell_type": "code",
860-
"execution_count": 17,
860+
"execution_count": 2,
861861
"metadata": {},
862862
"outputs": [
863863
{
@@ -889,18 +889,30 @@
889889
"output_type": "stream",
890890
"text": [
891891
"Collecting git+https://github.com/plotly/publisher.git\n",
892-
" Cloning https://github.com/plotly/publisher.git to /private/var/folders/x2/smn4tpcs0s1ft0gg294_fq7h0000gn/T/pip-req-build-_rjlen\n",
892+
" Cloning https://github.com/plotly/publisher.git to /private/var/folders/tc/bs9g6vrd36q74m5t8h9cgphh0000gn/T/pip-req-build-Imdlya\n",
893893
"Building wheels for collected packages: publisher\n",
894894
" Running setup.py bdist_wheel for publisher ... \u001b[?25ldone\n",
895-
"\u001b[?25h Stored in directory: /private/var/folders/x2/smn4tpcs0s1ft0gg294_fq7h0000gn/T/pip-ephem-wheel-cache-5WnI5R/wheels/99/3e/a0/fbd22ba24cca72bdbaba53dbc23c1768755fb17b3af0f33966\n",
895+
"\u001b[?25h Stored in directory: /private/var/folders/tc/bs9g6vrd36q74m5t8h9cgphh0000gn/T/pip-ephem-wheel-cache-K1Olar/wheels/99/3e/a0/fbd22ba24cca72bdbaba53dbc23c1768755fb17b3af0f33966\n",
896896
"Successfully built publisher\n",
897897
"Installing collected packages: publisher\n",
898898
" Found existing installation: publisher 0.11\n",
899899
" Uninstalling publisher-0.11:\n",
900900
" Successfully uninstalled publisher-0.11\n",
901-
"Successfully installed publisher-0.11\n",
902-
"\u001b[33mYou are using pip version 10.0.1, however version 18.0 is available.\n",
903-
"You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n"
901+
"Successfully installed publisher-0.11\n"
902+
]
903+
},
904+
{
905+
"name": "stderr",
906+
"output_type": "stream",
907+
"text": [
908+
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/nbconvert.py:13: ShimWarning:\n",
909+
"\n",
910+
"The `IPython.nbconvert` package has been deprecated since IPython 4.0. You should import from nbconvert instead.\n",
911+
"\n",
912+
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/publisher/publisher.py:53: UserWarning:\n",
913+
"\n",
914+
"Did you \"Save\" this notebook before running this command? Remember to save, always save.\n",
915+
"\n"
904916
]
905917
}
906918
],
@@ -948,7 +960,7 @@
948960
"name": "python",
949961
"nbconvert_exporter": "python",
950962
"pygments_lexer": "ipython2",
951-
"version": "2.7.15"
963+
"version": "2.7.12"
952964
}
953965
},
954966
"nbformat": 4,

0 commit comments

Comments
 (0)
0