.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/basic_inline.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_basic_inline.py: Minimal working example ========================= Minimal working example of `pykz`, plotting a simple sine function. .. GENERATED FROM PYTHON SOURCE LINES 8-21 .. code-block:: Python import numpy as np import pykz x = np.linspace(0, 10, 100) y = np.sin(x) pykz.plot(x, y) # Export your tex code as a standalone file pykz.save("basic_inline.tex", standalone=True) # You could also directly build the pdf pykz.io.export_pdf_from_file("basic_inline.tex") .. image-sg:: /gallery/images/sphx_glr_basic_inline_001.png :alt: basic inline :srcset: /gallery/images/sphx_glr_basic_inline_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 'basic_inline.pdf' .. GENERATED FROM PYTHON SOURCE LINES 22-37 Alternatively, output it to png .. code-block:: python pykz.io.export_png_from_file("basic_inline.tex") Or, save the Tikz code to a temporary file, compile it, and open the pdf in the default viewer. This would be the equivalent to ``plt.show()`` .. code-block:: python pykz.preview() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.655 seconds) .. _sphx_glr_download_gallery_basic_inline.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: basic_inline.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: basic_inline.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: basic_inline.zip ` .. include:: basic_inline.recommendations .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_