multifunctionplotter 1.0.3__py3-none-any.whl

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.
@@ -0,0 +1,881 @@
1
+ Metadata-Version: 2.4
2
+ Name: multifunctionplotter
3
+ Version: 1.0.3
4
+ Summary: Publication-quality plots from CSV/TXT/DAT files — CLI, Python API, and MCP agent tool
5
+ Author: Swarnadeep Seth
6
+ License: Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship, whether in Source or
41
+ Object form, made available under the License, as indicated by a
42
+ copyright notice that is included in or attached to the work
43
+ (an example is provided in the Appendix below).
44
+
45
+ "Derivative Works" shall mean any work, whether in Source or Object
46
+ form, that is based on (or derived from) the Work and for which the
47
+ editorial revisions, annotations, elaborations, or other modifications
48
+ represent, as a whole, an original work of authorship. For the purposes
49
+ of this License, Derivative Works shall not include works that remain
50
+ separable from, or merely link (or bind by name) to the interfaces of,
51
+ the Work and Derivative Works thereof.
52
+
53
+ "Contribution" shall mean any work of authorship, including
54
+ the original version of the Work and any modifications or additions
55
+ to that Work or Derivative Works thereof, that is intentionally
56
+ submitted to Licensor for inclusion in the Work by the copyright owner
57
+ or by an individual or Legal Entity authorized to submit on behalf of
58
+ the copyright owner. For the purposes of this definition, "submitted"
59
+ means any form of electronic, verbal, or written communication sent
60
+ to the Licensor or its representatives, including but not limited to
61
+ communication on electronic mailing lists, source code control systems,
62
+ and issue tracking systems that are managed by, or on behalf of, the
63
+ Licensor for the purpose of discussing and improving the Work, but
64
+ excluding communication that is conspicuously marked or otherwise
65
+ designated in writing by the copyright owner as "Not a Contribution."
66
+
67
+ "Contributor" shall mean Licensor and any individual or Legal Entity
68
+ on behalf of whom a Contribution has been received by Licensor and
69
+ subsequently incorporated within the Work.
70
+
71
+ 2. Grant of Copyright License. Subject to the terms and conditions of
72
+ this License, each Contributor hereby grants to You a perpetual,
73
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
74
+ copyright license to reproduce, prepare Derivative Works of,
75
+ publicly display, publicly perform, sublicense, and distribute the
76
+ Work and such Derivative Works in Source or Object form.
77
+
78
+ 3. Grant of Patent License. Subject to the terms and conditions of
79
+ this License, each Contributor hereby grants to You a perpetual,
80
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
+ (except as stated in this section) patent license to make, have made,
82
+ use, offer to sell, sell, import, and otherwise transfer the Work,
83
+ where such license applies only to those patent claims licensable
84
+ by such Contributor that are necessarily infringed by their
85
+ Contribution(s) alone or by combination of their Contribution(s)
86
+ with the Work to which such Contribution(s) was submitted. If You
87
+ institute patent litigation against any entity (including a
88
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
89
+ or a Contribution incorporated within the Work constitutes direct
90
+ or contributory patent infringement, then any patent licenses
91
+ granted to You under this License for that Work shall terminate
92
+ as of the date such litigation is filed.
93
+
94
+ 4. Redistribution. You may reproduce and distribute copies of the
95
+ Work or Derivative Works thereof in any medium, with or without
96
+ modifications, and in Source or Object form, provided that You
97
+ meet the following conditions:
98
+
99
+ (a) You must give any other recipients of the Work or
100
+ Derivative Works a copy of this License; and
101
+
102
+ (b) You must cause any modified files to carry prominent notices
103
+ stating that You changed the files; and
104
+
105
+ (c) You must retain, in the Source form of any Derivative Works
106
+ that You distribute, all copyright, patent, trademark, and
107
+ attribution notices from the Source form of the Work,
108
+ excluding those notices that do not pertain to any part of
109
+ the Derivative Works; and
110
+
111
+ (d) If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained
114
+ within such NOTICE file, excluding those notices that do not
115
+ pertain to any part of the Derivative Works, in at least one
116
+ of the following places: within a NOTICE text file distributed
117
+ as part of the Derivative Works; within the Source form or
118
+ documentation, if provided along with the Derivative Works; or,
119
+ within a display generated by the Derivative Works, if and
120
+ wherever such third-party notices normally appear. The contents
121
+ of the NOTICE file are for informational purposes only and
122
+ do not modify the License. You may add Your own attribution
123
+ notices within Derivative Works that You distribute, alongside
124
+ or as an addendum to the NOTICE text from the Work, provided
125
+ that such additional attribution notices cannot be construed
126
+ as modifying the License.
127
+
128
+ You may add Your own copyright statement to Your modifications and
129
+ may provide additional or different license terms and conditions
130
+ for use, reproduction, or distribution of Your modifications, or
131
+ for any such Derivative Works as a whole, provided Your use,
132
+ reproduction, and distribution of the Work otherwise complies with
133
+ the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
136
+ any Contribution intentionally submitted for inclusion in the Work
137
+ by You to the Licensor shall be under the terms and conditions of
138
+ this License, without any additional terms or conditions.
139
+ Notwithstanding the above, nothing herein shall supersede or modify
140
+ the terms of any separate license agreement you may have executed
141
+ with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks. This License does not grant permission to use the trade
144
+ names, trademarks, service marks, or product names of the Licensor,
145
+ except as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 7. Disclaimer of Warranty. Unless required by applicable law or
149
+ agreed to in writing, Licensor provides the Work (and each
150
+ Contributor provides its Contributions) on an "AS IS" BASIS,
151
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
+ implied, including, without limitation, any warranties or conditions
153
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
+ PARTICULAR PURPOSE. You are solely responsible for determining the
155
+ appropriateness of using or redistributing the Work and assume any
156
+ risks associated with Your exercise of permissions under this License.
157
+
158
+ 8. Limitation of Liability. In no event and under no legal theory,
159
+ whether in tort (including negligence), contract, or otherwise,
160
+ unless required by applicable law (such as deliberate and grossly
161
+ negligent acts) or agreed to in writing, shall any Contributor be
162
+ liable to You for damages, including any direct, indirect, special,
163
+ incidental, or consequential damages of any character arising as a
164
+ result of this License or out of the use or inability to use the
165
+ Work (including but not limited to damages for loss of goodwill,
166
+ work stoppage, computer failure or malfunction, or any and all
167
+ other commercial damages or losses), even if such Contributor
168
+ has been advised of the possibility of such damages.
169
+
170
+ 9. Accepting Warranty or Additional Liability. While redistributing
171
+ the Work or Derivative Works thereof, You may choose to offer,
172
+ and charge a fee for, acceptance of support, warranty, indemnity,
173
+ or other liability obligations and/or rights consistent with this
174
+ License. However, in accepting such obligations, You may act only
175
+ on Your own behalf and on Your sole responsibility, not on behalf
176
+ of any other Contributor, and only if You agree to indemnify,
177
+ defend, and hold each Contributor harmless for any liability
178
+ incurred by, or claims asserted against, such Contributor by reason
179
+ of your accepting any such warranty or additional liability.
180
+
181
+ END OF TERMS AND CONDITIONS
182
+
183
+ APPENDIX: How to apply the Apache License to your work.
184
+
185
+ To apply the Apache License to your work, attach the following
186
+ boilerplate notice, with the fields enclosed by brackets "[]"
187
+ replaced with your own identifying information. (Don't include
188
+ the brackets!) The text should be enclosed in the appropriate
189
+ comment syntax for the file format. We also recommend that a
190
+ file or class name and description of purpose be included on the
191
+ same "printed page" as the copyright notice for easier
192
+ identification within third-party archives.
193
+
194
+ Copyright [yyyy] [name of copyright owner]
195
+
196
+ Licensed under the Apache License, Version 2.0 (the "License");
197
+ you may not use this file except in compliance with the License.
198
+ You may obtain a copy of the License at
199
+
200
+ http://www.apache.org/licenses/LICENSE-2.0
201
+
202
+ Unless required by applicable law or agreed to in writing, software
203
+ distributed under the License is distributed on an "AS IS" BASIS,
204
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
+ See the License for the specific language governing permissions and
206
+ limitations under the License.
207
+
208
+ Project-URL: Homepage, https://github.com/SwarnadeepSeth/MultiFunctionPlotter
209
+ Project-URL: Repository, https://github.com/SwarnadeepSeth/MultiFunctionPlotter
210
+ Keywords: plotting,visualization,matplotlib,cli,mcp,ai-agent
211
+ Classifier: Programming Language :: Python :: 3
212
+ Classifier: License :: OSI Approved :: MIT License
213
+ Classifier: Operating System :: OS Independent
214
+ Classifier: Topic :: Scientific/Engineering :: Visualization
215
+ Classifier: Environment :: Console
216
+ Requires-Python: >=3.8
217
+ Description-Content-Type: text/markdown
218
+ License-File: LICENSE
219
+ Requires-Dist: matplotlib
220
+ Requires-Dist: numpy
221
+ Requires-Dist: pandas
222
+ Requires-Dist: seaborn
223
+ Requires-Dist: fastmcp
224
+ Provides-Extra: forecast
225
+ Requires-Dist: prophet; extra == "forecast"
226
+ Requires-Dist: scipy; extra == "forecast"
227
+ Requires-Dist: statsmodels; extra == "forecast"
228
+ Dynamic: license-file
229
+
230
+ # MultiFunctionPlotter (MFP)
231
+
232
+ A versatile Python-based tool for creating publication-quality plots from CSV, TXT, or DAT files. MFP combines the simplicity of gnuplot-style commands with the power of Python's matplotlib and seaborn libraries.
233
+
234
+ ## Version: 1.2.0
235
+
236
+ ---
237
+
238
+ ## Table of Contents
239
+
240
+ - [MultiFunctionPlotter (MFP)](#multifunctionplotter-mfp)
241
+ - [Version: 1.2.0](#version-120)
242
+ - [Table of Contents](#table-of-contents)
243
+ - [Features](#features)
244
+ - [Installation](#installation)
245
+ - [Option 1: Install Dependencies](#option-1-install-dependencies)
246
+ - [Option 2: Install as Command-Line Tool (Recommended)](#option-2-install-as-command-line-tool-recommended)
247
+ - [Quick Start](#quick-start)
248
+ - [Command Line](#command-line)
249
+ - [Python API](#python-api)
250
+ - [Basic Usage](#basic-usage)
251
+ - [Command Syntax](#command-syntax)
252
+ - [Common Tokens](#common-tokens)
253
+ - [Full Example](#full-example)
254
+ - [Plot Styles](#plot-styles)
255
+ - [Line \& Marker Styles](#line--marker-styles)
256
+ - [Error Bars](#error-bars)
257
+ - [Scatter with Colormap](#scatter-with-colormap)
258
+ - [Distribution Plots](#distribution-plots)
259
+ - [2D Plots](#2d-plots)
260
+ - [Advanced Axis Formatting (v1.2)](#advanced-axis-formatting-v12)
261
+ - [Scientific Notation](#scientific-notation)
262
+ - [Custom Tick Positions](#custom-tick-positions)
263
+ - [Tick Rotation](#tick-rotation)
264
+ - [Date Formatting](#date-formatting)
265
+ - [Combined Example](#combined-example)
266
+ - [Mathematical Functions](#mathematical-functions)
267
+ - [Subplots](#subplots)
268
+ - [Log Scale](#log-scale)
269
+ - [Saving Figures](#saving-figures)
270
+ - [Custom Figure Size](#custom-figure-size)
271
+ - [JSON Configuration](#json-configuration)
272
+ - [Time Series Forecasting](#time-series-forecasting)
273
+ - [Data Manipulator](#data-manipulator)
274
+ - [Launch](#launch)
275
+ - [Supported File Formats](#supported-file-formats)
276
+ - [Available Actions](#available-actions)
277
+ - [Inspection Commands](#inspection-commands)
278
+ - [Transformation Commands](#transformation-commands)
279
+ - [Data Cleaning](#data-cleaning)
280
+ - [I/O Commands](#io-commands)
281
+ - [History Commands](#history-commands)
282
+ - [Examples](#examples)
283
+ - [Tips](#tips)
284
+ - [Examples](#examples-1)
285
+ - [Stock Price Analysis](#stock-price-analysis)
286
+ - [Error Analysis](#error-analysis)
287
+ - [Scientific Data](#scientific-data)
288
+ - [Publication Quality](#publication-quality)
289
+ - [Help System](#help-system)
290
+ - [Command Line Help](#command-line-help)
291
+ - [List All Styles](#list-all-styles)
292
+ - [Contributing](#contributing)
293
+ - [License](#license)
294
+ - [Author](#author)
295
+
296
+ ---
297
+
298
+ ## Features
299
+
300
+ - **Multiple File Formats**: Load data from CSV, TXT, or DAT files
301
+ - **Rich Plot Styles**: Line plots, points, dashed lines, error bars, scatter, histograms, KDE, box plots, violin plots
302
+ - **2D Visualizations**: Heatmaps, contour plots, filled contours
303
+ - **Colormap Scatter**: Color points by a third variable
304
+ - **Custom Functions**: Plot mathematical expressions directly
305
+ - **Advanced Axis Formatting**: Scientific notation, custom ticks, rotations, date formatting
306
+ - **Subplot Layouts**: Organize multiple plots in grid layouts
307
+ - **Log Scale**: Logarithmic axes for spectrum analysis
308
+ - **JSON Config**: Save and replay plot configurations
309
+ - **CLI & API**: Use from command line or Python code
310
+
311
+ ---
312
+
313
+ ## Installation
314
+
315
+ ### Option 1: Install Dependencies
316
+
317
+ Install the required Python packages:
318
+
319
+ ```
320
+ pip install -r requirements.txt
321
+ ```
322
+
323
+ **Required packages:**
324
+ - matplotlib
325
+ - numpy
326
+ - pandas
327
+ - seaborn
328
+
329
+ ### Option 2: Install as Command-Line Tool (Recommended)
330
+
331
+ Run the install script to make `mfp` available as a global command:
332
+
333
+ ```
334
+ bash install.sh
335
+ ```
336
+
337
+ This will:
338
+ 1. Make `src/mfp.py` executable
339
+ 2. Create a symbolic link at `/usr/local/bin/mfp`
340
+
341
+ After installation, you can run `mfp` from anywhere:
342
+
343
+ ```
344
+ mfp data.csv using 1:2 with lines
345
+ mfp --help
346
+ mfp forecast
347
+ ```
348
+
349
+ **Note:** Requires sudo privileges to create the symbolic link in `/usr/local/bin`.
350
+
351
+ ---
352
+
353
+ ## Quick Start
354
+
355
+ ### Command Line
356
+
357
+ ```
358
+ # Basic line plot
359
+ mfp data.csv using 1:2 with lines
360
+
361
+ # With title and labels
362
+ mfp data.csv using 1:2 with lines title "My Plot" xlabel "X" ylabel "Y"
363
+
364
+ # Save to file
365
+ mfp data.csv using 1:2 with lines --save plot.png
366
+ ```
367
+
368
+ ### Python API
369
+
370
+ ```python
371
+ import sys
372
+ sys.path.insert(0, 'src')
373
+ from mfp import PlotConfig, Plotter
374
+
375
+ # Create plot configuration
376
+ cfg = PlotConfig(
377
+ file="data.csv",
378
+ x_col=1, y_col=2,
379
+ style="lines",
380
+ title="My Plot",
381
+ xlabel="X Axis",
382
+ ylabel="Y Axis"
383
+ )
384
+
385
+ # Generate plot
386
+ Plotter(cfg).plot()
387
+ ```
388
+
389
+ ---
390
+
391
+ ## Basic Usage
392
+
393
+ ### Command Syntax
394
+
395
+ ```
396
+ mfp <file> using <x_col>:<y_col> with <style> [options]
397
+ ```
398
+
399
+ ### Common Tokens
400
+
401
+ | Token | Description | Example |
402
+ |-------|-------------|---------|
403
+ | `using` / `u` | Column indices (1-based for text, 0-based for CSV) | `using 1:2` |
404
+ | `with` / `w` | Plot style | `with lines` |
405
+ | `title` | Plot title | `title "My Title"` |
406
+ | `xlabel` | X-axis label | `xlabel "Time"` |
407
+ | `ylabel` | Y-axis label | `xlabel "Price"` |
408
+ | `legend` / `lg` | Legend entry | `legend "Series 1"` |
409
+ | `linewidth` / `lw` | Line width (default: 2) | `linewidth 3` |
410
+ | `linecolor` / `lc` | Line/marker color | `linecolor tab:red` |
411
+ | `xrange` | X-axis limits | `xrange 0:100` |
412
+ | `yrange` | Y-axis limits | `yrange 0:1000` |
413
+
414
+ ### Full Example
415
+
416
+ ```
417
+ mfp data.csv using 1:2 with lines title "Stock Prices" xlabel "Date" ylabel "Close Price" linecolor tab:blue linewidth 2 --save plot.png
418
+ ```
419
+
420
+ ---
421
+
422
+ ## Plot Styles
423
+
424
+ ### Line & Marker Styles
425
+
426
+ | Style | Alias | Description |
427
+ |-------|-------|-------------|
428
+ | `lines` | `l` | Solid line |
429
+ | `dashed` | | Dashed line |
430
+ | `dotted` | | Dotted line |
431
+ | `points` | `p` | Circle markers only |
432
+ | `linespoints` | `lp` | Line + markers |
433
+ | `stars` | `*` | Star markers |
434
+ | `d` | | Diamond markers |
435
+
436
+ **Example:**
437
+ ```
438
+ mfp data.csv using 1:2 with points linecolor tab:red
439
+ mfp data.csv using 1:2 with dashed linecolor tab:green
440
+ ```
441
+
442
+ ### Error Bars
443
+
444
+ Two styles available:
445
+
446
+ **Discrete Error Bars** (`errorbars` / `eb`):
447
+ ```
448
+ mfp data.dat using 1:2 with errorbars yerr 3
449
+ ```
450
+
451
+ **Shaded Error Band** (`errorshade` / `es`):
452
+ ```
453
+ mfp data.dat using 1:2 with errorshade yerr 3
454
+ ```
455
+
456
+ **Extra tokens:**
457
+ - `yerr <col>` - Column with ±σ values
458
+ - `capsize <int>` - Cap width (default: 4)
459
+
460
+ **Combine with lines:**
461
+ ```
462
+ mfp data.csv using 1:2 with errorshade yerr 3 lc steelblue, data.csv using 1:2 with lines lc steelblue
463
+ ```
464
+
465
+ ### Scatter with Colormap
466
+
467
+ Plot x vs y colored by a third variable:
468
+
469
+ ```
470
+ mfp data.csv using 1:2 with scatter cmap 3 colormap plasma
471
+ ```
472
+
473
+ **Tokens:**
474
+ - `cmap <col>` - Column for color values (required)
475
+ - `colormap <name>` - Matplotlib colormap (default: viridis)
476
+ - `cbar_label` - Colorbar label
477
+
478
+ **Useful Colormaps:**
479
+ - Perceptually uniform: `viridis`, `plasma`, `inferno`, `magma`, `cividis`
480
+ - Diverging: `coolwarm`, `RdBu`, `seismic`
481
+ - Sequential: `Blues`, `Reds`, `YlOrRd`
482
+
483
+ ### Distribution Plots
484
+
485
+ | Style | Description |
486
+ |-------|-------------|
487
+ | `hist` | Histogram (use `bin <n>` for number of bins) |
488
+ | `kde` | Kernel Density Estimation |
489
+ | `box` | Box-and-whisker plot |
490
+ | `violin` | Violin plot |
491
+
492
+ **Examples:**
493
+ ```
494
+ mfp data.csv using 0:1 with hist bin 30
495
+ mfp data.csv using 0:1 with kde
496
+ mfp data.csv using 0:1 with box
497
+ mfp data.csv using 0:1 with violin
498
+ ```
499
+
500
+ ### 2D Plots
501
+
502
+ For matrix/grid data (no column specification needed):
503
+
504
+ | Style | Description |
505
+ |-------|-------------|
506
+ | `heatmap` | 2D heatmap (imshow) |
507
+ | `contour` | Contour lines |
508
+ | `contourf` | Filled contours |
509
+
510
+ **Examples:**
511
+ ```
512
+ mfp matrix.dat with heatmap colormap viridis
513
+ mfp matrix.dat with contourf levels 20 colormap RdBu
514
+ mfp matrix.dat with contour levels 15
515
+ ```
516
+
517
+ **Tokens:**
518
+ - `colormap <name>` - Colormap (default: viridis)
519
+ - `levels <n>` - Number of contour levels (default: 10)
520
+ - `cbar_label` - Colorbar label
521
+
522
+ ---
523
+
524
+ ## Advanced Axis Formatting (v1.2)
525
+
526
+ Control axis appearance with precision for publication-quality plots.
527
+
528
+ ### Scientific Notation
529
+
530
+ ```
531
+ mfp data.csv using 1:2 with lines sci_notation x
532
+ mfp data.csv using 1:2 with lines sci_notation y
533
+ mfp data.csv using 1:2 with lines sci_notation both
534
+ ```
535
+
536
+ ### Custom Tick Positions
537
+
538
+ ```
539
+ mfp data.csv using 1:2 with lines xticks "0,90,180,270"
540
+ mfp data.csv using 1:2 with lines yticks "0,1e-5,2e-5"
541
+ ```
542
+
543
+ ### Tick Rotation
544
+
545
+ ```
546
+ mfp data.csv using 1:2 with lines xtick_rotation 45
547
+ mfp data.csv using 1:2 with lines ytick_rotation 90
548
+ ```
549
+
550
+ ### Date Formatting
551
+
552
+ ```
553
+ mfp data.csv using 1:2 with lines date_format "%Y-%m-%d"
554
+ ```
555
+
556
+ Format codes: `%Y` (year), `%m` (month), `%d` (day), `%H` (hour), `%M` (min), `%S` (sec)
557
+
558
+ ### Combined Example
559
+
560
+ ```
561
+ mfp data.csv using 1:2 with lines sci_notation both xticks "0,300,600" xtick_rotation 30
562
+ ```
563
+
564
+ ---
565
+
566
+ ## Mathematical Functions
567
+
568
+ Plot mathematical expressions directly:
569
+
570
+ ```
571
+ mfp func: "f(x) = np.sin(x)" xrange 0:10
572
+ ```
573
+
574
+ **With parameters:**
575
+ ```
576
+ mfp func: "f(x,a=2) = a*np.cos(x)" xrange 0:10
577
+ ```
578
+
579
+ **Tokens:**
580
+ - `func:` - Start function definition
581
+ - `xrange` - Required x-axis range
582
+ - Use `np.` prefix for numpy functions
583
+
584
+ **Examples:**
585
+ ```
586
+ mfp func: "f(x) = np.sin(x)" xrange 0:10 lc red
587
+ mfp func: "f(x) = x**2" xrange 0:5 lc blue lw 2
588
+ mfp func: "f(x,a=1,b=2) = a*np.exp(-b*x)" xrange 0:5
589
+ ```
590
+
591
+ ---
592
+
593
+ ## Subplots
594
+
595
+ Create multi-panel figures using `--subplot`:
596
+
597
+ ```
598
+ mfp --subplot AB data.csv using 1:2 with lines, data.csv using 1:2 with hist
599
+ ```
600
+
601
+ **Layout format:**
602
+ - Letters represent panels (A, B, C, ...)
603
+ - Use `-` to separate rows
604
+ - Each command separated by comma
605
+
606
+ **2x2 Grid:**
607
+ ```
608
+ mfp --subplot AB-CD "plot1, plot2, plot3, plot4"
609
+ ```
610
+
611
+ **Asymmetric Layout:**
612
+ ```
613
+ mfp --subplot AA-BC "top_full, bottom_left, bottom_right"
614
+ ```
615
+
616
+ ---
617
+
618
+ ## Log Scale
619
+
620
+ Apply logarithmic scale to axes:
621
+
622
+ ```
623
+ mfp spectrum.csv using 1:2 with lines --ylog
624
+ mfp spectrum.csv using 1:2 with lines --xlog --ylog
625
+ ```
626
+
627
+ **Tokens:**
628
+ - `--xlog` - Logarithmic x-axis
629
+ - `--ylog` - Logarithmic y-axis
630
+
631
+ ---
632
+
633
+ ## Saving Figures
634
+
635
+ Save plots to file:
636
+
637
+ ```
638
+ mfp data.csv using 1:2 with lines --save plot.png
639
+ mfp data.csv using 1:2 with lines --save plot.pdf
640
+ mfp data.csv using 1:2 with lines --save plot.svg
641
+ ```
642
+
643
+ **Supported formats:**
644
+ - `.png` - Raster (good for web)
645
+ - `.pdf` - Vector (best for publications)
646
+ - `.svg` - Vector (good for editing)
647
+ - `.eps` - Vector (legacy journals)
648
+
649
+ ### Custom Figure Size
650
+
651
+ Set custom figure dimensions:
652
+
653
+ ```
654
+ mfp data.csv using 1:2 with lines --figsize 10:5
655
+ ```
656
+
657
+ This sets figure to 10×5 inches. Default is 12×6.
658
+
659
+ ---
660
+
661
+ ## JSON Configuration
662
+
663
+ MFP saves your last plot configuration to `plot.json`:
664
+
665
+ ```
666
+ mfp data.csv using 1:2 with lines --save plot.png
667
+ # plot.json is automatically saved
668
+ mfp plot.json # Replay last plot
669
+ ```
670
+
671
+ **Manual JSON creation:**
672
+ ```json
673
+ {
674
+ "file": "data.csv",
675
+ "x_col": 1,
676
+ "y_col": 2,
677
+ "style": "lines",
678
+ "title": "My Plot",
679
+ "linecolor": "tab:blue",
680
+ "linewidth": 2
681
+ }
682
+ ```
683
+
684
+ Then run:
685
+ ```
686
+ mfp plot.json
687
+ ```
688
+
689
+ ---
690
+
691
+ ## Time Series Forecasting
692
+
693
+ Forecast future values using Facebook Prophet:
694
+
695
+ ```
696
+ mfp forecast
697
+ ```
698
+
699
+ This launches an interactive forecasting tool.
700
+
701
+ **Data format for forecasting:**
702
+ ```
703
+ Date,Value
704
+ 2019-01-01,100
705
+ 2019-01-02,105
706
+ ...
707
+ ```
708
+
709
+ ---
710
+
711
+ ## Data Manipulator
712
+
713
+ MFP includes a powerful interactive data manipulation tool for exploring, cleaning, and transforming tabular data without writing code.
714
+
715
+ ### Launch
716
+
717
+ ```
718
+ mfp DM
719
+ ```
720
+
721
+ Or directly:
722
+ ```
723
+ python src/mfp_dmanp.py data.csv
724
+ ```
725
+
726
+ ### Supported File Formats
727
+
728
+ - CSV files (.csv)
729
+ - Excel files (.xlsx, .xls)
730
+ - JSON files (.json)
731
+
732
+ ### Available Actions
733
+
734
+ #### Inspection Commands
735
+
736
+ | Command | Description |
737
+ |---------|-------------|
738
+ | `show` | Print the current DataFrame |
739
+ | `head [N]` | Print first N rows (default: 10) |
740
+ | `tail [N]` | Print last N rows (default: 10) |
741
+ | `properties` / `props` | Column dtypes, NaN counts, summary statistics |
742
+ | `counts <col>` | Frequency count of unique values |
743
+
744
+ #### Transformation Commands
745
+
746
+ | Command | Description |
747
+ |---------|-------------|
748
+ | `filter <expr>` | Keep rows matching a pandas query expression |
749
+ | `slice <start:end>` | Keep rows in range [start, end) |
750
+ | `sort <col> asc/desc` | Sort by a column |
751
+ | `rename <old:new,...>` | Rename columns |
752
+ | `cast <col> <type>` | Change column dtype (int/float/str/datetime) |
753
+ | `addcol <name> <expr>` | Add new column from expression |
754
+ | `modify <col> <old> <new>` | Replace values in a column |
755
+ | `delete <col>` | Drop columns or rows |
756
+
757
+ #### Data Cleaning
758
+
759
+ | Command | Description |
760
+ |---------|-------------|
761
+ | `dedup [col1,col2]` | Remove duplicate rows |
762
+ | `fillna <col> <value>` | Fill NaN cells with value |
763
+ | `dropna <col>` | Drop rows with NaN |
764
+
765
+ #### I/O Commands
766
+
767
+ | Command | Description |
768
+ |---------|-------------|
769
+ | `load <file>` | Load a new file |
770
+ | `generate <expr>` | Generate data from expression |
771
+ | `gen` | Alias for generate |
772
+ | `append <file>` | Append rows from another file |
773
+ | `merge <file> <on_col>` | Merge with another file |
774
+ | `save <file>` | Save to file |
775
+
776
+ #### History Commands
777
+
778
+ | Command | Description |
779
+ |---------|-------------|
780
+ | `undo` | Revert last operation |
781
+ | `redo` | Re-apply undone operation |
782
+
783
+ ### Examples
784
+
785
+ ```
786
+ Action> load data.csv
787
+ Action> head
788
+ Action> properties
789
+ Action> filter price > 100
790
+ Action> sort volume desc
791
+ Action> rename old_name:new_name
792
+ Action> addcol profit revenue - cost
793
+ Action> dedup
794
+ Action> save cleaned_data.csv
795
+ ```
796
+
797
+ ### Tips
798
+
799
+ - Use `help` to see all commands
800
+ - Use `undo` / `redo` to navigate changes
801
+ - Expressions support pandas query syntax
802
+ - Use `addcol` with `df.eval()` expressions
803
+
804
+ ---
805
+
806
+ ## Examples
807
+
808
+ ### Stock Price Analysis
809
+ ```
810
+ # Close price over time
811
+ mfp data.csv using 0:4 with lines title "Close Price" xlabel "Date" ylabel "Price"
812
+
813
+ # Multiple prices
814
+ mfp "data.csv using 0:2 with lines lc green, data.csv using 0:4 with lines lc blue"
815
+ ```
816
+
817
+ ### Error Analysis
818
+ ```
819
+ mfp data.dat using 1:2 with errorbars yerr 3 lc red
820
+ mfp data.dat using 1:2 with errorshade yerr 3 lc orange
821
+ ```
822
+
823
+ ### Scientific Data
824
+ ```
825
+ # Log scale for spectrum
826
+ mfp spectrum.csv using 1:2 with lines --ylog
827
+
828
+ # Scientific notation
829
+ mfp data.csv using 1:2 with lines sci_notation both
830
+ ```
831
+
832
+ ### Publication Quality
833
+ ```
834
+ mfp data.csv using 1:2 with lines title "Results" xlabel "Time (s)" ylabel "Voltage (mV)" linewidth 3 sci_notation y xtick_rotation 45 --save figure.pdf
835
+ ```
836
+
837
+ ---
838
+
839
+ ## Help System
840
+
841
+ ### Command Line Help
842
+ ```
843
+ mfp --help
844
+ mfp --help tokens
845
+ mfp --help styles
846
+ mfp --help errorbars
847
+ mfp --help colormap
848
+ mfp --help 2d
849
+ mfp --help logscale
850
+ mfp --help subplots
851
+ mfp --help save
852
+ mfp --help formatting
853
+ mfp --help examples
854
+ ```
855
+
856
+ ### List All Styles
857
+ ```
858
+ mfp --list-styles
859
+ ```
860
+
861
+ ---
862
+
863
+ ## Contributing
864
+
865
+ Contributions are welcome! Please feel free to:
866
+ - Open an issue for bug reports or feature requests
867
+ - Submit a pull request for improvements
868
+ - Share your use cases and examples
869
+
870
+ ---
871
+
872
+ ## License
873
+
874
+ MIT License
875
+
876
+ ---
877
+
878
+ ## Author
879
+
880
+ **Dr. Swarnadeep Seth**
881
+ MultiFunctionPlotter (MFP) - A versatile data visualization tool