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.

I'm having a seven element binomial distribution: BinomialDistribution[7, 0.5], x],{x, 0, 8}] I would like to locate to any arbitrary point on the X axis. Mathematica will let me have eight columns on the X axis ranging from -0.5 on up to 7.5. How do I shift the binomial on up to say, from 5.5 to 13.5?

share|improve this question
    
Joel, your code didn't copy correctly. Would you please try again? Also, please use the editing tools to format it. –  Mr.Wizard Aug 2 '13 at 20:01

2 Answers 2

Attempting to guess from your incomplete question, perhaps you want something like this:

Plot[
 PDF[BinomialDistribution[7, 0.5], x - 6],
 {x, 5.5, 13.5},
 Frame -> True,
 Evaluated -> True
]

enter image description here

share|improve this answer
    
Dear Mister Wizard- Your suggestion helped a lot. Is there someway I could post the Mathematica notebook to this discussion thread? Should I send you the notebook as an e-mail attachment? –  Joel Mayer Aug 2 '13 at 22:46
    
@Joel Is it necessary to post an entire Notebook? You can include a fairly long code block in your question (but please use Ctrl+K to format it). If this is not enough room, you can open the .nb file in a text editor, copy the contents, and put that on pastebin.com . –  Mr.Wizard Aug 2 '13 at 23:46

Perhaps this will answer your question:

Apply the first example of the ref. page on BinomialDistribution to your single distribution in place of the table, I got

DiscretePlot[PDF[BinomialDistribution[7, 0.5], k], {k, 0, 7}, 
  PlotRange -> All, PlotMarkers -> Automatic]

But this doesn't do the columns. From looking through the "Basic Examples" section of the documentation on DiscretePlot, I found the option ExtentSize.

DiscretePlot[PDF[BinomialDistribution[7, 0.5], k], {k, 0, 7}, 
  PlotRange -> All, PlotMarkers -> Automatic, ExtentSize -> Full]

Mathematica graphics

Shifting a function can be done in the usual way, as in Mr.Wizard's answer:

DiscretePlot[PDF[BinomialDistribution[7, 0.5], k - 6], {k, 6, 13}, 
  PlotRange -> All, PlotMarkers -> Automatic, ExtentSize -> Full]

If you would like the edges of the columns drawn, use EdgeForm and the option PlotStyle.

DiscretePlot[PDF[BinomialDistribution[7, 0.5], k - 6], {k, 6, 13}, 
 PlotRange -> All, PlotMarkers -> Automatic, ExtentSize -> Full, 
 PlotStyle -> EdgeForm[ColorData[1][1]]]

Mathematica graphics

share|improve this answer

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.