GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — fastplotlib/examples/line/inf_line.py at streamplot · fastplotlib/fastplotlib Expand file tree/ Copy pathinf_line.pyMore file actions 44 lines (33 loc) · 1.06 KB / Copy pathinf_line.pyFile metadata and controls44 lines (33 loc) · 1.06 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 """ Infinite Lines ============== Draw infinite vertical and horizontal lines to mark positions on a plot. """ # test_example = true # sphinx_gallery_pygfx_docs = 'screenshot' import fastplotlib as fpl import numpy as np figure = fpl.Figure(size=(700, 560)) xs = np.linspace(0, 4 * np.pi, 100) ys = np.sin(xs) data = np.column_stack([xs, ys]) figure[0, 0].add_line(data, thickness=2, colors="w") # vertical lines at the zero-crossings, one color per line by passing a list of colors zero_crossings = np.array([0, np.pi, 2 * np.pi, 3 * np.pi, 4 * np.pi]) figure[0, 0].add_inf_line( zero_crossings, axis="x", colors=["r", "g", "b", "c", "m"], thickness=2 ) # dashed horizontal lines at the sine bounds, provided as a 1D array of y-values figure[0, 0].add_inf_line( np.array([-1.0, 1.0]), axis="y", colors="gray", thickness=2, dash_pattern="--", ) figure.show() # NOTE: fpl.loop.run() should not be used for interactive sessions # See the "JupyterLab and IPython" section in the user guide if __name__ == "__main__": print(__doc__) fpl.loop.run() |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |