Cplotter is a python package for runtime interaction with the Matplotlib plots generated. It allows users to modify data points on the plots as well as modify axis and figure layouts. This is extremely useful in removing the outliers and other unintended points in a plot. It has provision for keystroke inputs as well as mouse button inputs. It also allows interaction through button widgets as well as I/O textbox. Once a plot (plots) is (are) generated the control on the plot can be transferred to this package by calling the iplot() class.
- Aritra Chakrabarty (IIA, Bangalore)
- python>3.6
- numpy
- matplotlib
Presently, the code is only available on Github. Either download the code or
use the following line on terminal to install using pip:
pip install git+https://github.com/arcunique/Cplotter #installs from the current master on this repo.
The instructions regarding the use of the keystrokes, mouse buttons, button widgets and textboxes are as follows:
- Use iplot() after plotting to acquire the control
- Click the left MB to select a plot (line2D)
- Click the right MB to delete a single point from a plot
- To select multiple points take the cursor everytime near a point and press 'a'
- To delete all the points selected press 'd'
- Press 'u' to update the axis X & Y limits
- In case multiple plots have a common point of intersection, to delete that point from one of these plots select the line first by clicking left MB and then press 'a' to select the point or directly delete by clicking right MB. Otherwise the tool will decide by itself which plot to delete the point from.
- Undo a change by pressing 'Ctrl+z' and redo by pressing 'Ctrl+Shift+z' or 'Ctrl+y'
- To pre-provide a path for saving a plot use the 'saveto' kwarg
- To save a plot to any path type "save /full/path [optional argument]" in the 'I/O' textbox. The optional argument is either -c for the plot including the textboxes and buttons or -o for the figure only
- Press the 'Save' button for quicksaving. If a path is pre-provided the plot is saved to that path, otherwise saves to the last path typed in the textbox. If no path is found, it shows a warning message
- Also, you can type standard Python commands in the 'I/O' textbox. These commands, however, are not undo/redo-able
- The control can be released by pressing 'Shift+q'