Skip to content
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

Update advanced.rst #119

Merged
merged 2 commits into from
Aug 13, 2020
Merged
Changes from all commits
Commits
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
30 changes: 10 additions & 20 deletions docs/user/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ Let's plot all the text present on the table's PDF page.

::

>>> camelot.plot(tables[0], kind='text')
>>> plt.show()
>>> camelot.plot(tables[0], kind='text').show()

.. tip::
Here's how you can do the same with the :ref:`command-line interface <cli>`.
Expand All @@ -93,8 +92,7 @@ Let's plot the table (to see if it was detected correctly or not). This plot typ

::

>>> camelot.plot(tables[0], kind='grid')
>>> plt.show()
>>> camelot.plot(tables[0], kind='grid').show()

.. tip::
Here's how you can do the same with the :ref:`command-line interface <cli>`.
Expand All @@ -118,8 +116,7 @@ Now, let's plot all table boundaries present on the table's PDF page.

::

>>> camelot.plot(tables[0], kind='contour')
>>> plt.show()
>>> camelot.plot(tables[0], kind='contour').show()

.. tip::
Here's how you can do the same with the :ref:`command-line interface <cli>`.
Expand All @@ -141,8 +138,7 @@ Cool, let's plot all line segments present on the table's PDF page.

::

>>> camelot.plot(tables[0], kind='line')
>>> plt.show()
>>> camelot.plot(tables[0], kind='line').show()

.. tip::
Here's how you can do the same with the :ref:`command-line interface <cli>`.
Expand All @@ -164,8 +160,7 @@ Finally, let's plot all line intersections present on the table's PDF page.

::

>>> camelot.plot(tables[0], kind='joint')
>>> plt.show()
>>> camelot.plot(tables[0], kind='joint').show()

.. tip::
Here's how you can do the same with the :ref:`command-line interface <cli>`.
Expand All @@ -187,8 +182,7 @@ You can also visualize the textedges found on a page by specifying ``kind='texte

::

>>> camelot.plot(tables[0], kind='textedge')
>>> plt.show()
>>> camelot.plot(tables[0], kind='textedge').show()

.. tip::
Here's how you can do the same with the :ref:`command-line interface <cli>`.
Expand Down Expand Up @@ -375,8 +369,7 @@ Let's see the table area that is detected by default.
::

>>> tables = camelot.read_pdf('edge_tol.pdf', flavor='stream')
>>> camelot.plot(tables[0], kind='contour')
>>> plt.show()
>>> camelot.plot(tables[0], kind='contour').show()

.. tip::
Here's how you can do the same with the :ref:`command-line interface <cli>`.
Expand All @@ -396,8 +389,7 @@ To improve the detected area, you can increase the ``edge_tol`` (default: 50) va
::

>>> tables = camelot.read_pdf('edge_tol.pdf', flavor='stream', edge_tol=500)
>>> camelot.plot(tables[0], kind='contour')
>>> plt.show()
>>> camelot.plot(tables[0], kind='contour').show()

.. tip::
Here's how you can do the same with the :ref:`command-line interface <cli>`.
Expand Down Expand Up @@ -472,8 +464,7 @@ Let's plot the table for this PDF.
::

>>> tables = camelot.read_pdf('short_lines.pdf')
>>> camelot.plot(tables[0], kind='grid')
>>> plt.show()
>>> camelot.plot(tables[0], kind='grid').show()

.. figure:: ../_static/png/short_lines_1.png
:alt: A plot of the PDF table with short lines
Expand All @@ -484,8 +475,7 @@ Clearly, the smaller lines separating the headers, couldn't be detected. Let's t
::

>>> tables = camelot.read_pdf('short_lines.pdf', line_scale=40)
>>> camelot.plot(tables[0], kind='grid')
>>> plt.show()
>>> camelot.plot(tables[0], kind='grid').show()

.. tip::
Here's how you can do the same with the :ref:`command-line interface <cli>`.
Expand Down