parameter
transform:axis-transform/cparameter
transform:axis-transform/cparameter
transform:axis-transform/c
value
value
log-transform: expects type <positive real> as 1st argument, given: -1; other arguments were: 1
procedure
( stretch-transform abscale)→axis-transform/c
a:real?b:real?
#:width2#:color4#:label"y = sin(x)/x")#:anchor'bottom-right))#:y-max1.2))
#:legend-anchor'center))
value
procedure
( hand-drawn-transform freq)→axis-transform/c
-11-11#:samples9)))
The easiest ways to construct novel axis transforms are to use the axis transform combinators axis-transform-append , axis-transform-bound and axis-transform-compose , or to apply make-axis-transform to an invertible-function .
procedure
( axis-transform-append t1t2mid)→axis-transform/c
mid:real?
0)])
procedure
procedure
'(1.0 2.2618595071429146 3.0)
'(1.0 1.9999999999999998 3.0000000000000004)
Technically, fun does not need to be truly invertible. Given fun = (invertible-function fg), it is enough for f to be a left inverse of g; that is, always (f(gx))= x but not necessarily (g(fx))= x. If f and g had to be strict inverses of each other, there could be no collapse-transform .
procedure
( apply-axis-transform tx-minx-max)→invertible-function?
x-min:real?x-max:real?
Each plot axis has two independent sets of ticks: the near ticks and the far ticks.
#:angle45#:altitude50#:title"Axis Names and Tick Locations"))
Major ticks are longer than minor ticks. Major tick labels are always drawn unless collapsed with a nearby tick. Minor tick labels are never drawn.
#:legend-anchor'center)#:legend-anchor'center)))
'(0 1/5 2/5 3/5 4/5 1)
'(1/5 2/5 3/5 4/5)
parameter
( plot-d-ticks )→ticks?
ticks:ticks?
parameter
( plot-r-ticks )→ticks?
ticks:ticks?
#:extra-constructor-namemake-ticks)layout:ticks-layout/cformat:ticks-format/c
(list
(tick 7/20 #f ".35")
(tick 2/5 #t ".4")
(tick 9/20 #f ".45")
(tick 1/2 #t ".5")
(tick 11/20 #f ".55")
(tick 3/5 #t ".6")
(tick 13/20 #f ".65"))
parameter
number:exact-positive-integer?= 4
0.110)#:x-label"Interval [0,x]"#:y-label"Number of ticks")
procedure
#:basebase#:divisorsdivisors]#:scientific?scientific?)scientific?:#tprocedure
#:basebase
To lay out ticks, linear-ticks-layout finds the power of base closest to the axis interval size, chooses a simple first tick, and then chooses a skip length using divisors that maximizes the number of ticks without exceeding number. For strategic use of non-default arguments, see bit/byte-ticks , currency-ticks , and fraction-ticks . The default arguments correspond to the standard 1-2-5-in-base-10 rule used almost everywhere in plot tick layout.
To format ticks, linear-ticks-format uses real->plot-label passing the value of scientific?, and uses digits-for-range to determine the maximum number of fractional digits in the decimal expansion.
Changed in version 1.1 of package plot-gui-lib: Added the #:scientific? argument to linear-ticks-format and linear-ticks .
procedure
procedure
scientific?:#tscientific?:#t
The #:base keyword argument is the logarithm base. The #:scientific keyword argument disables scientific formatting, similarly to linear-ticks . See plot-z-far-ticks for an example of use.
procedure
( date-ticks-layout [#:numbernumber])→ticks-layout/c
procedure
( date-ticks-format [#:formatsformats])→ticks-format/c
procedure
These axis ticks regard values as being in seconds since a system-dependent Universal Coordinated Time (UTC) epoch. (For example, the Unix and Mac OS X epoch is January 1, 1970 UTC, and the Windows epoch is January 1, 1601 UTC.) Use date->seconds to convert local dates to seconds, or datetime->real to convert dates to UTC seconds in a way that accounts for time zone offsets.
Actually, date-ticks-layout does not always space ticks quite uniformly. For example, it rounds ticks that are spaced about one month apart or more to the nearest month. Generally, date-ticks-layout tries to place ticks at minute, hour, day, week, month and year boundaries, as well as common multiples such as 90 days or 6 months.
To try to avoid displaying overlapping labels, date-ticks-format chooses date formats from formats for which labels will contain no redundant information.
All the format specifiers given in srfi/19 (which are derived from Unix’s date command), except those that represent time zones, are allowed in date format strings.
parameter
( date-ticks-formats )→(listof string? )
value
='("~Y-~m-~d ~H:~M:~f""~Y-~m-~d ~H:~M""~Y-~m-~d ~Hh""~Y-~m-~d""~Y-~m""~Y""~m-~d ~H:~M:~f""~m-~d ~H:~M""~m-~d ~Hh""~m-~d""~H:~M:~f""~H:~M""~Hh""~M:~fs""~Mm""~fs")value
='("~Y-~m-~d ~I:~M:~f ~p""~Y-~m-~d ~I:~M ~p""~Y-~m-~d ~I ~p""~Y-~m-~d""~Y-~m""~Y""~m-~d ~I:~M:~f ~p""~m-~d ~I:~M ~p""~m-~d ~I ~p""~m-~d""~I:~M:~f ~p""~I:~M ~p""~I ~p""~M:~fs""~Mm""~fs")
procedure
( time-ticks-layout [#:numbernumber])→ticks-layout/c
procedure
( time-ticks-format [#:formatsformats])→ticks-format/c
procedure
These axis ticks regard values as being in seconds. Use datetime->real to convert sql-time or plot-time values to seconds.
Generally, time-ticks-layout tries to place ticks at minute, hour and day boundaries, as well as common multiples such as 12 hours or 30 days.
To try to avoid displaying overlapping labels, time-ticks-format chooses a date format from formats for which labels will contain no redundant information.
All the time-related format specifiers given in srfi/19 (which are derived from Unix’s date command) are allowed in time format strings.
parameter
( time-ticks-formats )→(listof string? )
value
='("~dd ~H:~M:~f""~dd ~H:~M""~dd ~Hh""~dd""~H:~M:~f""~H:~M""~Hh""~M:~fs""~Mm""~fs")value
='("~dd ~I:~M:~f ~p""~dd ~I:~M ~p""~dd ~I ~p""~dd""~I:~M:~f ~p""~I:~M ~p""~I ~p""~M:~fs""~Mm""~fs")
procedure
#:scalesscalesprocedure
#:kindkind#:scalesscales
The #:kind keyword argument is either a string containing the currency symbol, or a currency code such as 'USD, 'GBP or 'EUR. The currency-ticks-format function can map most ISO 4217 currency codes to their corresponding currency symbol.
The #:scales keyword argument is a list of suffixes for each 103 scale, such as "K" (US thousand, or kilo), "bn" (UK short-scale billion) or "Md" (EU long-scale milliard). Off-scale amounts are given power-of-ten suffixes such as “×1021.”
"~$": replaced by the currency symbol
"~w": replaced by the whole part of the amount
"~f": replaced by the fractional part, with 2 or more decimal digits
"~s": replaced by the scale suffix
"~~": replaced by “~”
parameter
( currency-ticks-scales )→(listof string? )
parameter
( currency-ticks-formats )→(list/c string? string? string? )
Cultural sensitivity notwithstanding, when writing for a local audience, it is generally considered proper to use local currency scales and formats for foreign currencies, but use the foreign currency symbol.
value
us-currency-scales :(listof string? )='("""K""M""B""T")
value
uk-currency-scales :(listof string? )='("""k""m""bn""tr")
value
eu-currency-scales :(listof string? )='("""K""M""Md""B")
The abbreviations actually used vary with geography, even within countries, but these seem to be common. Further long-scale suffix abbreviations such as for “billiard” are omitted due to lack of even weak consensus.
value
='("~$~w.~f~s""(~$~w.~f~s)""~0γγ«")
value
='("~$~w.~f~s""-~$~w.~f~s""~0γγ«")
value
='("~w,~f ~s~$""-~w,~f ~s~$""0 ~$")
value
value
value
#:x-min0.01#:x-max1/4)))'([η»ε:image])
#:x-min-10#:x-max10))
procedure
procedure
#:sizesize
The #:kind keyword argument indicates either International System of Units ('SI) suffixes, as used to communicate hard drive capacities, or Computer Science ('CS) suffixes, as used to communicate memory capacities.
If kind is 'SI, base 10 and divisors '(1245).
If kind is 'CS, base 2 and divisors '(12).
procedure
procedure
procedure
( ticks-mimic thunk)→ticks?
procedure
( ticks-scale tfun)→ticks?
t:ticks?
#(7541.6)#(9042.7)#(10565.5)#(12078.9)#(13578.9)#(150131.1)#(165151.1)#(180176.2)))#:style'long-dash#:color3#:label"Trend")#:y-min-25#:x-label"Time"))
Note that the layout function returns pre-tick s, or unlabeled ticks, and a separate format function is used to produce the labels for the ticks.
The returned labels should be usually distinct, as the plot library will consider ticks with labels that are string=? to be duplicates and collapse them, however, this feature can be used by a custom format function to force removal of some ticks from the plot.
Axis bounds can be used to determine how many decimal digits to display, usually by applying digits-for-range to the bounds.
struct
#:extra-constructor-namemake-invertible-function)
The function itself is f, and its inverse is g. Because real? s can be inexact, this invariant must be approximate and therefore cannot be enforced. (For example, (exp (log 10)) = 10.000000000000002.) The obligation to maintain it rests on whomever constructs one.
value
procedure
procedure
procedure
( linear-scale m[b])→invertible-function?