Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
data = Flatten[Import["speedtest1B.csv"]];
distrib = HistogramDistribution[data];
histogram = Histogram[data, ChartStyle -> {Blue}];
        ChartStyle -> {Blue},
        ImageSize -> {500,500},
        AxesLabel -> {"start-up time [ms]", "number of samples"}
        CDF[distrib, x], 
        {x, 0, Max[data]},
        ImageSize -> {500,500},
        Axes -> False

From the above I get:

enter image description here

I would like the plots to be properly aligned. Displaying the CDF x-axis on the right side of the plot would be a big plus. Also I don't realy get color-theaming so could someone please explain how to easily change the color od CDF to red.

share|improve this question
Inside Overlay should be {...}, but you don't even need Overlay, use Show - see my answer. – Vitaliy Kaurov Jan 30 '13 at 4:39
up vote 4 down vote accepted
 data = 1000 RandomVariate[GammaDistribution[3, .5], 10^4];
 distrib = HistogramDistribution[data];
 Overlay[{DiscretePlot[CDF[distrib, x], {x, 0, Max[data]},
  ImageSize -> {600, 400}, Frame -> {{False, True}, {False, False}},
  FrameTicks -> {{None, Range[0.1, 1, .1]}, {None, None}},
  ImagePadding -> {{50, 100}, {15, 25}}],
 Histogram[data, ChartStyle -> Opacity[.5, Blue],
  ImageSize -> {600, 400}, ImagePadding -> {{50, 100}, {15, 25}},
  AxesLabel -> {Style["start-up time [ms]", 12],
     Style["number of samples", 12]}]},
  Alignment -> Center]

enter image description here

share|improve this answer
awesome! thank you! Any idea how to label the axes? Simple AxesLabel doesnt really work. – JohnnyM Jan 30 '13 at 5:55
@JohnnyM, please see the update. (You need to adjust the values for the ImagePadding option to see the axes labels.) – kglr Jan 30 '13 at 6:12
thanks! maybe you could help with my other question:… I think it is quite basic. – JohnnyM Jan 30 '13 at 6:16

Your Answer


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.