python - How do I force matplotlib to write out the full form of the x-axis label, avoiding scientific notation? -


I have created a simple hexagon plot with matplotlib.pyplot. I have not changed any default settings. My X-X information is between 2003 and 200, whereas the Y value is from 15 to 35. Instead of writing to 2003, 2004, etc., Mattplelib 0, 1, 2, ... + 2.003 E + 03 Is there a simpler way that methplatelib is forced to write full numbers?

Thank you, Marc C.

I think you can use it to set a string label:

This is a better method in
  nums = arange (2003, 2010) xticks (nums, (str (n) n:  
  gca () .xaxis.set_major_formatter (FormatStrFormatter ('% D'))  

Or something like that. (In earlier versions of Matplotlib, the method was called setMajorFormatter .)


Comments