Skip to main content
Ctrl+K

🖼️ Sphinx-Gallery

  • User guide
  • Advanced
  • Demo galleries
  • Contribution Guide
  • Changelog
  • GitHub
  • PyPI
  • User guide
  • Advanced
  • Demo galleries
  • Contribution Guide
  • Changelog
  • GitHub
  • PyPI

Section Navigation

  • Basics Gallery with Matplotlib
    • Local module
    • Introductory example - Plotting sin
    • Plotting the exponential function
    • Seaborn example
    • Capturing output representations
    • Choosing the thumbnail figure
    • Providing a figure for the thumbnail image
    • Using Unicode everywhere 🤗
    • Identifying function names in a script
    • Using sys.argv in examples
    • Matplotlib animation support
    • Force plots to be displayed on separate lines
    • No image output examples
      • A short Python script
      • Example that fails to execute
      • Example that fails to execute (with normal thumbnail behaviour)
      • Constrained Text output frame
      • SyntaxError
  • Notebook-style Narrative Gallery
    • Alternating text and code
  • Plotly Gallery
    • Example with the plotly graphing library
  • PyVista Gallery
    • Collision
    • Plotting Glyphs (Vectors or PolyData)
    • Lighting Properties
    • Ray Tracing
  • Example Galleries
  • Basics Gallery with Matplotlib
  • Local module

Note

Go to the end to download the full example code. or to run this example in your browser via JupyterLite or Binder

Local module#

This example demonstrates how local modules can be imported. This module is imported in the example ‘Plotting the exponential function’ (plot_exp.py).

N = 100

Estimated memory usage: 0 MB

Launch binder
Launch JupyterLite

Download Jupyter notebook: local_module.ipynb

Download Python source code: local_module.py

Download zipped: local_module.zip

Gallery generated by Sphinx-Gallery

previous

Basics Gallery with Matplotlib

next

Introductory example - Plotting sin

Download source code
Download Jupyter notebook
Download zipped
Launch JupyterLite
Launch binder

© Copyright 2014-2025, Sphinx-gallery developers.

Created using Sphinx 8.1.3.

Built with the PyData Sphinx Theme 0.16.1.