6

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

Will Vousden
  • 767
  • 1
  • 4
  • 16
  • 2
    Is FrameTicks->None what you want? – ssch Jul 30 '13 at 12:46
  • @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! – Will Vousden Jul 30 '13 at 12:47
  • When you specify the FrameTicks, as opposed to empty lists, does it work? If not, could you post your tick specification? – rcollyer Jul 30 '13 at 12:48
  • I've updated my example to make it less ambiguous. The tick specification works with Plot (and ListPlot, and all their variants), but not with Histogram. – Will Vousden Jul 30 '13 at 12:50
  • 4
    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 -> {{{},{}}, {{},{}}}. – rcollyer Jul 30 '13 at 12:56
  • 2
    @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 – ssch Jul 30 '13 at 13:01
  • @rcollyer You're quite right! I should've read the documentation more carefully. If you post it as an answer, I'll accept it :-) – Will Vousden Jul 30 '13 at 13:08
  • @WillVousden under most circumstances, I'd vote to close this as it was a mis-reading of the documentation. However, as both forms are still allowed for some plots, I can see where others would be confused. – rcollyer Jul 30 '13 at 13:15
  • 2
    FYI: your code as shown produces no tick marks in Version 7 on Windows, but produces an error (pink box). – Mr.Wizard Jul 30 '13 at 14:11

1 Answers1

13

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*)}}}
rcollyer
  • 33,976
  • 7
  • 92
  • 191