plotora 1.0.0rc1__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.0rc1/MANIFEST.in +3 -0
- plotora-1.0.0rc1/PKG-INFO +555 -0
- plotora-1.0.0rc1/README.md +510 -0
- plotora-1.0.0rc1/TEST_REPORT.md +9 -0
- plotora-1.0.0rc1/examples/capacitor_4700.txt +1002 -0
- plotora-1.0.0rc1/examples/capacitor_6800.txt +1002 -0
- plotora-1.0.0rc1/examples/quickstart.py +3 -0
- plotora-1.0.0rc1/pyproject.toml +25 -0
- plotora-1.0.0rc1/setup.cfg +4 -0
- plotora-1.0.0rc1/src/plotora/__init__.py +14 -0
- plotora-1.0.0rc1/src/plotora/__main__.py +2 -0
- plotora-1.0.0rc1/src/plotora/animation.py +13 -0
- plotora-1.0.0rc1/src/plotora/cli.py +19 -0
- plotora-1.0.0rc1/src/plotora/core.py +122 -0
- plotora-1.0.0rc1/src/plotora/datasets.py +42 -0
- plotora-1.0.0rc1/src/plotora/engineering.py +95 -0
- plotora-1.0.0rc1/src/plotora/export.py +26 -0
- plotora-1.0.0rc1/src/plotora/interactive.py +14 -0
- plotora-1.0.0rc1/src/plotora/ltspice.py +113 -0
- plotora-1.0.0rc1/src/plotora/mathematics.py +85 -0
- plotora-1.0.0rc1/src/plotora/plot3d.py +27 -0
- plotora-1.0.0rc1/src/plotora/plots.py +48 -0
- plotora-1.0.0rc1/src/plotora/signals.py +63 -0
- plotora-1.0.0rc1/src/plotora/statistics.py +67 -0
- plotora-1.0.0rc1/src/plotora/units.py +11 -0
- plotora-1.0.0rc1/src/plotora.egg-info/PKG-INFO +555 -0
- plotora-1.0.0rc1/src/plotora.egg-info/SOURCES.txt +30 -0
- plotora-1.0.0rc1/src/plotora.egg-info/dependency_links.txt +1 -0
- plotora-1.0.0rc1/src/plotora.egg-info/entry_points.txt +2 -0
- plotora-1.0.0rc1/src/plotora.egg-info/requires.txt +45 -0
- plotora-1.0.0rc1/src/plotora.egg-info/top_level.txt +1 -0
- plotora-1.0.0rc1/tests/test_plotora.py +116 -0
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plotora
|
|
3
|
+
Version: 1.0.0rc1
|
|
4
|
+
Summary: Scientific visualization, simplified.
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: numpy>=1.26
|
|
8
|
+
Requires-Dist: matplotlib>=3.8
|
|
9
|
+
Requires-Dist: scipy>=1.11
|
|
10
|
+
Requires-Dist: pandas>=2.1
|
|
11
|
+
Requires-Dist: sympy>=1.12
|
|
12
|
+
Requires-Dist: pillow>=10
|
|
13
|
+
Requires-Dist: openpyxl>=3.1
|
|
14
|
+
Requires-Dist: statsmodels>=0.14
|
|
15
|
+
Provides-Extra: engineering
|
|
16
|
+
Requires-Dist: spicelib; extra == "engineering"
|
|
17
|
+
Requires-Dist: control; extra == "engineering"
|
|
18
|
+
Requires-Dist: pint; extra == "engineering"
|
|
19
|
+
Requires-Dist: uncertainties; extra == "engineering"
|
|
20
|
+
Provides-Extra: interactive
|
|
21
|
+
Requires-Dist: plotly>=5; extra == "interactive"
|
|
22
|
+
Requires-Dist: ipympl; extra == "interactive"
|
|
23
|
+
Provides-Extra: qt
|
|
24
|
+
Requires-Dist: PySide6; extra == "qt"
|
|
25
|
+
Provides-Extra: video
|
|
26
|
+
Requires-Dist: imageio-ffmpeg; extra == "video"
|
|
27
|
+
Provides-Extra: matlab
|
|
28
|
+
Requires-Dist: h5py; extra == "matlab"
|
|
29
|
+
Provides-Extra: all
|
|
30
|
+
Requires-Dist: spicelib; extra == "all"
|
|
31
|
+
Requires-Dist: control; extra == "all"
|
|
32
|
+
Requires-Dist: pint; extra == "all"
|
|
33
|
+
Requires-Dist: uncertainties; extra == "all"
|
|
34
|
+
Requires-Dist: plotly>=5; extra == "all"
|
|
35
|
+
Requires-Dist: ipympl; extra == "all"
|
|
36
|
+
Requires-Dist: PySide6; extra == "all"
|
|
37
|
+
Requires-Dist: imageio-ffmpeg; extra == "all"
|
|
38
|
+
Requires-Dist: h5py; extra == "all"
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: pytest; extra == "dev"
|
|
41
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
42
|
+
Requires-Dist: build; extra == "dev"
|
|
43
|
+
Requires-Dist: twine; extra == "dev"
|
|
44
|
+
Requires-Dist: ruff; extra == "dev"
|
|
45
|
+
|
|
46
|
+
<div align="center">
|
|
47
|
+
|
|
48
|
+
# Plotora
|
|
49
|
+
|
|
50
|
+
### Scientific visualization, simplified.
|
|
51
|
+
|
|
52
|
+
**Powerful scientific plots. Minimal Python. Publication-ready results.**
|
|
53
|
+
|
|
54
|
+
[](https://pypi.org/project/plotora/)
|
|
55
|
+
[](https://www.python.org/)
|
|
56
|
+
[](https://matplotlib.org/)
|
|
57
|
+
[](https://rishanpan.com/docs/platora)
|
|
58
|
+
[](#project-status)
|
|
59
|
+
|
|
60
|
+
[**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)
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
**Made by students at**
|
|
65
|
+
|
|
66
|
+
<a href="https://www.tudelft.nl/en/">
|
|
67
|
+
<img src="https://rishanpan.com/docs/platora/assets/tu-delft-logo.png" alt="TU Delft logo" width="210">
|
|
68
|
+
</a>
|
|
69
|
+
|
|
70
|
+
<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>
|
|
71
|
+
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## What is Plotora?
|
|
77
|
+
|
|
78
|
+
**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.
|
|
79
|
+
|
|
80
|
+
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**.
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
import plotora as pt
|
|
84
|
+
|
|
85
|
+
pt.ltspice("simulation.txt").save("simulation.pdf").show()
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
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.
|
|
89
|
+
|
|
90
|
+
### Why use Plotora?
|
|
91
|
+
|
|
92
|
+
- **Less boilerplate:** short, readable functions for common scientific plotting tasks.
|
|
93
|
+
- **Report-ready by default:** sensible labels, themes, legends, grids, and export options.
|
|
94
|
+
- **Native Matplotlib windows:** call `.show()` to open Matplotlib's interactive figure window with zoom, pan, and save controls (with a supported GUI backend).
|
|
95
|
+
- **Engineering-focused:** LTspice exports, Bode diagrams, pole-zero plots, signals, and transient measurements.
|
|
96
|
+
- **Numerically grounded:** analysis builds on well-established scientific Python libraries.
|
|
97
|
+
- **Your figure, your rules:** access the underlying Matplotlib `Figure` and `Axes` directly.
|
|
98
|
+
- **Offline workflow:** no API key or cloud service is required for plotting and analysis after installation.
|
|
99
|
+
|
|
100
|
+
> **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.
|
|
101
|
+
|
|
102
|
+
## Installation
|
|
103
|
+
|
|
104
|
+
Plotora requires **Python 3.11 or newer**.
|
|
105
|
+
|
|
106
|
+
To install the current release candidate from PyPI **after it has been published**:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
python -m pip install plotora==1.0.0rc1
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Or allow the latest available pre-release:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
python -m pip install --pre plotora
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
If you have downloaded the source project instead, open its root folder (the folder containing `pyproject.toml`) and run:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
python -m pip install .
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Optional installation groups
|
|
125
|
+
|
|
126
|
+
Some specialized features require additional dependencies. Install only the extras you need:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# LTspice RAW reader, extended control-system tools, units and uncertainties
|
|
130
|
+
python -m pip install "plotora[engineering]" --pre
|
|
131
|
+
|
|
132
|
+
# Plotly HTML exports and interactive Jupyter integration
|
|
133
|
+
python -m pip install "plotora[interactive]" --pre
|
|
134
|
+
|
|
135
|
+
# Qt-based Matplotlib windows
|
|
136
|
+
python -m pip install "plotora[qt]" --pre
|
|
137
|
+
|
|
138
|
+
# MP4 animation support using a bundled FFmpeg executable
|
|
139
|
+
python -m pip install "plotora[video]" --pre
|
|
140
|
+
|
|
141
|
+
# All optional runtime dependencies
|
|
142
|
+
python -m pip install "plotora[all]" --pre
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
To install extras from a local source checkout, use `python -m pip install ".[engineering]"`, or replace `engineering` with your chosen extra.
|
|
146
|
+
|
|
147
|
+
### Verify your installation
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
import plotora as pt
|
|
151
|
+
|
|
152
|
+
print(pt.__version__)
|
|
153
|
+
print(pt.__file__)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Quick start
|
|
157
|
+
|
|
158
|
+
### 1. Draw a graph
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
import numpy as np
|
|
162
|
+
import plotora as pt
|
|
163
|
+
|
|
164
|
+
x = np.linspace(0, 2 * np.pi, 500)
|
|
165
|
+
y = np.sin(x)
|
|
166
|
+
|
|
167
|
+
pt.plot(
|
|
168
|
+
x, y,
|
|
169
|
+
title="Sinusoidal signal",
|
|
170
|
+
xlabel="Time (s)",
|
|
171
|
+
ylabel="Amplitude",
|
|
172
|
+
theme="academic"
|
|
173
|
+
).show()
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 2. Save it in different formats
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
import numpy as np
|
|
180
|
+
import plotora as pt
|
|
181
|
+
|
|
182
|
+
x = np.linspace(0, 10, 500)
|
|
183
|
+
graph = pt.plot(x, np.exp(-x) * np.cos(5*x))
|
|
184
|
+
|
|
185
|
+
graph.save("figure.pdf")
|
|
186
|
+
graph.save("figure.svg")
|
|
187
|
+
graph.save("figure.png", dpi=600)
|
|
188
|
+
graph.save("figure.jpeg", dpi=300)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Export several formats in one call:
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
graph.save_all("figure", formats=["pdf", "svg", "png", "jpeg"], dpi=300)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**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.
|
|
198
|
+
|
|
199
|
+
### 3. Customize with native Matplotlib
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
graph = pt.plot([0, 1, 2, 3], [0, 1, 4, 9])
|
|
203
|
+
|
|
204
|
+
graph.ax.set_title("Quadratic growth")
|
|
205
|
+
graph.ax.set_xlim(0, 3)
|
|
206
|
+
graph.ax.axhline(4, linestyle="--", alpha=0.5)
|
|
207
|
+
|
|
208
|
+
graph.save("quadratic.pdf").show()
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Plotora intentionally does **not** lock you into a custom renderer. `graph.fig` and `graph.ax` are actual Matplotlib objects.
|
|
212
|
+
|
|
213
|
+
## Gallery
|
|
214
|
+
|
|
215
|
+
These figures were generated using Plotora's included demonstration data. The capacitor example is **synthetic**, not a measured or independently validated power-supply simulation.
|
|
216
|
+
|
|
217
|
+
<div align="center">
|
|
218
|
+
|
|
219
|
+
**LTspice-style transient comparison**
|
|
220
|
+
|
|
221
|
+

|
|
222
|
+
|
|
223
|
+
**Bode diagram**
|
|
224
|
+
|
|
225
|
+

|
|
226
|
+
|
|
227
|
+
**FFT spectrum**
|
|
228
|
+
|
|
229
|
+

|
|
230
|
+
|
|
231
|
+
**Linear regression**
|
|
232
|
+
|
|
233
|
+

|
|
234
|
+
|
|
235
|
+
**3D surface**
|
|
236
|
+
|
|
237
|
+

|
|
238
|
+
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
> **Image hosting:** The gallery and TU Delft logo use public URLs under `https://rishanpan.com/docs/platora/assets/`. Upload the supplied assets there before publishing. Otherwise the images will not appear on PyPI.
|
|
242
|
+
|
|
243
|
+
## Features
|
|
244
|
+
|
|
245
|
+
| Category | Available tools |
|
|
246
|
+
| --- | --- |
|
|
247
|
+
| **Everyday plots** | Line, scatter, bar, histogram, stem, area, box, pie, polar, heatmap, contour, quiver, error-bar plots, and multi-series comparisons |
|
|
248
|
+
| **LTspice** | Text and CSV exports, stepped text runs, transient and complex AC traces, simulation comparison, windowed waveform metrics; optional `.raw` reader |
|
|
249
|
+
| **Electrical engineering** | Bode and asymptotic Bode plots, poles and zeros, Nyquist, root locus, step and impulse responses, phasors, impedances, and power triangles |
|
|
250
|
+
| **Signal processing** | FFT, spectra, spectrograms, harmonics, peaks, phase differences, ripple, RMS, resampling, and timing diagrams |
|
|
251
|
+
| **Mathematics** | Function and parametric plots, Taylor and Fourier series, derivatives, integrals, ODEs, sequences, implicit curves, and vector visualization |
|
|
252
|
+
| **Data analysis** | Regression, curve fitting, residuals, distributions, correlations, smoothing, interpolation, uncertainty propagation, and descriptive statistics |
|
|
253
|
+
| **3D figures** | Surfaces, wireframes, 3D lines, scatter plots, contours, and vector fields |
|
|
254
|
+
| **Data files** | CSV, TXT, TSV, XLSX, JSON, MATLAB `.mat` (with limitations), and numerical Python arrays |
|
|
255
|
+
| **Publication** | Scientific themes, high-resolution raster files, vector figures, LaTeX figure snippets, selected HTML output, and animations |
|
|
256
|
+
|
|
257
|
+
For the complete API and supported arguments, see the [documentation](https://rishanpan.com/docs/platora).
|
|
258
|
+
|
|
259
|
+
## LTspice integration
|
|
260
|
+
|
|
261
|
+
LTspice calculates the circuit's behavior; **Plotora visualizes and analyzes the exported results**. Plotora is **not** an alternative SPICE simulator.
|
|
262
|
+
|
|
263
|
+
### Export from LTspice
|
|
264
|
+
|
|
265
|
+
1. Open your schematic and run the simulation in LTspice.
|
|
266
|
+
2. Activate the waveform viewer and select the voltage or current traces you need.
|
|
267
|
+
3. Choose **File → Export data as text** in the waveform viewer.
|
|
268
|
+
4. Save the export as `simulation.txt` in the same folder as your Python script.
|
|
269
|
+
|
|
270
|
+
### Plot a waveform
|
|
271
|
+
|
|
272
|
+
```python
|
|
273
|
+
import plotora as pt
|
|
274
|
+
|
|
275
|
+
pt.ltspice(
|
|
276
|
+
"simulation.txt",
|
|
277
|
+
traces=["V(out)"],
|
|
278
|
+
time_unit="ms",
|
|
279
|
+
title="Output voltage",
|
|
280
|
+
theme="academic"
|
|
281
|
+
).save("output_voltage.pdf").show()
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Trace names must match the names in your exported file. Inspect the available traces:
|
|
285
|
+
|
|
286
|
+
```python
|
|
287
|
+
sim = pt.read_ltspice("simulation.txt")
|
|
288
|
+
print(sim.traces)
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Compare simulations
|
|
292
|
+
|
|
293
|
+
Useful when comparing smoothing capacitors or different circuit parameters:
|
|
294
|
+
|
|
295
|
+
```python
|
|
296
|
+
pt.compare_ltspice(
|
|
297
|
+
"4700uF.txt",
|
|
298
|
+
"6800uF.txt",
|
|
299
|
+
trace="V(out)",
|
|
300
|
+
labels=["4700 µF", "6800 µF"],
|
|
301
|
+
time_unit="ms",
|
|
302
|
+
title="Power supply output comparison"
|
|
303
|
+
).save_all(
|
|
304
|
+
"capacitor_comparison",
|
|
305
|
+
formats=["pdf", "svg", "png"]
|
|
306
|
+
).show()
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Calculate ripple and RMS
|
|
310
|
+
|
|
311
|
+
```python
|
|
312
|
+
sim = pt.read_ltspice("simulation.txt")
|
|
313
|
+
|
|
314
|
+
# The window is expressed in the original simulation time units.
|
|
315
|
+
results = sim.metrics("V(out)", window=(0.06, 0.10))
|
|
316
|
+
|
|
317
|
+
print("Average:", results["average"])
|
|
318
|
+
print("RMS:", results["rms"])
|
|
319
|
+
print("Peak-to-peak ripple:", results["peak_to_peak"])
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
This calculation uses the selected part of the waveform. Choose the **steady-state** window before reporting ripple measurements.
|
|
323
|
+
|
|
324
|
+
### What about LTspice `.raw` files?
|
|
325
|
+
|
|
326
|
+
The optional `spicelib` integration supports loading `.raw` files:
|
|
327
|
+
|
|
328
|
+
```python
|
|
329
|
+
import plotora as pt
|
|
330
|
+
|
|
331
|
+
pt.ltspice("circuit.raw").show()
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
**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.
|
|
335
|
+
|
|
336
|
+
[**Read the LTspice guide →**](https://rishanpan.com/docs/platora/ltspice.html)
|
|
337
|
+
|
|
338
|
+
## Engineering and signal analysis
|
|
339
|
+
|
|
340
|
+
### Bode plots
|
|
341
|
+
|
|
342
|
+
```python
|
|
343
|
+
import plotora as pt
|
|
344
|
+
|
|
345
|
+
# H(s) = 1 / (0.01s + 1)
|
|
346
|
+
pt.bode(num=[1], den=[0.01, 1], unit="rad/s").show()
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Pole-zero diagrams
|
|
350
|
+
|
|
351
|
+
```python
|
|
352
|
+
pt.poles_zeros(
|
|
353
|
+
poles=[-10, -40],
|
|
354
|
+
zeros=[0]
|
|
355
|
+
).show()
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### FFT and numerical signals
|
|
359
|
+
|
|
360
|
+
```python
|
|
361
|
+
import numpy as np
|
|
362
|
+
import plotora as pt
|
|
363
|
+
|
|
364
|
+
t = np.linspace(0, 0.5, 2000, endpoint=False)
|
|
365
|
+
v = 2.0 * np.sin(2 * np.pi * 50 * t)
|
|
366
|
+
|
|
367
|
+
pt.spectrum(t, v).show()
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Additional tools include Nyquist diagrams, root locus, response curves, impedance graphs, phasors, harmonics, ripple analysis, and power triangles.
|
|
371
|
+
|
|
372
|
+
[**Engineering documentation →**](https://rishanpan.com/docs/platora/engineering.html)
|
|
373
|
+
|
|
374
|
+
## Mathematics and 3D visualization
|
|
375
|
+
|
|
376
|
+
Plot expressions directly:
|
|
377
|
+
|
|
378
|
+
```python
|
|
379
|
+
import plotora as pt
|
|
380
|
+
|
|
381
|
+
pt.function("sin(x) * exp(-x)", domain=(0, 10)).show()
|
|
382
|
+
pt.taylor("sin(x)", degree=5, center=0).show()
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Create a 3D surface:
|
|
386
|
+
|
|
387
|
+
```python
|
|
388
|
+
pt.surface("sin(sqrt(x**2 + y**2))", colorbar=True).show()
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Other mathematical tools support parametric plots, vector fields, derivatives, numerical integration, differential equations, and Fourier series.
|
|
392
|
+
|
|
393
|
+
[**Mathematics documentation →**](https://rishanpan.com/docs/platora/mathematics.html)
|
|
394
|
+
|
|
395
|
+
## Statistics and laboratory measurements
|
|
396
|
+
|
|
397
|
+
```python
|
|
398
|
+
import plotora as pt
|
|
399
|
+
|
|
400
|
+
x = [0, 1, 2, 3, 4]
|
|
401
|
+
y = [1.0, 3.1, 5.0, 7.2, 8.9]
|
|
402
|
+
|
|
403
|
+
fit = pt.regression(x, y, degree=1, interval="confidence")
|
|
404
|
+
|
|
405
|
+
print("Coefficients:", fit.metadata["coefficients"])
|
|
406
|
+
print("R-squared:", fit.metadata["r_squared"])
|
|
407
|
+
fit.save("regression.pdf").show()
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
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.
|
|
411
|
+
|
|
412
|
+
[**Data and statistics guide →**](https://rishanpan.com/docs/platora/data.html)
|
|
413
|
+
|
|
414
|
+
## Styling and themes
|
|
415
|
+
|
|
416
|
+
Choose a theme globally:
|
|
417
|
+
|
|
418
|
+
```python
|
|
419
|
+
pt.set_theme("academic")
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
Or for an individual figure:
|
|
423
|
+
|
|
424
|
+
```python
|
|
425
|
+
pt.function("cos(x)", theme="midnight").show()
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
The included presets are:
|
|
429
|
+
|
|
430
|
+
`academic` · `engineering` · `minimal` · `midnight` · `blueprint` · `monochrome` · `ieee` · `latex` · `presentation` · `pastel` · `colorblind`
|
|
431
|
+
|
|
432
|
+
Presets are convenience styles; `ieee` and `latex` do not guarantee compliance with a particular publisher template.
|
|
433
|
+
|
|
434
|
+
## Exports and LaTeX reports
|
|
435
|
+
|
|
436
|
+
| Type | Formats | Notes |
|
|
437
|
+
| --- | --- | --- |
|
|
438
|
+
| **Vector figures** | PDF, SVG, SVGZ, EPS, PS, PGF | PGF requires a compatible TeX installation |
|
|
439
|
+
| **Raster figures** | PNG, JPEG/JPG, TIFF, WebP, RAW/RGBA | Available formats can depend on the Matplotlib backend |
|
|
440
|
+
| **Interactive figures** | HTML | Plotly extra; supports selected simple 2D plots |
|
|
441
|
+
| **Animations** | GIF, MP4 | Animations must be created first; MP4 needs FFmpeg |
|
|
442
|
+
| **Numerical data** | CSV, TXT, XLSX, JSON | Requires graph-associated tabular data |
|
|
443
|
+
| **Reproducible outputs** | TEX, selected PY exports | Python exports have restricted scope |
|
|
444
|
+
|
|
445
|
+
Generate a LaTeX snippet:
|
|
446
|
+
|
|
447
|
+
```python
|
|
448
|
+
graph = pt.function("sin(x)")
|
|
449
|
+
graph.save("sine.pdf")
|
|
450
|
+
|
|
451
|
+
print(graph.latex(
|
|
452
|
+
filename="sine.pdf",
|
|
453
|
+
caption="Plot of the sine function.",
|
|
454
|
+
label="fig:sine"
|
|
455
|
+
))
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
In your LaTeX preamble, include:
|
|
459
|
+
|
|
460
|
+
```latex
|
|
461
|
+
\usepackage{graphicx}
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
PDF is usually the recommended format for sharp line-based figures in LaTeX reports.
|
|
465
|
+
|
|
466
|
+
[**Export and LaTeX documentation →**](https://rishanpan.com/docs/platora/export.html)
|
|
467
|
+
|
|
468
|
+
## Command-line interface
|
|
469
|
+
|
|
470
|
+
Plotora also provides a command-line tool:
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
plotora --version
|
|
474
|
+
plotora ltspice simulation.txt --trace "V(out)" --time-unit ms -o output.pdf
|
|
475
|
+
plotora plot measurements.csv --x time --y voltage --show
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
Use `plotora --help` for CLI usage and available options.
|
|
479
|
+
|
|
480
|
+
## Test and develop locally
|
|
481
|
+
|
|
482
|
+
When working from the source repository or project ZIP:
|
|
483
|
+
|
|
484
|
+
```bash
|
|
485
|
+
# Install development tools
|
|
486
|
+
python -m pip install ".[dev]"
|
|
487
|
+
|
|
488
|
+
# Run the sample figure generator
|
|
489
|
+
python test.py
|
|
490
|
+
|
|
491
|
+
# Generate files without opening GUI windows
|
|
492
|
+
python test.py --headless
|
|
493
|
+
|
|
494
|
+
# Run the automated tests
|
|
495
|
+
python -m pytest -q
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
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.
|
|
499
|
+
|
|
500
|
+
## Documentation
|
|
501
|
+
|
|
502
|
+
**Full documentation:** [https://rishanpan.com/docs/platora](https://rishanpan.com/docs/platora)
|
|
503
|
+
|
|
504
|
+
Topics include:
|
|
505
|
+
|
|
506
|
+
- [Getting started](https://rishanpan.com/docs/platora/getting-started.html)
|
|
507
|
+
- [Plotting and themes](https://rishanpan.com/docs/platora/plotting.html)
|
|
508
|
+
- [LTspice integration](https://rishanpan.com/docs/platora/ltspice.html)
|
|
509
|
+
- [Engineering and signals](https://rishanpan.com/docs/platora/engineering.html)
|
|
510
|
+
- [Mathematics and 3D](https://rishanpan.com/docs/platora/mathematics.html)
|
|
511
|
+
- [Data and statistics](https://rishanpan.com/docs/platora/data.html)
|
|
512
|
+
- [Export and LaTeX](https://rishanpan.com/docs/platora/export.html)
|
|
513
|
+
- [API reference](https://rishanpan.com/docs/platora/api.html)
|
|
514
|
+
- [Troubleshooting](https://rishanpan.com/docs/platora/troubleshooting.html)
|
|
515
|
+
- [Verification and limitations](https://rishanpan.com/docs/platora/verification.html)
|
|
516
|
+
|
|
517
|
+
## Project status
|
|
518
|
+
|
|
519
|
+
**Current package version:** `1.0.0rc1` (**release candidate**).
|
|
520
|
+
|
|
521
|
+
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.
|
|
522
|
+
|
|
523
|
+
Known limitations of this release candidate include:
|
|
524
|
+
|
|
525
|
+
- Native LTspice `.raw` handling needs real-world compatibility testing.
|
|
526
|
+
- Selected HTML and Python exports do not reproduce arbitrary Matplotlib figures.
|
|
527
|
+
- Interactive backend behavior has not been fully verified on Windows and macOS.
|
|
528
|
+
- Advanced controls, optional dependency combinations, and large-dataset performance need further testing.
|
|
529
|
+
- Plotora aims to reduce coding effort; it does **not** claim faster Matplotlib rendering performance.
|
|
530
|
+
|
|
531
|
+
See the [verification notes](https://rishanpan.com/docs/platora/verification.html) for more context.
|
|
532
|
+
|
|
533
|
+
## Contributing and feedback
|
|
534
|
+
|
|
535
|
+
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.
|
|
536
|
+
|
|
537
|
+
## License
|
|
538
|
+
|
|
539
|
+
**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.
|
|
540
|
+
|
|
541
|
+
## Acknowledgments
|
|
542
|
+
|
|
543
|
+
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/).
|
|
544
|
+
|
|
545
|
+
<div align="center">
|
|
546
|
+
|
|
547
|
+
---
|
|
548
|
+
|
|
549
|
+
**Made by students at TU Delft**
|
|
550
|
+
|
|
551
|
+
*Independent student project — not officially affiliated with or endorsed by TU Delft.*
|
|
552
|
+
|
|
553
|
+
[**Documentation**](https://rishanpan.com/docs/platora) · [**PyPI**](https://pypi.org/project/plotora/)
|
|
554
|
+
|
|
555
|
+
</div>
|