pysmithchart


Namepysmithchart JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryA Python library extending Matplotlib to generate Smith Charts.
upload_time2025-02-05 22:08:12
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseBSD
keywords smith chart impedance reflection rf engineering microwave
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. |pypi| image:: https://img.shields.io/pypi/v/pysmithchart?color=68CA66
   :target: https://pypi.org/project/pysmithchart/
   :alt: PyPI

.. |github| image:: https://img.shields.io/github/v/tag/scottprahl/pysmithchart?label=github&color=68CA66
   :target: https://github.com/scottprahl/pysmithchart
   :alt: GitHub

.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/pysmithchart?label=conda&color=68CA66
   :target: https://github.com/conda-forge/pysmithchart-feedstock
   :alt: Conda

.. |license| image:: https://img.shields.io/github/license/scottprahl/pysmithchart?color=68CA66
   :target: https://github.com/scottprahl/pysmithchart/blob/main/LICENSE.txt
   :alt: License

.. |test| image:: https://github.com/scottprahl/pysmithchart/actions/workflows/test.yaml/badge.svg
   :target: https://github.com/scottprahl/pysmithchart/actions/workflows/test.yaml
   :alt: Testing

.. |docs| image:: https://readthedocs.org/projects/pysmithchart/badge?color=68CA66
   :target: https://pysmithchart.readthedocs.io
   :alt: Docs

.. |downloads| image:: https://img.shields.io/pypi/dm/pysmithchart?color=68CA66
   :target: https://pypi.org/project/pysmithchart/
   :alt: Downloads

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/psf/black
   :alt: code style: black


pysmithchart
============

|pypi| |github| |conda| |downloads|

|license| |test| |docs| |black|

Overview
--------

**pysmithchart** is a matplotlib extension that adds a custom projection for creating
Smith Charts in Python. Originally forked from `pysmithplot <https://github.com/vMeijin/pySmithPlot>`_,
this library has been updated to work with modern matplotlib versions while preserving
a rich set of features for RF and microwave engineering applications.

The package enables visualization and analysis of reflection coefficients,
impedances, and admittances. It seamlessly integrates into the matplotlib ecosystem,
providing full control over plot appearance, grid customizations, interpolation
of complex data, and even advanced marker handling.

Key Capabilities
----------------

- **Smith Projection:** Plot data on a Smith chart using the `SmithAxes` projection.
- **Multiple Data Types:** Easily plot S-parameters, normalized impedances (Z) and admittances (Y).
- **Grid Customization:** Draw major/minor gridlines as arcs with "fancy" adaptive
  spacing and styling options.
- **Interpolation & Equidistant Points:** Optionally smooth or resample plotted data.
- **Marker Customization:** Manipulate start and end markers (with optional rotation)
  to emphasize data endpoints.
- **Full Matplotlib Integration:** Use matplotlib’s standard API along with extra keywords
  for specialized Smith chart plotting.

Installation
------------

Install pysmithchart with pip:

.. code-block:: bash

    pip install pysmithchart

Or install via conda:

.. code-block:: bash

    conda install -c conda-forge pysmithchart

Quick Start Examples
--------------------

Below are a few examples to help you get started quickly.

**Example 1: Plotting a Reflection Coefficient (S-parameter)**

This example creates a Smith chart and plots a simple reflection coefficient:

.. code-block:: python

    import numpy as np
    import matplotlib.pyplot as plt
    from pysmithchart import S_PARAMETER

    # array of reflection coefficients
    S = [0.5 + 0.3j, -0.2 - 0.1j]

    # Create a subplot that will use the Smith projection.
    plt.figure(figsize=(6,6))
    plt.subplot(1, 1, 1, projection="smith", grid_major_color_x='red', grid_major_color_y='blue')

    # Plot the reflection (scattering) coefficients
    plt.plot(S, ls='', markersize=10, datatype=S_PARAMETER)

    plt.title('Plotting 0.5 + 0.3j and -0.2 - 0.1j')
    plt.show()

.. image:: https://raw.githubusercontent.com/scottprahl/pysmithchart/main/docs/readme_fig1.svg
   :alt: Colored Smith Chart

**Example 2: Plotting Impedance Data**

Here we plot a set of normalized impedance values on the Smith chart:

.. code-block:: python

    import matplotlib.pyplot as plt
    import pysmithchart

    # Sample impedance data (normalized)
    ZL = [30 + 30j, 50 + 50j, 100 + 100j]

    # Create a subplot that will use the Smith projection and include the minor grid
    plt.figure(figsize=(6,6))
    plt.subplot(1, 1, 1, projection="smith", axes_impedance=200, grid_minor_enable=True)
    
    plt.plot(ZL, "b-o", markersize=10)   # default datatype is Z_PARAMETER
    plt.title('Plotting Impedances Assuming Z₀=200Ω')
    plt.show()

.. image:: https://raw.githubusercontent.com/scottprahl/pysmithchart/main/docs/readme_fig2.svg
   :alt: Colored Smith Chart

