-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add `line-cap` and `plot-line-cap` parameters (#6) ... they control the line endings for plotted elements (`line-cap`) and the plot decorations, such as axis ticks (`plot-line-cap`). Previously all line endings were round, creating a "crayon" style effect, visible for lines whose width is greater than 1. Also fixed a bug with `hrule`, `vrule` renderers, which attempted to use `'butt` style: since pens were cached, if `vrule` created a pen, all subsequent uses of that pen (same color and width) would use `'butt` line endings, OTOH, if `vrule` reused a pen, because a pen if the same color and width was previously used, the `vrule` line ending would be `'round`
- Loading branch information
Showing
19 changed files
with
97 additions
and
14 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#lang racket | ||
|
||
(require rackunit | ||
plot racket/runtime-path | ||
"../helpers.rkt") | ||
|
||
;; See https://github.com/racket/plot/issues/6 and associated discution. | ||
|
||
(define-runtime-path pr6-data-round "./test-data/pr6-round.dat") | ||
(define-runtime-path pr6-data-butt "./test-data/pr6-butt.dat") | ||
(define-runtime-path pr6-data-projecting "./test-data/pr6-projecting.dat") | ||
|
||
(define (do-plot-pr6 output-fn) | ||
(parameterize | ||
([plot-line-width 10] | ||
[line-width 10] | ||
[plot-pen-color-map 'set1]) | ||
(output-fn | ||
(list | ||
(function sin -5 5 #:color 1 #:label "sin(x)") | ||
(function cos -5 5 #:color 2 #:label "cos(x)"))))) | ||
|
||
(define pr6-test-suite | ||
(test-suite | ||
"PR#6: Add plot-line-cap and line-cap parameters" | ||
(test-case "pr6-round" | ||
(parameterize ([plot-line-cap 'round] | ||
[line-cap 'round]) | ||
(check-draw-steps do-plot-pr6 pr6-data-round))) | ||
(test-case "pr6-butt" | ||
(parameterize ([plot-line-cap 'butt] | ||
[line-cap 'butt]) | ||
(check-draw-steps do-plot-pr6 pr6-data-butt))) | ||
(test-case "pr6-projecting" | ||
(parameterize ([plot-line-cap 'projecting] | ||
[line-cap 'projecting]) | ||
(check-draw-steps do-plot-pr6 pr6-data-projecting))))) | ||
|
||
(module+ test | ||
(require rackunit/text-ui) | ||
(run-tests pr6-test-suite)) |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.