title: Matplotlib stem plot with pandas dataframe over a range of x-values
body: <p>I'm pretty much a beginner working with Python so I apologize if I use the wrong terminology. I have a question regarding stem plots using matplotlib. I want to plot the frequency of change on certain positions on a object. I have this pandas dataframe:</p>
  
  <pre><code>df = pd.DataFrame([
  ('315', '1',),
  ('497', '1',),
  ('615', '1',),
  ('646', '1',),
  ('729', '1',),
  ('803', '1',),
  ('882', '3',)
  ], columns=['position', 'freq'])
  
  df
  
    position freq
  0      315    1
  1      497    1
  2      615    1
  3      646    1
  4      729    1
  5      803    1
  6      882    3
  </code></pre>
  
  <p>Now I want to make a stem plot like this:</p>
  
  <pre><code>plt.stem(df.position,df.freq)  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mc635.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mc635.png" alt="enter image description here"></a></p>
  
  <p>However the positions in the dataframe is actually part of a larger range of values from 0-912 (the total length of the object). I want the stem plot to include these values on the x-axis to create a plot looking something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/zxKhq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zxKhq.png" alt="enter image description here"></a></p>
  
  <p>Disregarding the color marked boxes on the axis and the way the plot is displayed, I only want to include the full range of x-values (0-912 and displaying the positions in the dataframe). </p>