**Example 3: Advanced Plot Customization**

Customize grid styles, marker behavior, and apply interpolation:

.. code-block:: python

    import matplotlib.pyplot as plt
    import pysmithchart

    ZL = [40 + 20j, 60 + 80j, 90 + 30j]

    plt.figure(figsize=(6,6))
    plt.subplot(1, 1, 1, projection="smith")

    plt.plot(ZL, markersize=16, ls='--', markerhack=True, rotate_marker=True)
    plt.title('Custom markers')
    plt.savefig("readme_fig3.svg", format='svg')
    plt.show()

.. image:: https://raw.githubusercontent.com/scottprahl/pysmithchart/main/docs/readme_fig3.svg
   :alt: Custom Markers

Documentation
-------------

For more details on the API, configuration options, and advanced usage, please refer
to the full documentation at `pysmithchart.readthedocs.io <https://pysmithchart.readthedocs.io>`_.

License
-------

pysmithchart is distributed under the 
`BSD LICENSE <https://raw.githubusercontent.com/scottprahl/pysmithchart/main/LICENSE.txt>`.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pysmithchart",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Smith Chart, impedance, reflection, RF engineering, microwave",
    "author": null,
    "author_email": "Paul Staerke <paul.staerke@gmail.com>, Scott Prahl <scott.prahl@oit.edu>",
    "download_url": "https://files.pythonhosted.org/packages/d4/bc/73cb6db0ece92fc831824daa5b1093f1d1600a6fab23f77b39a390926562/pysmithchart-0.3.0.tar.gz",
    "platform": null,
    "description": ".. |pypi| image:: https://img.shields.io/pypi/v/pysmithchart?color=68CA66\n   :target: https://pypi.org/project/pysmithchart/\n   :alt: PyPI\n\n.. |github| image:: https://img.shields.io/github/v/tag/scottprahl/pysmithchart?label=github&color=68CA66\n   :target: https://github.com/scottprahl/pysmithchart\n   :alt: GitHub\n\n.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/pysmithchart?label=conda&color=68CA66\n   :target: https://github.com/conda-forge/pysmithchart-feedstock\n   :alt: Conda\n\n.. |license| image:: https://img.shields.io/github/license/scottprahl/pysmithchart?color=68CA66\n   :target: https://github.com/scottprahl/pysmithchart/blob/main/LICENSE.txt\n   :alt: License\n\n.. |test| image:: https://github.com/scottprahl/pysmithchart/actions/workflows/test.yaml/badge.svg\n   :target: https://github.com/scottprahl/pysmithchart/actions/workflows/test.yaml\n   :alt: Testing\n\n.. |docs| image:: https://readthedocs.org/projects/pysmithchart/badge?color=68CA66\n   :target: https://pysmithchart.readthedocs.io\n   :alt: Docs\n\n.. |downloads| image:: https://img.shields.io/pypi/dm/pysmithchart?color=68CA66\n   :target: https://pypi.org/project/pysmithchart/\n   :alt: Downloads\n\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n   :alt: code style: black\n\n\npysmithchart\n============\n\n|pypi| |github| |conda| |downloads|\n\n|license| |test| |docs| |black|\n\nOverview\n--------\n\n**pysmithchart** is a matplotlib extension that adds a custom projection for creating\nSmith Charts in Python. Originally forked from `pysmithplot <https://github.com/vMeijin/pySmithPlot>`_,\nthis library has been updated to work with modern matplotlib versions while preserving\na rich set of features for RF and microwave engineering applications.\n\nThe package enables visualization and analysis of reflection coefficients,\nimpedances, and admittances. It seamlessly integrates into the matplotlib ecosystem,\nproviding full control over plot appearance, grid customizations, interpolation\nof complex data, and even advanced marker handling.\n\nKey Capabilities\n----------------\n\n- **Smith Projection:** Plot data on a Smith chart using the `SmithAxes` projection.\n- **Multiple Data Types:** Easily plot S-parameters, normalized impedances (Z) and admittances (Y).\n- **Grid Customization:** Draw major/minor gridlines as arcs with \"fancy\" adaptive\n  spacing and styling options.\n- **Interpolation & Equidistant Points:** Optionally smooth or resample plotted data.\n- **Marker Customization:** Manipulate start and end markers (with optional rotation)\n  to emphasize data endpoints.\n- **Full Matplotlib Integration:** Use matplotlib\u2019s standard API along with extra keywords\n  for specialized Smith chart plotting.\n\nInstallation\n------------\n\nInstall pysmithchart with pip:\n\n.. code-block:: bash\n\n    pip install pysmithchart\n\nOr install via conda:\n\n.. code-block:: bash\n\n    conda install -c conda-forge pysmithchart\n\nQuick Start Examples\n--------------------\n\nBelow are a few examples to help you get started quickly.\n\n**Example 1: Plotting a Reflection Coefficient (S-parameter)**\n\nThis example creates a Smith chart and plots a simple reflection coefficient:\n\n.. code-block:: python\n\n    import numpy as np\n    import matplotlib.pyplot as plt\n    from pysmithchart import S_PARAMETER\n\n    # array of reflection coefficients\n    S = [0.5 + 0.3j, -0.2 - 0.1j]\n\n    # Create a subplot that will use the Smith projection.\n    plt.figure(figsize=(6,6))\n    plt.subplot(1, 1, 1, projection=\"smith\", grid_major_color_x='red', grid_major_color_y='blue')\n\n    # Plot the reflection (scattering) coefficients\n    plt.plot(S, ls='', markersize=10, datatype=S_PARAMETER)\n\n    plt.title('Plotting 0.5 + 0.3j and -0.2 - 0.1j')\n    plt.show()\n\n.. image:: https://raw.githubusercontent.com/scottprahl/pysmithchart/main/docs/readme_fig1.svg\n   :alt: Colored Smith Chart\n\n**Example 2: Plotting Impedance Data**\n\nHere we plot a set of normalized impedance values on the Smith chart:\n\n.. code-block:: python\n\n    import matplotlib.pyplot as plt\n    import pysmithchart\n\n    # Sample impedance data (normalized)\n    ZL = [30 + 30j, 50 + 50j, 100 + 100j]\n\n    # Create a subplot that will use the Smith projection and include the minor grid\n    plt.figure(figsize=(6,6))\n    plt.subplot(1, 1, 1, projection=\"smith\", axes_impedance=200, grid_minor_enable=True)\n    \n    plt.plot(ZL, \"b-o\", markersize=10)   # default datatype is Z_PARAMETER\n    plt.title('Plotting Impedances Assuming Z\u2080=200\u2126')\n    plt.show()\n\n.. image:: https://raw.githubusercontent.com/scottprahl/pysmithchart/main/docs/readme_fig2.svg\n   :alt: Colored Smith Chart\n\n**Example 3: Advanced Plot Customization**\n\nCustomize grid styles, marker behavior, and apply interpolation:\n\n.. code-block:: python\n\n    import matplotlib.pyplot as plt\n    import pysmithchart\n\n    ZL = [40 + 20j, 60 + 80j, 90 + 30j]\n\n    plt.figure(figsize=(6,6))\n    plt.subplot(1, 1, 1, projection=\"smith\")\n\n    plt.plot(ZL, markersize=16, ls='--', markerhack=True, rotate_marker=True)\n    plt.title('Custom markers')\n    plt.savefig(\"readme_fig3.svg\", format='svg')\n    plt.show()\n\n.. image:: https://raw.githubusercontent.com/scottprahl/pysmithchart/main/docs/readme_fig3.svg\n   :alt: Custom Markers\n\nDocumentation\n-------------\n\nFor more details on the API, configuration options, and advanced usage, please refer\nto the full documentation at `pysmithchart.readthedocs.io <https://pysmithchart.readthedocs.io>`_.\n\nLicense\n-------\n\npysmithchart is distributed under the \n`BSD LICENSE <https://raw.githubusercontent.com/scottprahl/pysmithchart/main/LICENSE.txt>`.\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "A Python library extending Matplotlib to generate Smith Charts.",
    "version": "0.3.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/scottprahl/pysmithchart/issues",
        "Homepage": "https://github.com/scottprahl/pysmithchart"
    },
    "split_keywords": [
        "smith chart",
        " impedance",
        " reflection",
        " rf engineering",
        " microwave"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0d4d6932850994451244799260b1ce90bfc73585a108246a6b3c5fb9e89def81",
                "md5": "3938f9fafef5ab016db61cd8abed1f87",
                "sha256": "214772523d110a868c8e1cf2400ffe5870bb5d23103bc507751d3e54b76e7b3b"
            },
            "downloads": -1,
            "filename": "pysmithchart-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3938f9fafef5ab016db61cd8abed1f87",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 31941,
            "upload_time": "2025-02-05T22:08:10",
            "upload_time_iso_8601": "2025-02-05T22:08:10.345268Z",
            "url": "https://files.pythonhosted.org/packages/0d/4d/6932850994451244799260b1ce90bfc73585a108246a6b3c5fb9e89def81/pysmithchart-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d4bc73cb6db0ece92fc831824daa5b1093f1d1600a6fab23f77b39a390926562",
                "md5": "caa2477527d05ab97c120eb438aac1b6",
                "sha256": "9b10439a9b0e9883fac29308bfb5d78e18fca978197f52d5bc19efb436ef1cc6"
            },
            "downloads": -1,
            "filename": "pysmithchart-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "caa2477527d05ab97c120eb438aac1b6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 32276,
            "upload_time": "2025-02-05T22:08:12",
            "upload_time_iso_8601": "2025-02-05T22:08:12.328772Z",
            "url": "https://files.pythonhosted.org/packages/d4/bc/73cb6db0ece92fc831824daa5b1093f1d1600a6fab23f77b39a390926562/pysmithchart-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-05 22:08:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "scottprahl",
    "github_project": "pysmithchart",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pysmithchart"
}
        
Elapsed time: 2.08188s