interactive modal (blocking) graphic curve editor
[x, y, ok, gc] = edit_curv() [x, y, ok, gc] = edit_curv(y) [x, y, ok, gc] = edit_curv(x, y) [x, y, ok, gc] = edit_curv(x, y, job) [x, y, ok, gc] = edit_curv(x, y, job, titles) [x, y, ok, gc] = edit_curv(x, y, job, titles, gc) [x, y, ok, gc] = edit_curv(Axes, ..) [x, y, ok, gc] = edit_curv(hCurve) [x, y, ok, gc] = edit_curv(hCurve, job) [x, y, ok, gc] = edit_curv(hCurve, job, titles) [x, y, ok, gc] = edit_curv(hCurve, job, titles, gc)
1:length(y)
.[]
.'a','d','x','y'
, setting authorizations:
"a": | addition of points to the curve. |
"d": | deletion of points of the curve. |
"x": | moving points horizontally, along x. |
"y": | moving points vertically, along y. |
"adxy"
.
[axes_title, x_axis_legend, y_axis_legend]
.
By default, the current or default legends and title are unchanged.
gc=list(dataBounds, xyTicks, lineStyles)
dataBounds: | [xmin, ymin, xmax, ymax] values to assign to
gca().data_bounds as new axes bounds. |
xyTicks: | (unused) graduation parameters [nx,Nx,ny,Ny] :
Nx = number of major ticks along the x axis (-1 for autoticking).
nx = number of minor ticks between 2 major ticks.
Ny, ny: same thing along the y axis. |
lineStyles: | [line_style, colorIndex, thickness, mark_style]
of the curve. %nan stands for keeping the default
value, that are [1 1 2 1]
(solid black 2-thick line with "+" marks). |
list(,, lineStyles)
will use default values for
dataBounds
and xyTicks
.
edit_curv()
is quit through the 'ok' menu.
%F otherwise ('Abort' menu, Figure closed through its X cross..).Edition place:
edit_curv()
, edit_curv(y)
,
edit_curv(x,y)
and edit_curv(x,y,…)
open a new figure, edit the curve in this one, and finally close the figure when
leaving. edit_curv(Axes,…)
edits the curve in the given existing
Axes
set on a uicontrol frame or in a figure and made the current one.
edit_curv(hCurve,…)
edits the given curve in its parent Axes.
Figure, Axes and curve settings and styles:
edit_curv(Axes,…)
and edit_curv(hCurve,…)
change some settings of the figure: The graphics toolbar and existing menus are hidden.
Some menus are added; the title and x and y axis legends may be changed;
a grid is displayed in the axes area; the style of
the hCurve
is changed (thickness, color, markers..).
When leaving, all initial settings are restored.
edit_curv(…)
edits the curve in blocking mode: While editing,
it waits for validating or aborting the edition before returning to the calling
level and performing the next instruction.
The edited curve is set as the current graphical entity before returning.
Enabled actions are set by the job
parameter.
Clicking or/and pressing are done using the left button of the mouse.
Append a point: Click out of the curve. The new point and a segment connecting it to the nearest tip of the curve are drawn. |
Insert a point: Click on an existing segment. The new point is drawn where the segment is split. |
Move a point: Click on it ; move the mouse to where the point should go: the point and its segments follow the mouse ; click to set and stop moving the point at its final position. |
Delete a point: Click on it. Then press the <suppr> key. |
Cancel the previous action (Undo):
Press CTRL Z keys (or use the Control → Undo menu) |
Cancel the previous cancelation (Redo):
Press CTRL Y keys. |
Ok | Validates the current curve, and returns |
Undo (Ctrl-Z) | Iteratively cancels the previous curve's modification. Restores its previous state. |
Redo (Ctrl-Y) | Iteratively restores the last canceled modification of the curve. |
Abort | Restores the initial curve, and returns. |
Load | Opens an interface to choose and load a *.scg graphic file, or a
*.sod binary data file, or *.xy text file.
A *.scg file is then scanned for a polyline curve, whose .data
xy coordinates are loaded.
A *.sod file is scanned for a variable named xy
being a matrix of real numbers. Then xy(:,1:2)
coordinates are loaded.
A *.xy file is assumed to contain a matrix of reals. Its first
two columns are loaded as x and y coordinates. |
Save | Opens an interface to choose a directory and *.sod or *.xy
filename. Then builds a matrix of size N×2 named
xy with the (x,y) coordinates of the edited
curve, and records the matrix in the chosen .sod binary or
.xy text file. |
Clear | Clears the current edited curve. |
Reframe | Sets the axes bounds to the curve's ones. |
Bounds | Opens a pop-pup window prompting the user to enter new
[xmin, ymin, xmax, ymax] bounds of the axes. |
An existing curve may be edited in a non-blocking mode, but without constrain on x or y:
useeditor(gcf().figure_id)
, or by clicking on the edit
button
useeditor(gcf().figure_id)
[x, y] = edit_curv(rand(1,8), "y"); [x y]' | ![]() | ![]() |
edit_curv()
:
Editing a curve in a given subplot:
Version | Description |
2023.1 |
|