-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accept a full sampling range specification in plot with out the "samp…
…le" keyword Background: The plot command accepts axis ranges as the first thing after "plot". If present, they update the primary axis ranges x y x2 y2. Since a sampling range of the form [t=min:max] looks just like an axis range with a renamed axis variable name this introduced a window for ambiguity. To remove the ambiguity, version 5 had a keyword "sample" that interposed between axis ranges (if any) and the first sampling range. This patch: If a second colon is found in the range, as in [t=min:max:increment], then it is unambiguously a sampling range rather than a primary axis range. In this case there is no ambiguity and the plot proceeds as if there had been a preceeding "sample" keyword. To make this more general, a empty field following that second colon defaults to whatever would have happened without the colon. Usually this is increment=(max-min)/samples or increment=1 depending on context. So it is always possible to avoid using the "sample" keyword by consistently including a full sampling range including the second color. v5: plot [x=min:max][y=min:max] sample [t=min:man:increment] # OK plot [x=min:max][y=min:max][t=min:man:increment] # not accepted plot [x=min:max][y=min:max][t=min:man] # misinterpreted as x2 range v6 after this patch: plot [x=min:max][y=min:max] sample [t=min:man:increment] # OK plot [x=min:max][y=min:max][t=min:man:increment] # OK, increment makes it clear plot [x=min:max][y=min:max][t=min:man] # still misinterpreted as x2 range plot [x=min:max][y=min:max][t=min:man:] # empty increment OK, uses default Note: The recognition of full sampling ranges [min:max:incr] also applies to splot commands, but if you mix axis ranges and sampling ranges it can still get confused. To be safe, always use a full sampling range with a second colon. Bug #2666
- Loading branch information
Ethan A Merritt
committed
Nov 4, 2023
1 parent
5044393
commit e00e588
Showing
3 changed files
with
61 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters