6
$\begingroup$

An example:

Histogram[RandomVariate[NormalDistribution[], 1000],
 PlotRangePadding -> 0,
 Frame -> True,
 FrameTicks -> {{{0, 0}}, {}}]

I expected this to produce a histogram without ticks. However:

Histogram with incorrect ticks

Meanwhile, if I use the same tick specification with Plot:

Plot[PDF[NormalDistribution[], x], {x, -\[Pi], \[Pi]},
 PlotRangePadding -> 0,
 Frame -> True,
 FrameTicks -> {{{0, 0}}, {}}]

Plot with correct ticks

$\endgroup$
9
  • 2
    $\begingroup$ Is FrameTicks->None what you want? $\endgroup$
    – ssch
    Jul 30, 2013 at 12:46
  • $\begingroup$ @ssch Thanks, but this was just an illustration that it's not working as I expected it to. I do actually want to provide my own ticks! $\endgroup$ Jul 30, 2013 at 12:47
  • 4
    $\begingroup$ I think you're tick specification is incorrect. There is some ambiguity there from older forms of FrameTicks when Histogram wasn't yet present. So, it only got the newer form. According to the docs, FrameTicks accepts specifications of the form {{left, right}, {bottom, top}}, so you're looking for FrameTicks -> {{{},{}}, {{},{}}}. $\endgroup$
    – rcollyer
    Jul 30, 2013 at 12:56
  • 2
    $\begingroup$ @rcollyer that looks to be the case. Spelunking Histogram shows this row, where frameticks is the option value: If[! MatchQ[frameticks, {{_, _}, {_, _}}], frameticks = ({{#1, #1}, {#1, #1}} &)[frameticks]]; And since original specification doesn't match it gets turned into some ungodly {{{{}, {}}, {{}, {}}}, {{{}, {}}, {{}, {}}}} which gets thrown out later and replaced with Automatic ticks because it is not Visualization`Utilities`FrameTicksQ $\endgroup$
    – ssch
    Jul 30, 2013 at 13:01
  • 2
    $\begingroup$ FYI: your code as shown produces no tick marks in Version 7 on Windows, but produces an error (pink box). $\endgroup$
    – Mr.Wizard
    Jul 30, 2013 at 14:11

1 Answer 1

13
$\begingroup$

The FrameTicks specification changed in v6. Previously, the form

{right, bottom, left, top}

was used, but in v6, it was changed to

{{left, right}, {bottom, top}}

To maintain compatibility between the versions, the older form is still allowed for the older plots. But, quite a few plots were added since that point (e.g. Histogram was added in v7), and they only use the newer form. To achieve what your looking for without setting

FrameTicks -> None

you need to use this

FrameTicks -> {{{(*left*)}, {(*right*)}}, {{(*bottom*)}, {(*top*)}}}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.