Plotting functions for physical fields.
Project description
plofeld
"One of these days we must invent a faster-working field plotter!"
plofeld
is a python plotting library for physical fields.
Installing
Installation is easily done via pip
:
pip install plofeld
required are numpy, scipy, pandas, matplotlib
.
Usage
First one needs to place some Elements
, in this example
PointCharges
around your coordinate system.
The positions of these Elements
need to be given in Vectors
.
This list is then passed on to the StaticField
class, which creates the
field.
The field can then be plotted with the StaticField().plot()
function.
from matplotlib import pyplot as plt
from plofeld.elements import PointCharge
from plofeld.fields import StaticField
from plofeld.utils.classes import Vector
from plofeld.utils.constants import ELECTRIC
def plot_two_charges():
charges = [
PointCharge(Vector(x=1, y=0), q=-1),
PointCharge(Vector(x=-1, y=0), q=1),
]
field = StaticField(charges, field_type=ELECTRIC)
field.plot(xlim=(-2, 2), ylim=(-2, 2))
plt.show()
if __name__ == '__main__':
plot_two_charges()
This code and more can be found in the examples
folder.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file plofeld-0.0.1.tar.gz
.
File metadata
- Download URL: plofeld-0.0.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea5b1bf8474168da837cd5fb9d8e8b693b82a7687a585d47498422be879bb982 |
|
MD5 | ee8a8a0a1546916163a16b0a46686162 |
|
BLAKE2b-256 | 6037230b7e807ba8a844afaca2ac69b11b31c8211b4f5b64726c4ad4ed9bb0a5 |
File details
Details for the file plofeld-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: plofeld-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7c50048d138eee368301b760fa6012880c5da88419fd594119a2173f619fb59 |
|
MD5 | aac3a2bb2d779c98b11a19c6fa1c3a88 |
|
BLAKE2b-256 | c632d93703c50e724b310c69c03671dcce987428380feccf53029fde91bb8e7f |