Skip to content

Commit 2600356

Browse files
committed
Merge branch 'master' of github.com:MShirazAhmad/PhysPlot
2 parents 0514b01 + cca8e30 commit 2600356

7 files changed

Lines changed: 208 additions & 26 deletions

File tree

README.md

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,60 @@
66

77
PhysPlot is a scientific plotting software with a graphical user interface, designed to produce publication-ready 2D plots. It supports vector and bitmap output, including PDF, Postscript, SVG and EPS. It allows data to be imported from text, CSV and Excel files and It can export data in text format. Datasets can also be entered within the program, and new datasets can be created via the manipulation of existing datasets using mathematical expressions.
88

9-
## License, Tutorials, and Contributions
9+
## Quick Start (from source)
1010

11-
PhysPlot source code is licensed under the PolyForm Noncommercial License 1.0.0. You may fork PhysPlot, study the code, make noncommercial improvements, and submit revisions back through pull requests.
11+
Clone the repository:
1212

13-
Commercial use is not allowed without prior written permission from the project originator.
13+
```bash
14+
git clone https://github.com/MShirazAhmad/PhysPlot.git
15+
cd PhysPlot
16+
```
1417

15-
Documentation, screenshots, tutorials, website text, walkthroughs, and educational media are licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) unless otherwise stated. Noncommercial tutorials and educational guides are welcome.
18+
Create and activate a virtual environment:
1619

17-
The PhysPlot name, logo, app icon, GUI branding, and official visual identity are reserved by the project originator. Unofficial forks or modified builds must not be presented as official PhysPlot releases.
20+
```bash
21+
python -m venv .venv
22+
```
1823

19-
Only pull requests merged by the maintainer are official PhysPlot revisions. For details, see [CONTRIBUTING.md](CONTRIBUTING.md) and [TRADEMARK.md](TRADEMARK.md).
24+
On macOS/Linux:
25+
26+
```bash
27+
source .venv/bin/activate
28+
```
2029

21-
# Pictorial procedure for data analysis
30+
On Windows (PowerShell):
2231

23-
![Image description](pictorial_procedure/PP2.png)
32+
```powershell
33+
.venv\Scripts\Activate.ps1
34+
```
2435

25-
![Image description](pictorial_procedure/PP3.png)
36+
Install dependencies:
2637

27-
![Image description](pictorial_procedure/PP4.png)
38+
```bash
39+
python -m pip install --upgrade pip
40+
python -m pip install -r requirements.txt
41+
```
2842

29-
![Image description](pictorial_procedure/PP5.png)
43+
Run PhysPlot:
3044

31-
![Image description](pictorial_procedure/PP6.png)
45+
```bash
46+
python PhysPlot.py
47+
```
3248

33-
![Image description](pictorial_procedure/PP7.png)
49+
Alternative module entry point:
3450

35-
![Image description](pictorial_procedure/PP8.png)
51+
```bash
52+
python -m physplot
53+
```
3654

37-
![Image description](pictorial_procedure/PP9.png)
55+
## License, Tutorials, and Contributions
3856

39-
![Image description](pictorial_procedure/PP10.png)
57+
PhysPlot source code is licensed under the PolyForm Noncommercial License 1.0.0. You may fork PhysPlot, study the code, make noncommercial improvements, and submit revisions back through pull requests.
58+
59+
Commercial use is not allowed without prior written permission from the project originator.
60+
61+
Documentation, screenshots, tutorials, website text, walkthroughs, and educational media are licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) unless otherwise stated. Noncommercial tutorials and educational guides are welcome.
62+
63+
The PhysPlot name, logo, app icon, GUI branding, and official visual identity are reserved by the project originator. Unofficial forks or modified builds must not be presented as official PhysPlot releases.
64+
65+
Only pull requests merged by the maintainer are official PhysPlot revisions. For details, see [CONTRIBUTING.md](CONTRIBUTING.md) and [TRADEMARK.md](TRADEMARK.md).

docs/extensions/curvefitting.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ If your plotted data looks like a line, choose a linear fit. If your plotted
2323
data follows exponential decay, choose an exponential model. A curve-fitting
2424
plugin is simply a small file that tells PhysPlot what equation to use.
2525

26+
Where Curve Fits Appear in the UI
27+
---------------------------------
28+
29+
Discovered curve-fitting plugins are listed in the curve-fit configuration
30+
window. PhysPlot discovers these files at startup.
31+
2632
Required File Location
2733
----------------------
2834

