.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/basic_customized.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_customized.py: Basic customization ===================== You can use keyword arguments to add options to your plots. These options generate ``pgfkeys`` options in the final output. Therefore, any string that can be interpreted by ``pdflatex`` is a valid value. .. GENERATED FROM PYTHON SOURCE LINES 10-27 .. code-block:: Python import numpy as np import pykz pykz.figure() x = np.linspace(0, 10, 100) y = np.sin(x) y2 = np.cos(x) pykz.plot(x, y, color="black", label="sine function") pykz.plot(x, y2, color="blue", label="cosine function") # Export your tex code as a standalone file pykz.save("basic_customized.tex", standalone=True) # You could also directly build the pdf pykz.io.export_pdf_from_file("basic_customized.tex") .. image-sg:: /gallery/images/sphx_glr_basic_customized_001.png :alt: basic customized :srcset: /gallery/images/sphx_glr_basic_customized_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 'basic_customized.pdf' .. GENERATED FROM PYTHON SOURCE LINES 28-43 Alternatively, output it to png .. code-block:: python pykz.io.export_png_from_file("basic_customized.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.730 seconds) .. _sphx_glr_download_gallery_basic_customized.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: basic_customized.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: basic_customized.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: basic_customized.zip ` .. include:: basic_customized.recommendations .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_