commit
a6bee88053
|
|
@ -66,8 +66,7 @@ Let's plot all the text present on the table's PDF page.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
>>> camelot.plot(tables[0], kind='text')
|
>>> camelot.plot(tables[0], kind='text').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
||||||
|
|
@ -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')
|
>>> camelot.plot(tables[0], kind='grid').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
||||||
|
|
@ -118,8 +116,7 @@ Now, let's plot all table boundaries present on the table's PDF page.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
>>> camelot.plot(tables[0], kind='contour')
|
>>> camelot.plot(tables[0], kind='contour').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
||||||
|
|
@ -141,8 +138,7 @@ Cool, let's plot all line segments present on the table's PDF page.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
>>> camelot.plot(tables[0], kind='line')
|
>>> camelot.plot(tables[0], kind='line').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
||||||
|
|
@ -164,8 +160,7 @@ Finally, let's plot all line intersections present on the table's PDF page.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
>>> camelot.plot(tables[0], kind='joint')
|
>>> camelot.plot(tables[0], kind='joint').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
||||||
|
|
@ -187,8 +182,7 @@ You can also visualize the textedges found on a page by specifying ``kind='texte
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
>>> camelot.plot(tables[0], kind='textedge')
|
>>> camelot.plot(tables[0], kind='textedge').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
||||||
|
|
@ -375,8 +369,7 @@ Let's see the table area that is detected by default.
|
||||||
::
|
::
|
||||||
|
|
||||||
>>> tables = camelot.read_pdf('edge_tol.pdf', flavor='stream')
|
>>> tables = camelot.read_pdf('edge_tol.pdf', flavor='stream')
|
||||||
>>> camelot.plot(tables[0], kind='contour')
|
>>> camelot.plot(tables[0], kind='contour').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
||||||
|
|
@ -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)
|
>>> tables = camelot.read_pdf('edge_tol.pdf', flavor='stream', edge_tol=500)
|
||||||
>>> camelot.plot(tables[0], kind='contour')
|
>>> camelot.plot(tables[0], kind='contour').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
||||||
|
|
@ -472,8 +464,7 @@ Let's plot the table for this PDF.
|
||||||
::
|
::
|
||||||
|
|
||||||
>>> tables = camelot.read_pdf('short_lines.pdf')
|
>>> tables = camelot.read_pdf('short_lines.pdf')
|
||||||
>>> camelot.plot(tables[0], kind='grid')
|
>>> camelot.plot(tables[0], kind='grid').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. figure:: ../_static/png/short_lines_1.png
|
.. figure:: ../_static/png/short_lines_1.png
|
||||||
:alt: A plot of the PDF table with short lines
|
:alt: A plot of the PDF table with short lines
|
||||||
|
|
@ -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)
|
>>> tables = camelot.read_pdf('short_lines.pdf', line_scale=40)
|
||||||
>>> camelot.plot(tables[0], kind='grid')
|
>>> camelot.plot(tables[0], kind='grid').show()
|
||||||
>>> plt.show()
|
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
Here's how you can do the same with the :ref:`command-line interface <cli>`.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue