Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

So I have been fighting with this for a while. I'm trying to get custom frame ticks on both the left and right side of a DistributionChart. It's not going very well. It just keeps throwing errors saying tick position needs to be a number. Which in my code it is. Here is an example:

With[
 {fps = {120, 60, 50, 40, 30, 25, 20, 15, 10}},
 DistributionChart[
  RandomVariate[SkewNormalDistribution[##], 100] & @@@ {{20, 13, 5}, {30, 12, 10}},
  ChartLabels -> {1, 2},
  PlotRange -> {0, 70},
  GridLines -> {None, N@Table[1/i*1000, {i, fps}]},
  FrameTicks -> {
   {
     Table[{N[1/i*1000], NumberForm[N[1/i*1000], 3]}, {i, fps}],(*Left*)
     Table[{1/i*1000, i}, {i, fps}] (*Right*)
   },
   {
     None,(*Bottom*)
     None (*Top*)
   }
  }
 ]
]

Any help would be much appreciated.

share|improve this question
    
It seems there is a bug in there. Try AbsoluteOptions@ DistributionChart[RandomReal[BetaDistribution[2, 1/4], {6, 100}]] –  belisarius Oct 7 '12 at 19:52
    
This example from the documentation for DistributionChart also has a problem with Ticks: DistributionChart[data, ChartLabels -> {"a", "b", "c"}] AbsoluteOptions[%] –  David Carraher Oct 7 '12 at 20:05
add comment

1 Answer

up vote 3 down vote accepted

There seems to be a bug here as even

DistributionChart[{{1, 2, 3, 4, 5}, {1, 1, 2, 3}}, FrameTicks -> {{None, None}, {None, None}}]

yields an error, but you can work around it as follows:

With[{fps = {120, 60, 50, 40, 30, 25, 20, 15, 10}}, 
 DistributionChart[
   RandomVariate[SkewNormalDistribution[##], 100] & @@@ {{20, 13, 5}, {30, 12, 10}}, 
   ChartLabels -> {1, 2}, PlotRange -> {0, 70}, 
   GridLines -> {None, N@Table[1/i*1000, {i, fps}]}
 ] /. 
  Rule[FrameTicks, __] -> 
   Rule[FrameTicks, {{Table[{N[1/i*1000],NumberForm[N[1/i*1000], 3]}, {i, fps}],(*Left*)
      Table[{1/i*1000, i}, {i, fps}] (*Right*)}, {None,(*Bottom*) None (*Top*)}}]
]

Mathematica graphics

share|improve this answer
    
Thank you. Your workaround works perfectly. DistributionChart seems quite buggy. This is not the first bug in it I've run in to. –  Mr Alpha Oct 8 '12 at 12:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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