[...] I think the only outstanding question is the one that your originally posed here:
Open question: What to do about corresponding axis? Instead having both positive and negative labels, both parts of the axis are often displayed with positive labels. Is this something we might also need elsewhere?
I've sort of been thinking about this axis labeling issue in general. ggplot2 has nice integration with the scales package for customized labeling of axes by passing an appropriate function, e,g. percent labels. It would be cool if we could support this kind of functionality too in tinyplot and I think the logical place to implement it is in tinyAxis.R.
In the present case, for example, you could add the following abs() transformation just before do.call() call here.
args$at = axTicks(args$side)
args$labels = abs(args$at)
Originally posted by @grantmcdermott in #361 (comment)
Addendum: Thinking about this some more, an implementation option might be to introduce two new xaxl and yaxl arguments (which would complement the existing xaxt, xaxs, etc. axis customizers). These would accept a function that would transform the label ticks... with some canned routines available as strings. These functions would then get passed to tinyAxis.R as in the above abs example.
Prospective syntax:
tinyplot(..., xaxl = "percent", yaxl = "dollar")
tinyplot(..., xaxl = abs)
tinyplot(..., xaxl = \(x) bquote(10^.(log10(x))))
# etc.
[...] I think the only outstanding question is the one that your originally posed here:
I've sort of been thinking about this axis labeling issue in general.
ggplot2has nice integration with thescalespackage for customized labeling of axes by passing an appropriate function, e,g. percent labels. It would be cool if we could support this kind of functionality too intinyplotand I think the logical place to implement it is in tinyAxis.R.In the present case, for example, you could add the following
abs()transformation just beforedo.call()call here.tinyplot/R/tinyAxis.R
Line 20 in 6e941b3
Originally posted by @grantmcdermott in #361 (comment)
Addendum: Thinking about this some more, an implementation option might be to introduce two new
xaxlandyaxlarguments (which would complement the existingxaxt,xaxs, etc. axis customizers). These would accept a function that would transform the label ticks... with some canned routines available as strings. These functions would then get passed totinyAxis.Ras in the aboveabsexample.Prospective syntax: