Metadata-Version: 2.4
Name: pylot-plotter
Version: 1.1.0
Summary: Pylot: A Simple Python Plotter
License-Expression: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PySide6>=6.5
Requires-Dist: pandas>=2.0
Requires-Dist: matplotlib>=3.7
Requires-Dist: scienceplots>=2.1
Requires-Dist: qtawesome>=1.3
Requires-Dist: pywin32; sys_platform == "win32"
Requires-Dist: winshell; sys_platform == "win32"
Dynamic: license-file

<div align="center">

<img src="pylotapp/resources/pylot.svg" width="96" alt="Pylot icon"/>

# Pylot: A Simple Python Plotter

**Turn a CSV file into a chart in seconds — no coding required.**

[![Version](https://img.shields.io/badge/version-1.1.0-2196F3.svg)](pyproject.toml)
[![Python 3.9+](https://img.shields.io/badge/python-3.9%2B-2196F3.svg)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/license-MIT-2196F3.svg)](LICENSE)
[![PySide6](https://img.shields.io/badge/UI-PySide6-41cd52.svg)](https://doc.qt.io/qtforpython/)

</div>

Pylot is a desktop app for plotting CSV data. Open a file, pick which columns go on which axis, and you get a chart — no writing Python, no Jupyter notebook. You can load several files at once, style each line or set of points on its own, add trend lines, check basic statistics, and save the final chart as an image. Works on Linux, Windows, and macOS.

---

## Install

```bash
pip install pylot-plotter
```

Then start it from anywhere by typing:

```bash
pylot
```

**Linux** — Pylot adds itself to your applications menu automatically the first time you run it.

**Windows** — after installing, run this once to add a shortcut to your Start Menu (it also happens automatically the first time you launch Pylot):

```bash
pylot-register
```

---

## Quick start

1. **File → Open CSV…** (or just drag a CSV file onto the window) to load your data.
2. Go to the **Series** tab. Each row here is one line or set of points on the chart. Pick a column for X, a column for Y, choose Line, Scatter, or Histogram, and click **Plot**.
3. Use the **Appearance** and **Axes** tabs to change the grid, switch to a log scale, set axis limits, change fonts, or add text labels.
4. Go to the **Export** tab to save your chart as a PNG, PDF, or SVG file.

---

## What it can do

### Loading files
- Open **several CSV files at once**. Pylot figures out the delimiter on its own (comma, semicolon, tab, etc.) so you don't need to tell it.
- **Drag and drop** CSV files straight onto the window.
- See a **preview** of each file's data (up to 1,000 rows) before you plot anything.
- **Recent files** menu remembers your last 8 files so you can reopen them in one click.
- If you load two files with the same name, Pylot automatically renames the second one so nothing gets overwritten.
- **Computed columns** — create a brand-new column from a formula, like `speed / time` or `voltage ** 2`. It's added instantly, without saving a new file.
- **Dates on the X axis** are detected automatically and formatted nicely (rotated labels, sensible spacing).

### Series (the lines and points on your chart)
- Pick **X and Y columns from any loaded file** — you can even mix columns from two different files as long as they have the same number of rows.
- Choose **Line, Scatter, or Histogram** for each series. There's also an option to plot against a second Y axis on the right side of the chart.
- **Drag rows up or down** to change the order things are drawn and listed in the legend.
- **Add all columns** — one click adds a series for every numeric column in your file.
- **Duplicate** a series to quickly make a similar one.
- **Show or hide** any series without deleting it.
- Click the little color square next to a series to change its color instantly.
- **Filter rows** — only plot the rows that match a simple condition, like `y > 0`.

### Styling each series
- Color, line style (solid, dashed, dotted), line thickness, and transparency.
- Choose a marker shape for data points — circle, square, triangle, diamond, plus, cross, star, or none.
- Turn marker outlines on or off.
- Set the size of scatter points.
- **Error bars** — show a margin of error above and below each point, using values from another column.
- **Rolling average** — smooth out noisy data with a moving average line drawn on top of your series.
- **Curve fitting** — fit a straight line or curve (up to degree 9) through your data, with the equation shown in the legend if you want.
- **Color by column** — for scatter plots, color each point based on the value of a third column (useful for showing an extra dimension of data).
- **Histogram bins** — control how many bars a histogram is split into.

### Appearance tab
- Turn the grid on or off, switch either axis to a logarithmic scale, or lock the X and Y axes to the same scale.
- Set a custom width-to-height ratio for the plot area.
- **Reference lines** — draw a horizontal or vertical line at a specific value, styled however you like.
- **Fill bands** — shade a region of the chart (like a tolerance range) with a color of your choice.

### Axes tab
- Set your own title and axis labels, or let Pylot pick sensible defaults. Type `#none` if you don't want a title or label at all.
- Manually set the minimum and maximum values for either axis, or leave them blank for automatic.
- Adjust the size and number of tick labels on each axis.
- Pick any font installed on your system for the chart text.
- Control the legend's position, whether it has a border, and whether it's shown at all.
- **Text annotations** — add your own text anywhere on the chart.

### Stats tab
- Select a file and instantly see basic statistics — count, average, standard deviation, minimum, maximum, and quartiles — for every numeric column.

### Metrics tab (hidden by default — turn it on from the tab bar)
- Compare two columns and get the RMSD, MAE, and MSE (common ways to measure how close two sets of numbers are).
- Optionally add these numbers straight onto the chart as a text label.

### Export
- Save your chart as a **PNG, PDF, or SVG** file.
- Control the resolution (DPI) for image exports.
- Export with a transparent background if you want to drop it into a slide or document.

### Everything else
- **Undo / Redo** — up to 20 steps of history for anything you change.
- **Show or hide tabs** you don't use, from the small gear icon in the corner of the tab bar.
- Pylot remembers your window size, panel layout, and export settings between sessions.
- **Reset view** button — instantly undo any zooming or panning you did on the chart.
- **Copy to clipboard** — copy the current chart as an image and paste it directly into another app.
- **Templates** — save your favorite chart settings (fonts, labels, scale, legend, etc.) to a file and reload them later, so you don't have to set everything up again for a new dataset.
- **Built-in help** — press **F1** or go to **Help → User guide** for an explanation of every feature, right inside the app.

---

## Keyboard shortcuts

| Action | Shortcut |
|---|---|
| Open CSV | Ctrl+O |
| Copy chart to clipboard | Ctrl+Shift+C |
| Undo | Ctrl+Z |
| Redo | Ctrl+Y |
| Open the user guide | F1 |
| Quit | Ctrl+Q |

---

## Requirements

- Python 3.9 or newer
- PySide6 ≥ 6.5
- pandas ≥ 2.0
- matplotlib ≥ 3.7
- scienceplots ≥ 2.1
- qtawesome ≥ 1.3

---

## Troubleshooting

### Windows: `ImportError: DLL load failed while importing QtGui`

This usually happens if you installed Pylot into Anaconda's **base**
environment. Anaconda's base environment often already comes with its own
copy of Qt (through packages like `pyqt`, or tools like Jupyter and Spyder),
and that clashes with the Qt version Pylot needs.

**Fix** — create a separate, clean environment for Pylot instead of using
the base one:

```bash
conda create -n pylot python=3.11
conda activate pylot
pip install pylot-plotter
pylot
```

If you'd rather keep using your current environment, remove the conflicting
Qt packages and reinstall PySide6:

```bash
conda remove pyqt qt qt-main --force
pip install --force-reinstall pyside6
```

---

## License

[MIT](LICENSE)
