--Previously, when I displayed the histogram (probably), the boundary line (dividing line) of the bar appeared. --Add ʻec ='black'` to the options of hist function
Uses Python 3.6.0, matplotlib 2.0.0
Confirmed operation with Jupyter-notebook
For example, with the code below, the boundary between each bar does not appear.
% matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.hist(np.random.randn(100))
I wonder if it has changed from matplotlib 2.0.0 ...
When I read the document, I can't find anything like that in the options.
So, when I looked it up, the following hits
python - Cannot get histogram to show separated bins with vertical lines - Stack Overflow
Just add ʻec ='black'` to the hist function of pyplot as shown in the code below.
% matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.hist(np.random.randn(100), ec='black')
――Of course, you can specify another color such as ʻec ='red'`, so you should try various things. --ec is an abbreviation for edge color
(If you are told to use seaborn ...)
Recommended Posts