title: Create loglog plot of histogram data in xy style - python matplotlib
body: <p>I have a list of values (integers) and I want to show on a graph how many times each value in it occurs.
  I have created a dictionary of values and corresponding frequencies from the list as after searching on here, that seemed best way to do it</p>
  
  <p>I want to plot the data out on an xy loglog graph (with connecting lines) rather than use a bar plot.</p>
  
  <p>The data points on the graph appear as expected when using    </p>
  
  <pre><code>plot.loglog(degree_frequencies.keys(),degree_frequencies.values()) 
  </code></pre>
  
  <p>however, since the lines on the graph connect the first key-value "co-ordinate" to the second, second to third etc and being unordered, this  creates a line that jumps about all over the place, rather than a line that goes from left to right.</p>
  
  <p>Here is an example dataset - where the first "co-ordinate" pair has a higher x value than the second</p>
  
  <pre><code>degree_frequencies  = {8: 1, 2: 6, 3: 1, 5: 2, 6: 2} 
  </code></pre>
  
  <p>(if the dictionary was rearranged to {2: 6, 3: 1, 5: 2, 6: 2, 8: 1} the line would look fine)</p>
  
  <p>Could anyone advise the best way to go about this?  I am wondering if I need to treat the list differently in the first place or if there is in fact a way to plot data like this using matplotlib at all.</p>
  
  <p>I'm a relatively inexperienced Python user, but I have spent some time trawling the internet and the documentation (which I'm finding heavy going) without finding an answer.
  Easy to understand/implement (in my circumstances) would probably be more helpful than elegant yet complex solutions (if poss). </p>
  
  <p>Thanks</p>