From 9465805f50a665b7f369d500ea38dbb3d3c2977b Mon Sep 17 00:00:00 2001 From: Neil Toronto Date: Fri, 14 Oct 2011 22:04:59 -0600 Subject: [PATCH] Fixed x/y mixup in 'axes' Removed 'plot-tick-skip' parameter Merge into 5.2 (cherry picked from commit 7270c27141d017a4d3edd19231489a780a111348) --- collects/plot/common/parameters.rkt | 1 - collects/plot/common/ticks.rkt | 2 +- collects/plot/plot2d/decoration.rkt | 4 ++-- collects/plot/plot2d/plot.rkt | 2 -- collects/plot/plot3d/plot.rkt | 2 -- collects/plot/scribblings/params.scrbl | 1 - collects/plot/tests/plot2d-tests.rkt | 2 ++ 7 files changed, 5 insertions(+), 9 deletions(-) diff --git a/collects/plot/common/parameters.rkt b/collects/plot/common/parameters.rkt index 2b0387f854..dbb8d5ce70 100644 --- a/collects/plot/common/parameters.rkt +++ b/collects/plot/common/parameters.rkt @@ -38,7 +38,6 @@ (defparam plot-legend-box-alpha alpha (real-in 0 1) 2/3) (defparam plot-tick-size (>=/c 0) 10) -(defparam plot-tick-skip exact-positive-integer? 2) (defparam plot-title (or/c string? #f) #f) (defparam plot-x-label (or/c string? #f) "x axis") diff --git a/collects/plot/common/ticks.rkt b/collects/plot/common/ticks.rkt index b5ed92e69e..d87c12ba66 100644 --- a/collects/plot/common/ticks.rkt +++ b/collects/plot/common/ticks.rkt @@ -42,7 +42,7 @@ (map tick ps labels majors))) (defproc (default-ticks-fun [x-min real?] [x-max real?]) (listof tick?) - (linear-ticks (plot-tick-skip) x-min x-max)) + (linear-ticks 2 x-min x-max)) (defproc (auto-contour-zs [z-min real?] [z-max real?]) (listof real?) (let* ([zs (map tick-p (default-ticks-fun z-min z-max))] diff --git a/collects/plot/plot2d/decoration.rkt b/collects/plot/plot2d/decoration.rkt index 90bdebd46a..7f2b2335d6 100644 --- a/collects/plot/plot2d/decoration.rkt +++ b/collects/plot/plot2d/decoration.rkt @@ -76,8 +76,8 @@ [#:x-ticks? x-ticks? boolean? (x-axis-ticks?)] [#:y-ticks? y-ticks? boolean? (y-axis-ticks?)] ) (listof renderer2d?) - (list (x-axis x #:ticks? x-ticks?) - (y-axis y #:ticks? y-ticks?))) + (list (x-axis y #:ticks? x-ticks?) + (y-axis x #:ticks? y-ticks?))) ;; =================================================================================================== ;; Polar axes diff --git a/collects/plot/plot2d/plot.rkt b/collects/plot/plot2d/plot.rkt index 5689886c57..9555afbb34 100644 --- a/collects/plot/plot2d/plot.rkt +++ b/collects/plot/plot2d/plot.rkt @@ -128,7 +128,6 @@ (define line-width (plot-line-width)) (define legend-box-alpha (plot-legend-box-alpha)) (define tick-size (plot-tick-size)) - (define tick-skip (plot-tick-skip)) (define x-transform (plot-x-transform)) (define y-transform (plot-y-transform)) (define z-transform (plot-z-transform)) @@ -144,7 +143,6 @@ [plot-line-width line-width] [plot-legend-box-alpha legend-box-alpha] [plot-tick-size tick-size] - [plot-tick-skip tick-skip] [plot-x-transform x-transform] [plot-y-transform y-transform] [plot-z-transform z-transform] diff --git a/collects/plot/plot3d/plot.rkt b/collects/plot/plot3d/plot.rkt index 2df82378ea..97b9b6ded5 100644 --- a/collects/plot/plot3d/plot.rkt +++ b/collects/plot/plot3d/plot.rkt @@ -150,7 +150,6 @@ (define line-width (plot-line-width)) (define legend-box-alpha (plot-legend-box-alpha)) (define tick-size (plot-tick-size)) - (define tick-skip (plot-tick-skip)) (define x-transform (plot-x-transform)) (define y-transform (plot-y-transform)) (define z-transform (plot-z-transform)) @@ -170,7 +169,6 @@ [plot-line-width line-width] [plot-legend-box-alpha legend-box-alpha] [plot-tick-size tick-size] - [plot-tick-skip tick-skip] [plot-x-transform x-transform] [plot-y-transform y-transform] [plot-z-transform z-transform] diff --git a/collects/plot/scribblings/params.scrbl b/collects/plot/scribblings/params.scrbl index 3aaa1ce164..89654e4cbb 100644 --- a/collects/plot/scribblings/params.scrbl +++ b/collects/plot/scribblings/params.scrbl @@ -84,7 +84,6 @@ See @(racket ->pen-color) and @(racket ->brush-color) for details on how PLoT in @doc-apply[plot-legend-box-alpha]{The opacity of the filled rectangle behind the legend entries.} @doc-apply[plot-tick-size]{The length of tick lines, in drawing units.} -@doc-apply[plot-tick-skip]{Controls the spacing between major ticks for renderers that use the default tick function, such as the renderers returned by @(racket function) and @(racket surface3d). With the default value @(racket 2), every other tick is major. A tick at @(racket 0) is always major. Major ticks are thicker and labeled; minor ticks are thinner and unlabeled.} @doc-apply[plot-title] @doc-apply[plot-x-label] diff --git a/collects/plot/tests/plot2d-tests.rkt b/collects/plot/tests/plot2d-tests.rkt index 000531b9bc..9db7b8634a 100644 --- a/collects/plot/tests/plot2d-tests.rkt +++ b/collects/plot/tests/plot2d-tests.rkt @@ -11,6 +11,8 @@ (plot empty #:x-min -1 #:x-max 1 #:y-min -1 #:y-max 1) +(plot (list (axes 1 2) (function values -4 4))) + (time (plot (function values 0 1000))) (parameterize ([plot-background "black"]