Mathematica,FrameTicks在不同类型的情节中不一致

Jag*_*gra 3 plot wolfram-mathematica mathematica-8

在进一步开发早期问题的解决方案时,我遇到了一些意想不到的不一致:

如何在绘图的y轴上显示%值?

这似乎有点不同,值得一篇新帖子.

从相同的数据开始:

data = {{{2010, 8, 3}, 
0.}, {{2010, 8, 31}, -0.052208}, {{2010, 9, 30}, 
0.008221}, {{2010, 10, 29}, 0.133203}, {{2010, 11, 30}, 
0.044557}, {{2010, 12, 31}, 0.164891}, {{2011, 1, 31}, 
0.055141}, {{2011, 2, 28}, 0.114801}, {{2011, 3, 31}, 
0.170501}, {{2011, 4, 29}, 0.347566}, {{2011, 5, 31}, 
0.461358}, {{2011, 6, 30}, 0.244649}, {{2011, 7, 29}, 
0.41939}, {{2011, 8, 31}, 0.589874}, {{2011, 9, 30}, 
0.444151}, {{2011, 10, 31}, 0.549095}, {{2011, 11, 30}, 
0.539669}};
Run Code Online (Sandbox Code Playgroud)

我定义了一种方法,可以FrameTicks根据上一篇文章中提供的贡献和见解建立百分比:

myFrameTicks = 
Table[
  {k/10., ToString@(10 k) <> "%"}, 
  {
    k, 
    IntegerPart[Floor[Min@data[[All, 2]], .1]*10], 
    IntegerPart[Ceiling[Max@data[[All, 2]], .1]*10]
   }
 ];
Run Code Online (Sandbox Code Playgroud)

现在使用相同的数据查看两个相同数据的图FrameTicks:

DateListPlot[data, FrameTicks -> {{myFrameTicks, None}, {Automatic, None}}]
Run Code Online (Sandbox Code Playgroud)

Mathematica图形

ListPlot[data[[All, 2]], FrameTicks -> {{myFrameTicks, None}, {Automatic, None}}]
Run Code Online (Sandbox Code Playgroud)

Mathematica图形

那么,为什么这两个图都没有像第一个那样显示百分比(例如,60%)?

我可能错过了一些明显的东西(不是第一次).此外,当与ListLinePlotor 一起使用时,这种方法似乎不起作用BarChart,两者似乎都接受一个FrameTicks属性.

Dav*_*idC 7

DateListPlot默认为Frame->True.ListPlot默认为Frame->False.它显示的是Ticks,而不是FrameTicks.

尝试将其设置Frame为true:

DateListPlot[data, 
  FrameTicks -> {{myFrameTicks, None}, {Automatic, None}}]

ListPlot[data[[All, 2]], 
  Frame -> True, 
  FrameTicks -> {{myFrameTicks, None}, {Automatic, None}}]
Run Code Online (Sandbox Code Playgroud)