Skip to main content

Make slider from sympy expression and params

Project description

sympy-slider

Requirements

  • matplotlib
  • numpy
  • sympy

Installation

pip install sympy-slider

Usage

import numpy as np
from sympy import sin, cos
from sympy.abc import a, b, x

from sympy_slider import slider

expr = a*cos(x) + b*sin(x)

params = slider(
    expr,
    x,
    params=dict(
        a=(0, -1, 1),
        b=(0, -1, 1),
    ),
    xdata=np.linspace(0, 2*np.pi, 1000),
    lambdify_kws=dict(
        modules='numpy',
    ),
    plot_kws=dict(
        color='blue',
        linestyle='--',
    ),
    use_latex=True,
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sympy-slider-0.0.3.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

sympy_slider-0.0.3-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page