Add a title option in the Python version. #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the Python
plot
command and thepplot
script with an additionaltitle
argument. If given, the title is the first line of the plot string and is centered over the non-axis region of the plot (unless it's too long, then it starts just after the y-axis ends). If no title is given, the behavior is the same as right now.Example:
$ pplot 1 10 5 3 9 7 10 0.1 --title "Title" Title 10.00 ┼╭╮ ╭╮ 8.90 ┤││ ╭╮││ 7.80 ┤││ ││││ 6.70 ┤││ │╰╯│ 5.60 ┤││ │ │ 4.50 ┤│╰╮│ │ 3.40 ┤│ ╰╯ │ 2.30 ┤│ │ 1.20 ┤╯ │ 0.10 ┼ ╰
Note: if there is a title, I decrease the height allotted for the rest of the plot by 1. This means that the rest of the plot will look a little different (the axis values change; see an example below). If you'd prefer, we could leave the height the same and just note (e.g. in the doc string) that a plot with a title will have a height that is 1 larger.