plotora 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plotora-1.0.0/MANIFEST.in +6 -0
- plotora-1.0.0/PKG-INFO +561 -0
- plotora-1.0.0/PUBLISHING.md +41 -0
- plotora-1.0.0/README.md +510 -0
- plotora-1.0.0/TEST_REPORT.md +9 -0
- plotora-1.0.0/docs/api.md +784 -0
- plotora-1.0.0/docs/assets/bode.png +0 -0
- plotora-1.0.0/docs/assets/capacitors.png +0 -0
- plotora-1.0.0/docs/assets/fft.png +0 -0
- plotora-1.0.0/docs/assets/logo.svg +1 -0
- plotora-1.0.0/docs/assets/regression.png +0 -0
- plotora-1.0.0/docs/assets/surface.png +0 -0
- plotora-1.0.0/docs/assets/tu-delft-logo.png +0 -0
- plotora-1.0.0/docs/assets/tu-delft-logo.svg +1 -0
- plotora-1.0.0/docs/data.md +41 -0
- plotora-1.0.0/docs/engineering.md +40 -0
- plotora-1.0.0/docs/export.md +32 -0
- plotora-1.0.0/docs/gallery.md +33 -0
- plotora-1.0.0/docs/getting-started.md +60 -0
- plotora-1.0.0/docs/index.md +30 -0
- plotora-1.0.0/docs/ltspice.md +39 -0
- plotora-1.0.0/docs/mathematics.md +33 -0
- plotora-1.0.0/docs/plotting.md +37 -0
- plotora-1.0.0/docs/reference-notes.md +115 -0
- plotora-1.0.0/docs/site.js +16 -0
- plotora-1.0.0/docs/style.css +1 -0
- plotora-1.0.0/docs/troubleshooting.md +34 -0
- plotora-1.0.0/docs/verification.md +9 -0
- plotora-1.0.0/docs-requirements.txt +2 -0
- plotora-1.0.0/examples/capacitor_4700.txt +1002 -0
- plotora-1.0.0/examples/capacitor_6800.txt +1002 -0
- plotora-1.0.0/examples/quickstart.py +3 -0
- plotora-1.0.0/pyproject.toml +27 -0
- plotora-1.0.0/scripts/build_docs.py +55 -0
- plotora-1.0.0/scripts/link_docs.py +31 -0
- plotora-1.0.0/scripts/make_api.py +37 -0
- plotora-1.0.0/scripts/make_gallery.py +16 -0
- plotora-1.0.0/setup.cfg +4 -0
- plotora-1.0.0/src/plotora/__init__.py +14 -0
- plotora-1.0.0/src/plotora/__main__.py +2 -0
- plotora-1.0.0/src/plotora/animation.py +13 -0
- plotora-1.0.0/src/plotora/cli.py +19 -0
- plotora-1.0.0/src/plotora/core.py +122 -0
- plotora-1.0.0/src/plotora/datasets.py +42 -0
- plotora-1.0.0/src/plotora/engineering.py +95 -0
- plotora-1.0.0/src/plotora/export.py +26 -0
- plotora-1.0.0/src/plotora/interactive.py +14 -0
- plotora-1.0.0/src/plotora/ltspice.py +113 -0
- plotora-1.0.0/src/plotora/mathematics.py +85 -0
- plotora-1.0.0/src/plotora/plot3d.py +27 -0
- plotora-1.0.0/src/plotora/plots.py +48 -0
- plotora-1.0.0/src/plotora/signals.py +63 -0
- plotora-1.0.0/src/plotora/statistics.py +67 -0
- plotora-1.0.0/src/plotora/units.py +11 -0
- plotora-1.0.0/src/plotora.egg-info/PKG-INFO +561 -0
- plotora-1.0.0/src/plotora.egg-info/SOURCES.txt +60 -0
- plotora-1.0.0/src/plotora.egg-info/dependency_links.txt +1 -0
- plotora-1.0.0/src/plotora.egg-info/entry_points.txt +2 -0
- plotora-1.0.0/src/plotora.egg-info/requires.txt +45 -0
- plotora-1.0.0/src/plotora.egg-info/top_level.txt +1 -0
- plotora-1.0.0/test.py +37 -0
- plotora-1.0.0/tests/test_plotora.py +116 -0
plotora-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plotora
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Scientific plotting, LTspice visualization, numerical analysis and publication-ready Matplotlib figures.
|
|
5
|
+
Keywords: scientific plotting,matplotlib,ltspice,engineering,visualization,signal processing,latex,statistics
|
|
6
|
+
Classifier: Intended Audience :: Science/Research
|
|
7
|
+
Classifier: Intended Audience :: Education
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: numpy>=1.26
|
|
14
|
+
Requires-Dist: matplotlib>=3.8
|
|
15
|
+
Requires-Dist: scipy>=1.11
|
|
16
|
+
Requires-Dist: pandas>=2.1
|
|
17
|
+
Requires-Dist: sympy>=1.12
|
|
18
|
+
Requires-Dist: pillow>=10
|
|
19
|
+
Requires-Dist: openpyxl>=3.1
|
|
20
|
+
Requires-Dist: statsmodels>=0.14
|
|
21
|
+
Provides-Extra: engineering
|
|
22
|
+
Requires-Dist: spicelib; extra == "engineering"
|
|
23
|
+
Requires-Dist: control; extra == "engineering"
|
|
24
|
+
Requires-Dist: pint; extra == "engineering"
|
|
25
|
+
Requires-Dist: uncertainties; extra == "engineering"
|
|
26
|
+
Provides-Extra: interactive
|
|
27
|
+
Requires-Dist: plotly>=5; extra == "interactive"
|
|
28
|
+
Requires-Dist: ipympl; extra == "interactive"
|
|
29
|
+
Provides-Extra: qt
|
|
30
|
+
Requires-Dist: PySide6; extra == "qt"
|
|
31
|
+
Provides-Extra: video
|
|
32
|
+
Requires-Dist: imageio-ffmpeg; extra == "video"
|
|
33
|
+
Provides-Extra: matlab
|
|
34
|
+
Requires-Dist: h5py; extra == "matlab"
|
|
35
|
+
Provides-Extra: all
|
|
36
|
+
Requires-Dist: spicelib; extra == "all"
|
|
37
|
+
Requires-Dist: control; extra == "all"
|
|
38
|
+
Requires-Dist: pint; extra == "all"
|
|
39
|
+
Requires-Dist: uncertainties; extra == "all"
|
|
40
|
+
Requires-Dist: plotly>=5; extra == "all"
|
|
41
|
+
Requires-Dist: ipympl; extra == "all"
|
|
42
|
+
Requires-Dist: PySide6; extra == "all"
|
|
43
|
+
Requires-Dist: imageio-ffmpeg; extra == "all"
|
|
44
|
+
Requires-Dist: h5py; extra == "all"
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: pytest; extra == "dev"
|
|
47
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
48
|
+
Requires-Dist: build; extra == "dev"
|
|
49
|
+
Requires-Dist: twine; extra == "dev"
|
|
50
|
+
Requires-Dist: ruff; extra == "dev"
|
|
51
|
+
|
|
52
|
+
<div align="center">
|
|
53
|
+
|
|
54
|
+
# Plotora
|
|
55
|
+
|
|
56
|
+
### Scientific visualization, simplified.
|
|
57
|
+
|
|
58
|
+
**Powerful scientific plots. Minimal Python. Publication-ready results.**
|
|
59
|
+
|
|
60
|
+
[](https://pypi.org/project/plotora/)
|
|
61
|
+
[](https://www.python.org/)
|
|
62
|
+
[](https://matplotlib.org/)
|
|
63
|
+
[](https://rishanpan.com/docs/platora)
|
|
64
|
+
[](#project-status)
|
|
65
|
+
|
|
66
|
+
[**Documentation**](https://rishanpan.com/docs/platora) · [**Quick start**](#quick-start) · [**LTspice guide**](#ltspice-integration) · [**Examples**](#gallery) · [**API reference**](https://rishanpan.com/docs/platora/api.html)
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
**Made by students at**
|
|
71
|
+
|
|
72
|
+
<a href="https://www.tudelft.nl/en/">
|
|
73
|
+
<img src="https://rishanpan.com/docs/platora/assets/tu-delft-logo.png" alt="TU Delft logo" width="210">
|
|
74
|
+
</a>
|
|
75
|
+
|
|
76
|
+
<sub>Plotora is an independent student-built project. It is **not** an official product of, or endorsed by, Delft University of Technology (TU Delft).</sub>
|
|
77
|
+
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## What is Plotora?
|
|
83
|
+
|
|
84
|
+
**Plotora** is a Python toolkit for scientific plotting, numerical analysis, and engineering visualization. It builds on **Matplotlib, NumPy, SciPy, pandas, and SymPy** to make professional figures easy to create, customize, and export.
|
|
85
|
+
|
|
86
|
+
If you are preparing a lab report, examining an LTspice simulation, plotting a transfer function, analyzing experimental measurements, or writing a LaTeX document, Plotora aims to let you spend **less time configuring figures and more time understanding your data**.
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
import plotora as pt
|
|
90
|
+
|
|
91
|
+
pt.ltspice("simulation.txt").save("simulation.pdf").show()
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
That's a complete LTspice-text-to-PDF plotting workflow in two lines. Plotora uses Matplotlib under the hood, so you can still fine-tune every graph.
|
|
95
|
+
|
|
96
|
+
### Why use Plotora?
|
|
97
|
+
|
|
98
|
+
- **Less boilerplate:** short, readable functions for common scientific plotting tasks.
|
|
99
|
+
- **Report-ready by default:** sensible labels, themes, legends, grids, and export options.
|
|
100
|
+
- **Native Matplotlib windows:** call `.show()` to open Matplotlib's interactive figure window with zoom, pan, and save controls (with a supported GUI backend).
|
|
101
|
+
- **Engineering-focused:** LTspice exports, Bode diagrams, pole-zero plots, signals, and transient measurements.
|
|
102
|
+
- **Numerically grounded:** analysis builds on well-established scientific Python libraries.
|
|
103
|
+
- **Your figure, your rules:** access the underlying Matplotlib `Figure` and `Axes` directly.
|
|
104
|
+
- **Offline workflow:** no API key or cloud service is required for plotting and analysis after installation.
|
|
105
|
+
|
|
106
|
+
> **Accuracy note:** Plotora is designed for reliable numerical analysis, but results depend on input data quality, sampling, solver assumptions, and the chosen analysis method. Verify calculations that matter for your report or design.
|
|
107
|
+
|
|
108
|
+
## Installation
|
|
109
|
+
|
|
110
|
+
Plotora requires **Python 3.11 or newer**.
|
|
111
|
+
|
|
112
|
+
Install Plotora from PyPI:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
python -m pip install plotora==1.0.0
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Or install a specific version:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
python -m pip install plotora==1.0.0
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
If you have downloaded the source project instead, open its root folder (the folder containing `pyproject.toml`) and run:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
python -m pip install .
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Optional installation groups
|
|
131
|
+
|
|
132
|
+
Some specialized features require additional dependencies. Install only the extras you need:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# LTspice RAW reader, extended control-system tools, units and uncertainties
|
|
136
|
+
python -m pip install "plotora[engineering]"
|
|
137
|
+
|
|
138
|
+
# Plotly HTML exports and interactive Jupyter integration
|
|
139
|
+
python -m pip install "plotora[interactive]"
|
|
140
|
+
|
|
141
|
+
# Qt-based Matplotlib windows
|
|
142
|
+
python -m pip install "plotora[qt]"
|
|
143
|
+
|
|
144
|
+
# MP4 animation support using a bundled FFmpeg executable
|
|
145
|
+
python -m pip install "plotora[video]"
|
|
146
|
+
|
|
147
|
+
# All optional runtime dependencies
|
|
148
|
+
python -m pip install "plotora[all]"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
To install extras from a local source checkout, use `python -m pip install ".[engineering]"`, or replace `engineering` with your chosen extra.
|
|
152
|
+
|
|
153
|
+
### Verify your installation
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
import plotora as pt
|
|
157
|
+
|
|
158
|
+
print(pt.__version__)
|
|
159
|
+
print(pt.__file__)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Quick start
|
|
163
|
+
|
|
164
|
+
### 1. Draw a graph
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
import numpy as np
|
|
168
|
+
import plotora as pt
|
|
169
|
+
|
|
170
|
+
x = np.linspace(0, 2 * np.pi, 500)
|
|
171
|
+
y = np.sin(x)
|
|
172
|
+
|
|
173
|
+
pt.plot(
|
|
174
|
+
x, y,
|
|
175
|
+
title="Sinusoidal signal",
|
|
176
|
+
xlabel="Time (s)",
|
|
177
|
+
ylabel="Amplitude",
|
|
178
|
+
theme="academic"
|
|
179
|
+
).show()
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 2. Save it in different formats
|
|
183
|
+
|
|
184
|
+
```python
|
|
185
|
+
import numpy as np
|
|
186
|
+
import plotora as pt
|
|
187
|
+
|
|
188
|
+
x = np.linspace(0, 10, 500)
|
|
189
|
+
graph = pt.plot(x, np.exp(-x) * np.cos(5*x))
|
|
190
|
+
|
|
191
|
+
graph.save("figure.pdf")
|
|
192
|
+
graph.save("figure.svg")
|
|
193
|
+
graph.save("figure.png", dpi=600)
|
|
194
|
+
graph.save("figure.jpeg", dpi=300)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Export several formats in one call:
|
|
198
|
+
|
|
199
|
+
```python
|
|
200
|
+
graph.save_all("figure", formats=["pdf", "svg", "png", "jpeg"], dpi=300)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Tip:** prefer **PDF or SVG** for line graphs in LaTeX reports: they retain vector sharpness at any scale. Use PNG or JPEG when raster images are required.
|
|
204
|
+
|
|
205
|
+
### 3. Customize with native Matplotlib
|
|
206
|
+
|
|
207
|
+
```python
|
|
208
|
+
graph = pt.plot([0, 1, 2, 3], [0, 1, 4, 9])
|
|
209
|
+
|
|
210
|
+
graph.ax.set_title("Quadratic growth")
|
|
211
|
+
graph.ax.set_xlim(0, 3)
|
|
212
|
+
graph.ax.axhline(4, linestyle="--", alpha=0.5)
|
|
213
|
+
|
|
214
|
+
graph.save("quadratic.pdf").show()
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Plotora intentionally does **not** lock you into a custom renderer. `graph.fig` and `graph.ax` are actual Matplotlib objects.
|
|
218
|
+
|
|
219
|
+
## Gallery
|
|
220
|
+
|
|
221
|
+
These figures were generated using Plotora's included demonstration data. The capacitor example is **synthetic**, not a measured or independently validated power-supply simulation.
|
|
222
|
+
|
|
223
|
+
<div align="center">
|
|
224
|
+
|
|
225
|
+
**LTspice-style transient comparison**
|
|
226
|
+
|
|
227
|
+

|
|
228
|
+
|
|
229
|
+
**Bode diagram**
|
|
230
|
+
|
|
231
|
+

|
|
232
|
+
|
|
233
|
+
**FFT spectrum**
|
|
234
|
+
|
|
235
|
+

|
|
236
|
+
|
|
237
|
+
**Linear regression**
|
|
238
|
+
|
|
239
|
+

|
|
240
|
+
|
|
241
|
+
**3D surface**
|
|
242
|
+
|
|
243
|
+

|
|
244
|
+
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
> **Image hosting:** These images use public URLs under `https://rishanpan.com/docs/platora/assets/`. They will display on PyPI once the matching files are deployed on your Netlify site.
|
|
248
|
+
|
|
249
|
+
## Features
|
|
250
|
+
|
|
251
|
+
| Category | Available tools |
|
|
252
|
+
| --- | --- |
|
|
253
|
+
| **Everyday plots** | Line, scatter, bar, histogram, stem, area, box, pie, polar, heatmap, contour, quiver, error-bar plots, and multi-series comparisons |
|
|
254
|
+
| **LTspice** | Text and CSV exports, stepped text runs, transient and complex AC traces, simulation comparison, windowed waveform metrics; optional `.raw` reader |
|
|
255
|
+
| **Electrical engineering** | Bode and asymptotic Bode plots, poles and zeros, Nyquist, root locus, step and impulse responses, phasors, impedances, and power triangles |
|
|
256
|
+
| **Signal processing** | FFT, spectra, spectrograms, harmonics, peaks, phase differences, ripple, RMS, resampling, and timing diagrams |
|
|
257
|
+
| **Mathematics** | Function and parametric plots, Taylor and Fourier series, derivatives, integrals, ODEs, sequences, implicit curves, and vector visualization |
|
|
258
|
+
| **Data analysis** | Regression, curve fitting, residuals, distributions, correlations, smoothing, interpolation, uncertainty propagation, and descriptive statistics |
|
|
259
|
+
| **3D figures** | Surfaces, wireframes, 3D lines, scatter plots, contours, and vector fields |
|
|
260
|
+
| **Data files** | CSV, TXT, TSV, XLSX, JSON, MATLAB `.mat` (with limitations), and numerical Python arrays |
|
|
261
|
+
| **Publication** | Scientific themes, high-resolution raster files, vector figures, LaTeX figure snippets, selected HTML output, and animations |
|
|
262
|
+
|
|
263
|
+
For the complete API and supported arguments, see the [documentation](https://rishanpan.com/docs/platora).
|
|
264
|
+
|
|
265
|
+
## LTspice integration
|
|
266
|
+
|
|
267
|
+
LTspice calculates the circuit's behavior; **Plotora visualizes and analyzes the exported results**. Plotora is **not** an alternative SPICE simulator.
|
|
268
|
+
|
|
269
|
+
### Export from LTspice
|
|
270
|
+
|
|
271
|
+
1. Open your schematic and run the simulation in LTspice.
|
|
272
|
+
2. Activate the waveform viewer and select the voltage or current traces you need.
|
|
273
|
+
3. Choose **File → Export data as text** in the waveform viewer.
|
|
274
|
+
4. Save the export as `simulation.txt` in the same folder as your Python script.
|
|
275
|
+
|
|
276
|
+
### Plot a waveform
|
|
277
|
+
|
|
278
|
+
```python
|
|
279
|
+
import plotora as pt
|
|
280
|
+
|
|
281
|
+
pt.ltspice(
|
|
282
|
+
"simulation.txt",
|
|
283
|
+
traces=["V(out)"],
|
|
284
|
+
time_unit="ms",
|
|
285
|
+
title="Output voltage",
|
|
286
|
+
theme="academic"
|
|
287
|
+
).save("output_voltage.pdf").show()
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Trace names must match the names in your exported file. Inspect the available traces:
|
|
291
|
+
|
|
292
|
+
```python
|
|
293
|
+
sim = pt.read_ltspice("simulation.txt")
|
|
294
|
+
print(sim.traces)
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Compare simulations
|
|
298
|
+
|
|
299
|
+
Useful when comparing smoothing capacitors or different circuit parameters:
|
|
300
|
+
|
|
301
|
+
```python
|
|
302
|
+
pt.compare_ltspice(
|
|
303
|
+
"4700uF.txt",
|
|
304
|
+
"6800uF.txt",
|
|
305
|
+
trace="V(out)",
|
|
306
|
+
labels=["4700 µF", "6800 µF"],
|
|
307
|
+
time_unit="ms",
|
|
308
|
+
title="Power supply output comparison"
|
|
309
|
+
).save_all(
|
|
310
|
+
"capacitor_comparison",
|
|
311
|
+
formats=["pdf", "svg", "png"]
|
|
312
|
+
).show()
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Calculate ripple and RMS
|
|
316
|
+
|
|
317
|
+
```python
|
|
318
|
+
sim = pt.read_ltspice("simulation.txt")
|
|
319
|
+
|
|
320
|
+
# The window is expressed in the original simulation time units.
|
|
321
|
+
results = sim.metrics("V(out)", window=(0.06, 0.10))
|
|
322
|
+
|
|
323
|
+
print("Average:", results["average"])
|
|
324
|
+
print("RMS:", results["rms"])
|
|
325
|
+
print("Peak-to-peak ripple:", results["peak_to_peak"])
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
This calculation uses the selected part of the waveform. Choose the **steady-state** window before reporting ripple measurements.
|
|
329
|
+
|
|
330
|
+
### What about LTspice `.raw` files?
|
|
331
|
+
|
|
332
|
+
The optional `spicelib` integration supports loading `.raw` files:
|
|
333
|
+
|
|
334
|
+
```python
|
|
335
|
+
import plotora as pt
|
|
336
|
+
|
|
337
|
+
pt.ltspice("circuit.raw").show()
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**Release-candidate limitation:** native RAW import has not yet been validated against a representative set of real LTspice files. For critical work, export text data and verify the resulting plots and measurements.
|
|
341
|
+
|
|
342
|
+
[**Read the LTspice guide →**](https://rishanpan.com/docs/platora/ltspice.html)
|
|
343
|
+
|
|
344
|
+
## Engineering and signal analysis
|
|
345
|
+
|
|
346
|
+
### Bode plots
|
|
347
|
+
|
|
348
|
+
```python
|
|
349
|
+
import plotora as pt
|
|
350
|
+
|
|
351
|
+
# H(s) = 1 / (0.01s + 1)
|
|
352
|
+
pt.bode(num=[1], den=[0.01, 1], unit="rad/s").show()
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Pole-zero diagrams
|
|
356
|
+
|
|
357
|
+
```python
|
|
358
|
+
pt.poles_zeros(
|
|
359
|
+
poles=[-10, -40],
|
|
360
|
+
zeros=[0]
|
|
361
|
+
).show()
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### FFT and numerical signals
|
|
365
|
+
|
|
366
|
+
```python
|
|
367
|
+
import numpy as np
|
|
368
|
+
import plotora as pt
|
|
369
|
+
|
|
370
|
+
t = np.linspace(0, 0.5, 2000, endpoint=False)
|
|
371
|
+
v = 2.0 * np.sin(2 * np.pi * 50 * t)
|
|
372
|
+
|
|
373
|
+
pt.spectrum(t, v).show()
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Additional tools include Nyquist diagrams, root locus, response curves, impedance graphs, phasors, harmonics, ripple analysis, and power triangles.
|
|
377
|
+
|
|
378
|
+
[**Engineering documentation →**](https://rishanpan.com/docs/platora/engineering.html)
|
|
379
|
+
|
|
380
|
+
## Mathematics and 3D visualization
|
|
381
|
+
|
|
382
|
+
Plot expressions directly:
|
|
383
|
+
|
|
384
|
+
```python
|
|
385
|
+
import plotora as pt
|
|
386
|
+
|
|
387
|
+
pt.function("sin(x) * exp(-x)", domain=(0, 10)).show()
|
|
388
|
+
pt.taylor("sin(x)", degree=5, center=0).show()
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Create a 3D surface:
|
|
392
|
+
|
|
393
|
+
```python
|
|
394
|
+
pt.surface("sin(sqrt(x**2 + y**2))", colorbar=True).show()
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Other mathematical tools support parametric plots, vector fields, derivatives, numerical integration, differential equations, and Fourier series.
|
|
398
|
+
|
|
399
|
+
[**Mathematics documentation →**](https://rishanpan.com/docs/platora/mathematics.html)
|
|
400
|
+
|
|
401
|
+
## Statistics and laboratory measurements
|
|
402
|
+
|
|
403
|
+
```python
|
|
404
|
+
import plotora as pt
|
|
405
|
+
|
|
406
|
+
x = [0, 1, 2, 3, 4]
|
|
407
|
+
y = [1.0, 3.1, 5.0, 7.2, 8.9]
|
|
408
|
+
|
|
409
|
+
fit = pt.regression(x, y, degree=1, interval="confidence")
|
|
410
|
+
|
|
411
|
+
print("Coefficients:", fit.metadata["coefficients"])
|
|
412
|
+
print("R-squared:", fit.metadata["r_squared"])
|
|
413
|
+
fit.save("regression.pdf").show()
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Plotora also provides error bars, residuals, distribution plots, smoothing, correlation visualization, and uncertainty calculations. Statistics require attention to the underlying assumptions; for example, a high R² alone does not establish a valid physical model.
|
|
417
|
+
|
|
418
|
+
[**Data and statistics guide →**](https://rishanpan.com/docs/platora/data.html)
|
|
419
|
+
|
|
420
|
+
## Styling and themes
|
|
421
|
+
|
|
422
|
+
Choose a theme globally:
|
|
423
|
+
|
|
424
|
+
```python
|
|
425
|
+
pt.set_theme("academic")
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
Or for an individual figure:
|
|
429
|
+
|
|
430
|
+
```python
|
|
431
|
+
pt.function("cos(x)", theme="midnight").show()
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
The included presets are:
|
|
435
|
+
|
|
436
|
+
`academic` · `engineering` · `minimal` · `midnight` · `blueprint` · `monochrome` · `ieee` · `latex` · `presentation` · `pastel` · `colorblind`
|
|
437
|
+
|
|
438
|
+
Presets are convenience styles; `ieee` and `latex` do not guarantee compliance with a particular publisher template.
|
|
439
|
+
|
|
440
|
+
## Exports and LaTeX reports
|
|
441
|
+
|
|
442
|
+
| Type | Formats | Notes |
|
|
443
|
+
| --- | --- | --- |
|
|
444
|
+
| **Vector figures** | PDF, SVG, SVGZ, EPS, PS, PGF | PGF requires a compatible TeX installation |
|
|
445
|
+
| **Raster figures** | PNG, JPEG/JPG, TIFF, WebP, RAW/RGBA | Available formats can depend on the Matplotlib backend |
|
|
446
|
+
| **Interactive figures** | HTML | Plotly extra; supports selected simple 2D plots |
|
|
447
|
+
| **Animations** | GIF, MP4 | Animations must be created first; MP4 needs FFmpeg |
|
|
448
|
+
| **Numerical data** | CSV, TXT, XLSX, JSON | Requires graph-associated tabular data |
|
|
449
|
+
| **Reproducible outputs** | TEX, selected PY exports | Python exports have restricted scope |
|
|
450
|
+
|
|
451
|
+
Generate a LaTeX snippet:
|
|
452
|
+
|
|
453
|
+
```python
|
|
454
|
+
graph = pt.function("sin(x)")
|
|
455
|
+
graph.save("sine.pdf")
|
|
456
|
+
|
|
457
|
+
print(graph.latex(
|
|
458
|
+
filename="sine.pdf",
|
|
459
|
+
caption="Plot of the sine function.",
|
|
460
|
+
label="fig:sine"
|
|
461
|
+
))
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
In your LaTeX preamble, include:
|
|
465
|
+
|
|
466
|
+
```latex
|
|
467
|
+
\usepackage{graphicx}
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
PDF is usually the recommended format for sharp line-based figures in LaTeX reports.
|
|
471
|
+
|
|
472
|
+
[**Export and LaTeX documentation →**](https://rishanpan.com/docs/platora/export.html)
|
|
473
|
+
|
|
474
|
+
## Command-line interface
|
|
475
|
+
|
|
476
|
+
Plotora also provides a command-line tool:
|
|
477
|
+
|
|
478
|
+
```bash
|
|
479
|
+
plotora --version
|
|
480
|
+
plotora ltspice simulation.txt --trace "V(out)" --time-unit ms -o output.pdf
|
|
481
|
+
plotora plot measurements.csv --x time --y voltage --show
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
Use `plotora --help` for CLI usage and available options.
|
|
485
|
+
|
|
486
|
+
## Test and develop locally
|
|
487
|
+
|
|
488
|
+
When working from the source repository or project ZIP:
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
# Install development tools
|
|
492
|
+
python -m pip install ".[dev]"
|
|
493
|
+
|
|
494
|
+
# Run the sample figure generator
|
|
495
|
+
python test.py
|
|
496
|
+
|
|
497
|
+
# Generate files without opening GUI windows
|
|
498
|
+
python test.py --headless
|
|
499
|
+
|
|
500
|
+
# Run the automated tests
|
|
501
|
+
python -m pytest -q
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
The initial RC1 test report recorded **64 passing and 2 skipped automated tests** in a Linux/Python 3.13 headless environment. This does not establish complete validation across all operating systems, optional backends, or real RAW files.
|
|
505
|
+
|
|
506
|
+
## Documentation
|
|
507
|
+
|
|
508
|
+
**Full documentation:** [https://rishanpan.com/docs/platora](https://rishanpan.com/docs/platora)
|
|
509
|
+
|
|
510
|
+
Topics include:
|
|
511
|
+
|
|
512
|
+
- [Getting started](https://rishanpan.com/docs/platora/getting-started.html)
|
|
513
|
+
- [Plotting and themes](https://rishanpan.com/docs/platora/plotting.html)
|
|
514
|
+
- [LTspice integration](https://rishanpan.com/docs/platora/ltspice.html)
|
|
515
|
+
- [Engineering and signals](https://rishanpan.com/docs/platora/engineering.html)
|
|
516
|
+
- [Mathematics and 3D](https://rishanpan.com/docs/platora/mathematics.html)
|
|
517
|
+
- [Data and statistics](https://rishanpan.com/docs/platora/data.html)
|
|
518
|
+
- [Export and LaTeX](https://rishanpan.com/docs/platora/export.html)
|
|
519
|
+
- [API reference](https://rishanpan.com/docs/platora/api.html)
|
|
520
|
+
- [Troubleshooting](https://rishanpan.com/docs/platora/troubleshooting.html)
|
|
521
|
+
- [Verification and limitations](https://rishanpan.com/docs/platora/verification.html)
|
|
522
|
+
|
|
523
|
+
## Project status
|
|
524
|
+
|
|
525
|
+
**Current package version:** `1.0.0` (**initial v1 release**).
|
|
526
|
+
|
|
527
|
+
Plotora is being developed as a concise, Matplotlib-native scientific plotting toolkit. The custom Plotora Studio graphical editor is deferred; `.show()` uses native Matplotlib windows.
|
|
528
|
+
|
|
529
|
+
Known limitations and verification gaps of this release include:
|
|
530
|
+
|
|
531
|
+
- Native LTspice `.raw` handling needs real-world compatibility testing.
|
|
532
|
+
- Selected HTML and Python exports do not reproduce arbitrary Matplotlib figures.
|
|
533
|
+
- Interactive backend behavior has not been fully verified on Windows and macOS.
|
|
534
|
+
- Advanced controls, optional dependency combinations, and large-dataset performance need further testing.
|
|
535
|
+
- Plotora aims to reduce coding effort; it does **not** claim faster Matplotlib rendering performance.
|
|
536
|
+
|
|
537
|
+
See the [verification notes](https://rishanpan.com/docs/platora/verification.html) for more context.
|
|
538
|
+
|
|
539
|
+
## Contributing and feedback
|
|
540
|
+
|
|
541
|
+
Suggestions, bug reports, documentation improvements, and test cases are welcome. If reporting an issue, include your Python version, Plotora version, operating system, a minimal example, and any relevant error output. Please remove private or sensitive information from shared simulation files.
|
|
542
|
+
|
|
543
|
+
## License
|
|
544
|
+
|
|
545
|
+
**License selection is pending.** A license and the necessary project metadata must be chosen before public open-source redistribution. Until then, do not assume that the source code is granted an open-source license.
|
|
546
|
+
|
|
547
|
+
## Acknowledgments
|
|
548
|
+
|
|
549
|
+
Plotora builds on the work of the open-source scientific Python community, including [Matplotlib](https://matplotlib.org/), [NumPy](https://numpy.org/), [SciPy](https://scipy.org/), [pandas](https://pandas.pydata.org/), and [SymPy](https://www.sympy.org/).
|
|
550
|
+
|
|
551
|
+
<div align="center">
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
555
|
+
**Made by students at TU Delft**
|
|
556
|
+
|
|
557
|
+
*Independent student project — not officially affiliated with or endorsed by TU Delft.*
|
|
558
|
+
|
|
559
|
+
[**Documentation**](https://rishanpan.com/docs/platora) · [**PyPI**](https://pypi.org/project/plotora/)
|
|
560
|
+
|
|
561
|
+
</div>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Publishing Plotora — documentation edition
|
|
2
|
+
|
|
3
|
+
This ZIP keeps RC1's package code intact and replaces the README, adds descriptive metadata and includes a static docs website. The old distributions are replaced with freshly built distributions. If you have made local source changes, do not overwrite them: copy README.md, docs/, scripts/, docs-requirements.txt, and the documentation workflow into your working project, and merge the metadata additions manually.
|
|
4
|
+
|
|
5
|
+
## Preview the website
|
|
6
|
+
|
|
7
|
+
Open `site/index.html` in a browser, or run `python -m http.server 8000 --directory site` from the project root and open http://localhost:8000. The site works offline and has no external runtime resources. The navigation filter searches guide titles, not full page contents. Rebuild after editing Markdown:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
python -m pip install -r docs-requirements.txt
|
|
11
|
+
python scripts/build_docs.py
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Host the docs
|
|
15
|
+
|
|
16
|
+
Option A: upload the contents of `site/` (including index.html and assets/) to a static website host. No server-side Python is required.
|
|
17
|
+
|
|
18
|
+
Option B: create a GitHub repository for Plotora (once you have chosen its license), commit the source, docs and `.github/workflows/docs.yml` to the `main` branch, then under Settings → Pages choose GitHub Actions as the source. Run the Documentation workflow in the Actions tab. Its deployment output provides the actual URL. GitHub account/repository settings and the remote workflow have not been verified here. Do not upload secrets or local virtual environments.
|
|
19
|
+
|
|
20
|
+
## Connect PyPI to the website
|
|
21
|
+
|
|
22
|
+
Once you have a working public HTTPS URL, run this command with your actual URL instead of the example domain:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
python scripts/link_docs.py https://YOUR-DOCS-HOST/plotora --repository https://github.com/YOUR-USERNAME/plotora
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The repository option is optional. This adds hosted gallery images to README.md and updates `[project.urls]` in pyproject.toml. No placeholder URLs are embedded in the release by default. Open the images in a private browser window to verify public access. Dynamic PyPI badges will only show package data after publication.
|
|
29
|
+
|
|
30
|
+
## Before uploading
|
|
31
|
+
|
|
32
|
+
Add your chosen public author name (optional email) and choose a license, including its text and appropriate metadata. This ZIP deliberately does not select a license or guess an author identity. Verify you have permission to publish the project. If you have not yet uploaded any files for this version, keep version 1.0.0rc1; otherwise bump the version. In PowerShell from the project root:
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
python -m pip install --upgrade build twine
|
|
36
|
+
Remove-Item dist\* -Force
|
|
37
|
+
python -m build
|
|
38
|
+
python -m twine check dist/*
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Only after validation and review, upload with `python -m twine upload dist/*`. Keep PyPI tokens private. The README and sidebar are generated from the uploaded distribution metadata. For RC1 install from PyPI using `python -m pip install --pre plotora` after publication. No publication or hosting has been performed here.
|