verify[plot] - verify approximate equality between two plots
|
Calling Sequence
|
|
verify(P, Q, plot)
verify(P, Q, 'plot'(opts))
|
|
Parameters
|
|
P, Q
|
-
|
anything, assumed to be PLOT data structures
|
opts
|
-
|
equation(s) of the form option=value where option is one of curves, display, display_floats, feature_floats, features, points, polygons, text, or traversal; specify options for the comparison
|
|
|
|
|
Description
|
|
•
|
The verify(P, Q, plot) and verify(P, Q, 'plot'(opts)) calling sequences return true if the two PLOT data structures compare using the default comparator.
|
•
|
The default comparator determines that two PLOT data structures are equal if:
|
1.
|
Given two functions, they must have the same name, the same number of arguments, and their arguments must each compare using the default comparator
|
2.
|
Given either two lists or Arrays, their corresponding entries must be equal
|
3.
|
Given two ranges, their endpoints must be compare using the default comparator
|
4.
|
By default, two floating-point numbers are equal if their difference is
|
5.
|
All other objects are compared by using evalb
|
•
|
If either P or Q is not a PLOT data structure then false is returned.
|
•
|
The data structures within a plot object are separated into two classes, display objects, and feature objects. The data structures, which fall into the first class are CURVES, POINTS, POLYGONS, TEXT, and VIEW. All other data structures are considered to be feature data structures.
|
•
|
At each stage, display and feature objects are compared separately, and any features are always compared using the default comparator with any options, which may be given by the features option.
|
•
|
The opts argument can contain one or more of the following equations that set unit options.
|
|
If this option is given, the set of all CURVES objects are compared using this verification.
|
|
Two common verifications for this purpose may be function_bounds and function_shells.
|
|
By default, the display objects of a plot are compared. This can be turned off by setting this option to false.
|
|
display_floats = non-negative or verification
|
|
Given two display objects, the default comparator compares floating-point numbers by testing if their difference is . If this option is set to a non-negative number, then floats are compared by checking that their difference is less than or equal to the given non-negative number. If this option is any other verification, then two floating-point numbers are compared using this verification.
|
|
Common verifications may be float(10) or perhaps neighborhood.
|
|
feature_floats = non-negative or verification
|
|
Given two feature objects, the default comparator compares floating-point numbers by testing if their difference is . If this option is set to a non-negative number, then floats are compared by checking that their difference is less than or equal to the given non-negative number. If this option is any other verification, then two floating-point numbers are compared using this verification.
|
|
The feature_floats is different from display_floats as the latter may contain floating-point numbers of arbitrary magnitude, whereas floating-point numbers in features are often much more bounded, for example, color values.
|
|
Common verifications may be float(10) or perhaps neighborhood.
|
|
By default, the feature objects of a plot are compared. This can be turned off by setting this option to false.
|
|
If this option is given, the set of all POINTS objects are compared using this verification.
|
|
If this option is given, the set of all POLYGONS objects are compared using this verification. Otherwise the default comparator are used to compare POLYGONS objects.
|
|
If this option is given, the set of all TEXT objects are compared using this verification.
|
|
traversal = ordered, unordered, or one_to_one
|
|
By default, this option is set to ordered, in which case objects are compared in the same order in both plots. If this option is set to unordered, then it is only necessary that a match be found for each object in the other PLOT data structure. If this option is set to one_to_one, then a one-to-one correspondence must be found between data structures in both objects.
|
|
The option one_to_one is significantly more expensive than either other test. The option ordered is the least expensive, but is subject to ordering problems, which affect the structure, but not the final plot.
|
|
|
Examples
|
|
>
|
|
>
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
Compare two plots ignoring minor differences
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
| (4) |
>
|
|
| (5) |
Compare a plot and a PLOT data structure
>
|
|
>
|
|
>
|
|
| (6) |
|
|