Short version: Is there a value for the FrameTicks
option that retains the default tick marks on all sides, and puts tick labels only on the right and top sides?
I can imagine all manner of cleverness with FontOpacity
, FontSize
, ImagePadding
, etc. (for example) to achieve the desired appearance in the example use case below, but, for a number of reasons, in this post I would like to focus on the question as it is worded (under Question heading).
The example below shows what frameticks look like by default.
Graphics[{}, ImageSize -> Small, Frame -> True]
In other words, the default specification for frame ticks can be described in English as:
(default spec)
- Tick marks are to be placed on all sides;
- Tick labels are to be placed on the left and bottom sides only.
Now, suppose one wants the ticks done according to a small variation of this default spec, one that retains part 1 of the default spec, but changes part 2. For example:
(custom spec)
- Tick marks are to be placed on all sides;
- Tick labels are to be placed on the right and top sides only.
One approach to achieve this result, of course, is to provide full-blown, explicit tick specifications of the form
{{x1, label1, len1, style1}, …}
...as the values of left, right, bottom, top in
FrameTicks -> {{left, right}, {bottom, top}}
This approach is a pain in the butt, of course, but worse still, it does not come close to matching the generality and maintainability of the default1.
The only other documented possibility is to use some combination of the symbolic settings None
, Automatic
, True
, and/or All
.
In search for the "magic combination", I tried the expression
Graphics[{}, ImageSize -> Small, Frame -> True, FrameTicks -> {{a, b}, {a, b}}]
for all possible combinations of values for a
and b
. (I made a chart of the results for future reference; I've appended it at the end of this post.) The only one that came close to implementing the desired spec was a = None, b = All
:
Graphics[{}, ImageSize -> Small, Frame -> True,
FrameTicks -> {{None, All}, {None, All}}]
This result comes up short because it does not satisfy part 1 of the desired specification.
Bottom line, I have not managed to find a documented setting for FrameTicks
that implements the desired spec.
Question
My main question is:
In addition to the one consisting of explicit tick specifications, is there some other (most likely undocumented) value for the FrameTicks
option that implements the custom spec above?
Secondarily, I'm also curious to know if there is some documentation that explains why the custom spec above needs to be made so difficult to implement robustly.
P.S. For future reference, in the chart below, the label next to each side gives its FrameTick
.
Notes
In all cases, left and bottom have the same setting, and likewise for the settings for right and top.
Along each row, the settings for left and bottom are constant. Along each column, the settings for right and top are constant.
The effect of the
True
setting (ironically enough) is not universally consistent; it depends on which side it is applied to. On the left and bottom, the effect is "ticks and labels"; on the right and top, it is "ticks only; no labels". (The same could be said of theAutomatic
setting, but this is reasonable under the interpretation ofAutomatic
as "default".)
1For example, I don't know how I could use this approach in a function that takes some data as input and produces a framed plot that meets the custom tick specification.
ImagePadding
. $\endgroup$