1

I want to plot an histogram in python 2.7 whith a log scale on y axis:

I wrote this code:

plt.hist(lifes,100, log=True)

But the results of histogram changed for the two axis like this:
histogram

But in the initial histogram I have values > 2000 for x axis and all values are smaller than 200 for y axis. I think it is because some values on x axis have one as effectif?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Rabih Assaf
  • 95
  • 1
  • 1
  • 8
  • Can you provide a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)? – Lucas Feb 04 '17 at 16:46
  • http://matplotlib.org/examples/pylab_examples/log_demo.html#pylab-examples-example-code-log-demo-py – wwii Feb 04 '17 at 17:58
  • 2
    Possible duplicate of [Plot logarithmic axes with matplotlib in python](http://stackoverflow.com/questions/773814/plot-logarithmic-axes-with-matplotlib-in-python) – wwii Feb 04 '17 at 18:00
  • @wwii In how far is the question you link to as possible duplicate helping here? Here, the question explicitely uses the `log` keyword argument (which is prefered over `set_yscale('log')`) and the plot actually shows a log scaling. While it is still unclear, what the real problem is in this case, it's also obvious that the linked question is of no help at all. Instead of just closing a question without need, let's simply wait until the questioner has provided a [MCVE] and only then one can judge upon it being a simple mistake or a problem that someone can help him with. – ImportanceOfBeingErnest Feb 05 '17 at 00:40

0 Answers0