diff --git a/LICENSE b/LICENSE index e816eaf..8b117df 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Seo-Yoon Moon +Copyright (c) 2026 Seo-Yoon Moon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d928a62..89caec1 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ # mplstudio - [![PyPI version](https://img.shields.io/pypi/v/mplstudio)](https://pypi.org/project/mplstudio/) [![Python](https://img.shields.io/pypi/pyversions/mplstudio)](https://pypi.org/project/mplstudio/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![CI](https://github.com/symoon9/mplstudio/actions/workflows/ci.yml/badge.svg)](https://github.com/symoon9/mplstudio/actions/workflows/ci.yml) -An interactive GUI for styling matplotlib figures — directly in Jupyter. +An **interactive GUI** for **styling matplotlib figures** directly in Jupyter. -Adjust colors, fonts, axes, legends, and more in real time without touching your plot code. +Adjust colors, fonts, axes, legends, and more in real time **without touching your plot code.** ---- +![mplstudio control panel](docs/screenshot_readme.png) ## Installation @@ -17,9 +16,8 @@ Adjust colors, fonts, axes, legends, and more in real time without touching your pip install mplstudio ``` -Requires Python 3.9+, Jupyter Notebook or JupyterLab, and matplotlib ≥ 3.5. +Requires `Python 3.9+`, Jupyter Notebook or JupyterLab, and `matplotlib ≥ 3.5`. ---- ## Quick Start @@ -35,9 +33,8 @@ ax.legend() mplstudio.studio(fig) ``` -This displays an interactive control panel below your figure with live preview. +For detailed usage examples, see [`examples/demo.ipynb`](examples/demo.ipynb). ---- ## API Reference @@ -66,57 +63,35 @@ Return a sorted list of all valid section names. ```python mplstudio.available_sections() # ['alpha', 'axes', 'colors', 'figure_size', 'grid_spines', -# 'legend', 'palette_suggestions', 'typography'] +# 'legend', 'palette_suggestions', 'save', 'typography'] ``` ---- -## Sections +## Available Sections | Section | Controls | |---------|----------| | `figure_size` | Width and height sliders | | `typography` | Font size for all elements or individually (title, labels, ticks, legend) | -| `colors` | Palette picker, manual per-series color pickers, smart CIELAB palette, colormap selector, background color | +| `colors` | Palette picker (with color count), manual per-series color pickers, smart CIELAB palette, colormap selector, background color | | `alpha` | Global opacity slider + per-series opacity | | `axes` | Title, x/y axis labels, x/y limits — supports multi-axis figures | -| `legend` | Location dropdown, legend entry names, bbox position | -| `grid_spines` | Grid on/off, spine style (box / left-bottom / none) | +| `legend` | Legend title, collapsible series label editor, location dropdown, bbox position | +| `grid_spines` | Grid toggle, spine style (Box / 2-Side / None) | | `palette_suggestions` | Colorblind-safe palette recommendations filtered by use case and background | +| `save` | Save figure with custom filename, path, DPI, and format (png, jpg, pdf, svg, eps) | ---- ## Palette Utilities -mplstudio ships a curated palette library and color science tools you can use independently of the GUI. - -```python -from mplstudio import get_palette, smart_palette, recommend, palette_names - -# List all available palettes -palette_names() - -# Get colors from a named palette -colors = get_palette("Okabe-Ito") # colorblind-safe, 8 colors -colors = get_palette("Tableau 10") # familiar defaults - -# Generate N maximally distinct colors using CIELAB ΔE greedy selection -colors = smart_palette(6) # always a superset of smart_palette(5) - -# Find palettes matching criteria -suggestions = recommend( - n_colors=5, - colorblind_safe=True, - use_case="categorical", # "categorical" | "sequential" | "diverging" - background="light", # "light" | "dark" - top_k=3, -) -for p in suggestions: - print(p["name"], p["colors"]) -``` +mplstudio ships a curated palette library and color science tools you can use independently of the GUI: `get_palette`, `smart_palette`, `recommend`, `palette_names`, and `delta_e`. See [`examples/demo.ipynb`](examples/demo.ipynb) for usage examples. ### Available Palettes +Palettes for categorical, and continuous variables (sequential and diverging color maps). + +Following table shows palettes for **categorical** values. For **continuous** variables, mplstudio uses matplotlib's built-in colormaps. See the [matplotlib colormap reference](https://matplotlib.org/stable/gallery/color/colormap_reference.html) for the full list. + | Palette | Colors | Tags | |---------|--------|------| | Okabe-Ito | 8 | colorblind-safe | @@ -137,7 +112,6 @@ for p in suggestions: | Pastel | 6 | light background | | High Contrast | 5 | light background | ---- ## Requirements @@ -147,8 +121,7 @@ for p in suggestions: - ipykernel ≥ 6.0 - Jupyter Notebook or JupyterLab ---- ## License -[MIT](LICENSE) © 2024 Seo-Yoon Moon +[MIT](LICENSE) © 2026 Seo-Yoon Moon diff --git a/docs/mplstudio_logo_square.png b/docs/mplstudio_logo_square.png new file mode 100644 index 0000000..b93e676 Binary files /dev/null and b/docs/mplstudio_logo_square.png differ diff --git a/docs/screenshot_readme.png b/docs/screenshot_readme.png new file mode 100644 index 0000000..17df001 Binary files /dev/null and b/docs/screenshot_readme.png differ diff --git a/examples/demo.ipynb b/examples/demo.ipynb index 959816c..3e92be6 100644 --- a/examples/demo.ipynb +++ b/examples/demo.ipynb @@ -27,19 +27,19 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "id": "5c9cb54e", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "42750495a9944290b30e8f3838224a7a", + "model_id": "73b0690ce530416c93f327dd3c9b46a3", "version_major": 2, "version_minor": 0 }, "text/plain": [ - "VBox(children=(HBox(children=(HTML(value=\"mplstudio\"), HBox(children=(HTML(valu…" + "VBox(children=(HTML(value=\"