@@ -87,7 +93,19 @@ Callable Template
8793
Returns:
8894
numpy.ndarray: Model Y values for the input X array.
8995
"""
90-
return amplitude * np.exp(-((x - center) / width) ** 2)
96+
return amplitude * np.exp(-((x - center) / width) ** 2)
97+
98+
Step-by-Step: Build a New Curve-Fit Plugin
99+
------------------------------------------
100+
101+
1. Create a new file in ``curvefitting/`` (for example
102+
``curvefitting/12_gaussian.py``).
103+
2. Add ``DISPLAY_NAME``, ``DEFAULT_LABEL``, ``KIND``, and ``LABEL_MODES``.
104+
3. For ``KIND = "poly"``, add ``DEGREE``.
105+
4. For ``KIND = "callable"``, implement ``function(x, ...)`` and optionally
106+
add ``INITIAL_GUESS``.
107+
5. Restart PhysPlot so the new fit appears in the curve-fit list.
108+
6. Select the fit in the configuration window and apply it to plotted data.
91109

92110
Required Fields
93111
---------------

docs/extensions/fileloading.rst

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ File-loader plugins convert external data files into a two-dimensional table
88
that PhysPlot can display. A loader receives a file path and returns a
99
rectangular data array.
1010

11+
Where Loaders Appear in the UI
12+
------------------------------
13+
14+
Discovered loaders are shown in two places:
15+
16+
- **Settings > File Loader** (menu selection)
17+
- **Data Loader** dropdown above the **Import Data** button (quick selection)
18+
19+
The selected loader is used when importing files. PhysPlot discovers loader
20+
files at startup.
21+
1122
Layman Example
1223
--------------
1324

@@ -81,7 +92,31 @@ Minimal CSV-Like Template
8192
if len(parts) < 2:
8293
continue
8394
rows.append((float(parts[0]), float(parts[1])))
84-
return np.asarray(rows, dtype=float)
95+
return np.asarray(rows, dtype=float)
96+
97+
Step-by-Step: Build a New Loader
98+
--------------------------------
99+
100+
1. Create a new file in ``fileloader/`` (for example
101+
``fileloader/my_device_loader.py``).
102+
2. Define a human-readable ``title`` string.
103+
3. Implement ``load_data(file_path)`` to parse your format and return a 2D
104+
array-like result.
105+
4. Optionally define ``DEFAULT_COLUMN_ROLES`` to pre-assign column roles after
106+
import.
107+
5. Restart PhysPlot so the loader is discovered and added to the menu and
108+
dropdown.
109+
6. Select your loader from **Settings > File Loader** or the **Data Loader**
110+
dropdown, then import a file.
111+
112+
Loader Categories
113+
-----------------
114+
115+
- **General tabular loader**: parse delimited numeric files.
116+
- **Instrument-specific loader**: skip custom headers/metadata and keep
117+
meaningful columns.
118+
- **Role-aware loader**: also sets ``DEFAULT_COLUMN_ROLES`` for automatic
119+
X/Y mapping.
85120

86121
OES HRF Pattern
87122
---------------

docs/extensions/functions.rst

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ PhysPlot reads the input column as a one-dimensional numeric array, calls the
1616
plugin's ``transform(values)`` function, then writes the returned values into
1717
the output column.
1818

19+
Where Functions Appear in the UI
20+
--------------------------------
21+
22+
Discovered function plugins are available in:
23+
24+
- The top-bar **Functions** menu
25+
- The transform dropdown in the data-manipulation controls
26+
27+
PhysPlot discovers function files at startup.
28+
1929
Layman Example
2030
--------------
2131

@@ -82,7 +92,28 @@ Minimal Template
8292
maximum = np.nanmax(values)
8393
if maximum == minimum:
8494
return np.zeros_like(values)
85-
return (values - minimum) / (maximum - minimum)
95+
return (values - minimum) / (maximum - minimum)
96+
97+
Step-by-Step: Build a New Function
98+
----------------------------------
99+
100+
1. Create a new file in ``functions/`` (for example
101+
``functions/15_normalize.py``).
102+
2. Define ``DISPLAY_NAME`` for the GUI entry.
103+
3. Define ``DEFAULT_LABEL`` for generated labels.
104+
4. Implement ``transform(values)`` and return one value per input row.
105+
5. Restart PhysPlot so the function appears in the menu and dropdown.
106+
107+
Function Categories
108+
-------------------
109+
110+
Common categories used by PhysPlot plugins include:
111+
112+
- **Identity/basic**: pass-through operations.
113+
- **Power/reciprocal**: ``x^2``, ``x^3``, ``1/x``.
114+
- **Log/exp**: ``log10``, ``ln``, ``e^x``.
115+
- **Trigonometric**: ``sin``, ``cos``, ``tan``, inverse trig.
116+
- **Domain-specific**: custom transforms such as baseline correction.
86117

87118
Practical Rules
88119
---------------

docs/index.rst

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,44 @@ PhysPlot: Advanced Plotting Made Simple
44
.. image:: _static/PhysPlotWide.png
55
:alt: PhysPlot logo
66
:align: center
7-
:width: 420px
7+
:width: 620px
88

99
PhysPlot is a scientific plotting software with a graphical user interface, designed to produce publication-ready 2D plots. It supports vector and bitmap outputs and allows importing, transforming, plotting, fitting, and exporting datasets.
1010

11+
Branding
12+
--------
13+
14+
PhysPlot documentation uses the official wide brand asset ``_static/PhysPlotWide.png`` on the home page and follows the project trademark policy for name and logo usage.
15+
16+
Plugin System
17+
-------------
18+
19+
PhysPlot supports plugin-based extension points for importing, transforming, and fitting data without editing core GUI files.
20+
21+
File Loader plugins
22+
~~~~~~~~~~~~~~~~~~~
23+
24+
- Add ``.py`` files to ``fileloader/`` with ``title`` and ``load_data(file_path)``.
25+
- The default loader keeps CSV/XLSX/TXT/TSV support.
26+
- Loaders are auto-discovered and appear in both:
27+
28+
- **Settings > File Loader**
29+
- The **Data Loader** dropdown above **Import Data**
30+
31+
Transform Function plugins
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~
33+
34+
- Add ``.py`` files to ``functions/`` with ``DISPLAY_NAME``, ``DEFAULT_LABEL``, and ``transform(values)``.
35+
- Built-in transform categories include identity, powers, reciprocal, logarithmic, exponential, and trigonometric operations.
36+
- Functions are auto-discovered and shown in the top-bar **Functions** menu and transform dropdown.
37+
38+
Curve-Fitting plugins
39+
~~~~~~~~~~~~~~~~~~~~~
40+
41+
- Add ``.py`` files to ``curvefitting/`` for polynomial or callable models.
42+
- Files are discovered at startup and shown in the curve-fit configuration list.
43+
- Use this for custom equations and domain-specific fitting workflows.
44+
1145
Project links
1246
-------------
1347

docs/installation.rst

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,40 @@ Prerequisites
77
- Python 3.7 or newer
88
- pip
99

10-
Usage modes
11-
-----------
10+
Clone the repository
11+
--------------------
1212

13-
PhysPlot is available in two common modes:
13+
.. code-block:: bash
14+
15+
git clone https://github.com/MShirazAhmad/PhysPlot.git
16+
cd PhysPlot
17+
18+
Create and activate a virtual environment
19+
-----------------------------------------
20+
21+
.. code-block:: bash
22+
23+
python -m venv .venv
24+
25+
On macOS/Linux:
26+
27+
.. code-block:: bash
28+
29+
source .venv/bin/activate
30+
31+
On Windows (PowerShell):
32+
33+
.. code-block:: powershell
1434
15-
1. Packaged desktop builds when provided by the official PhysPlot project.
16-
2. Python script execution using ``PhysPlot.py``.
35+
.venv\Scripts\Activate.ps1
1736
1837
Install Python dependencies
1938
---------------------------
2039

2140
.. code-block:: bash
2241
23-
pip install PyQt5 matplotlib numpy scipy pandas
42+
python -m pip install --upgrade pip
43+
python -m pip install -r requirements.txt
2444
2545
Run PhysPlot
2646
------------
@@ -31,5 +51,11 @@ From the project directory:
3151
3252
python PhysPlot.py
3353
54+
Alternative module entry point:
55+
56+
.. code-block:: bash
57+
58+
python -m physplot
59+
3460
Keep the ``physplot/inc`` image assets with the source tree so the GUI can load
3561
the official app icon and logo.

docs/user_guide/data_import.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,20 @@ Supported formats
66

77
- ``.txt``
88
- ``.csv``
9+
- ``.tsv``
910
- ``.xlsx``
1011

12+
Loader selection
13+
----------------
14+
15+
PhysPlot uses plugin-based file loaders. You can choose the active loader from:
16+
17+
- **Settings > File Loader**
18+
- The **Data Loader** dropdown above **Import Data**
19+
20+
Loader plugins are auto-discovered at startup from the ``fileloader/`` folder.
21+
The built-in default loader keeps standard CSV/XLSX/TXT/TSV import support.
22+
1123
Import steps
1224
------------
1325

0 commit comments

Comments
 (0)