.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "user-guide/usage/visualization/plot_1_basic.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_user-guide_usage_visualization_plot_1_basic.py: ************* Basic objects ************* This page explains plotting of basic geometric objects with :py:class:`wulfric.PlotlyEngine`. .. GENERATED FROM PYTHON SOURCE LINES 28-31 .. code-block:: Python import wulfric .. GENERATED FROM PYTHON SOURCE LINES 32-34 Points ====== .. GENERATED FROM PYTHON SOURCE LINES 34-47 .. code-block:: Python import numpy as np pe = wulfric.PlotlyEngine(_sphinx_gallery_fix=True) colors = np.random.randint(0, 255, (42, 3)) colors = [f"rgb({r},{g},{b})" for r, g, b in colors] pe.plot_points(points=np.random.random((42, 3)), colors=colors, scale=3) pe.show() .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 48-52 Vector ====== Vector is defined by its start and end points .. GENERATED FROM PYTHON SOURCE LINES 52-80 .. code-block:: Python pe = wulfric.PlotlyEngine(_sphinx_gallery_fix=True) pe.plot_vector(start_point=(0, 0, 0), end_point=(1, 1, 1)) pe.plot_vector( start_point=(0, 0, 0), end_point=(1, 0, 0), color="red", vector_label="x", ) pe.plot_vector( start_point=(0, 0, 0), end_point=(0, 1, 0), color="green", vector_label="y", ) pe.plot_vector( start_point=(0, 0, 0), end_point=(0, 0, 1), color="blue", vector_label="z", ) pe.show(axes_visible=False) .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 81-84 Line ==== Line is defined by two points .. GENERATED FROM PYTHON SOURCE LINES 84-100 .. code-block:: Python pe = wulfric.PlotlyEngine(_sphinx_gallery_fix=True) pe.plot_line( start_point=(0, 0, 0), end_point=(1, 0, 0), legend_group="square", legend_label="square", ) pe.plot_line(start_point=(1, 0, 0), end_point=(1, 1, 0), legend_group="square") pe.plot_line(start_point=(1, 1, 0), end_point=(0, 1, 0), legend_group="square") pe.plot_line(start_point=(0, 1, 0), end_point=(0, 0, 0), legend_group="square") pe.plot_line(start_point=(0.3, 1, 0.1), end_point=(3, 1, 2), legend_label="single line") pe.show() .. raw:: html


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.142 seconds) .. _sphx_glr_download_user-guide_usage_visualization_plot_1_basic.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_1_basic.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_1_basic.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_1_basic.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_