set.seed(2) 

u <- rnorm(n = 100, mean = -2, sd = 1)

v <- rnorm(n = 100, mean =  2, sd = 2)
hist(u, xaxt = 'n') 

COL <- c(rgb(255,   0, 255,  55, max = 255),
         rgb(  0,   0, 255,  55, max = 255)) 
hist(u, xaxt = 'n') 

axis(side = 1, 
     at     = seq(-5, 5, 0.5),
     labels = seq(-5, 5, 0.5))

hist(u,breaks = 'Scott',
     right = F,        
     ylim = c(0, 40),  
     col = 'yellow',   
     main = '主タイトル',
     xlab = 'x軸ラベル[単位]',
     ylab = '度数')

BINS <- seq(-20,20,1)

hist(u,col = 0, border = 0,
     breaks = BINS,
     right = F,
     main = '主タイトル',
     xlab = 'x軸ラベル[単位]',
     ylab = '度数')
     
     grid()
     
     hist(u, breaks = BINS, col = COL[1], add = T)
     hist(v, breaks = BINS, col = COL[2], add = T)

     legend('topleft', fill = COL, legend = c('u', 'v'))

import numpy as np

np.random.seed(3)

u = np.random.normal(loc =-2.0, scale = 1.0, size = 100)
v = np.random.normal(loc = 2.0, scale = 2.0, size = 100)

import matplotlib.pyplot as plt
import matplotlib.dates as mdates

BINS = np.linspace(-20, 20, 41)
plt.hist(u, BINS, label = 'u', color = (1.0, 0.0, 1.0, 0.2))
plt.hist(v, BINS, label = 'v', color = (0.0, 0.0, 1.0, 0.2))

plt.title('主タイトル')
plt.xlabel('x軸ラベル[単位]')
plt.ylabel('y軸ラベル[単位]')

plt.grid(linestyle = '--', axis = 'y', color = (0.8, 0.8, 0.8, 0.25))

plt.legend(loc = 'upper right')

plt.show()
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 36600 (\N{CJK UNIFIED IDEOGRAPH-8EF8}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 12521 (\N{KATAKANA LETTER RA}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 12505 (\N{KATAKANA LETTER BE}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 12523 (\N{KATAKANA LETTER RU}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 65339 (\N{FULLWIDTH LEFT SQUARE BRACKET}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 21336 (\N{CJK UNIFIED IDEOGRAPH-5358}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 20301 (\N{CJK UNIFIED IDEOGRAPH-4F4D}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 65341 (\N{FULLWIDTH RIGHT SQUARE BRACKET}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 20027 (\N{CJK UNIFIED IDEOGRAPH-4E3B}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 12479 (\N{KATAKANA LETTER TA}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 12452 (\N{KATAKANA LETTER I}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)
## C:\Users\naruk\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\call.py:7: UserWarning: Glyph 12488 (\N{KATAKANA LETTER TO}) missing from current font.
##   value, error = rpycall.call_r_function(f, *args, **kwargs)

x <- c(107,94,111,103,98,120,109,96,
       101,100,124,105,112,106,98,107,
       110,100,99,113,101,97,121,105)

summary(x)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   94.00   99.75  105.00  105.71  110.25  124.00
hist(x,
breaks='Scott')

hist(x,
breaks='FD')