Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775
{"id":2998,"date":"2022-08-17T22:59:48","date_gmt":"2022-08-17T13:59:48","guid":{"rendered":"https:\/\/craft-gogo.com\/?p=2998"},"modified":"2023-08-15T21:56:18","modified_gmt":"2023-08-15T12:56:18","slug":"python-histgram","status":"publish","type":"post","link":"https:\/\/craft-gogo.com\/python-histgram\/","title":{"rendered":"\u3010Python\u5165\u9580\u3011matplotlib\u3067\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3092\u63cf\u753b\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n

\u4eca\u56de\u306fmatplotlib\u3092\u4f7f\u3063\u3066\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3092\u63cf\u753b\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306e\u4eba\u6c17\u30aa\u30f3\u30e9\u30a4\u30f3\u30b3\u30fc\u30b9\"<\/a>\n\n\n\n

\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u306e\u63cf\u753b\u65b9\u6cd5<\/h2>\n\n\n\n

\u30c7\u30d5\u30a9\u30eb\u30c8\u63cf\u753b\u65b9\u6cd5<\/h3>\n\n\n\n

\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u306fpyplot\u30e2\u30b8\u30e5\u30fc\u30eb\u306ehist\u95a2\u6570\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u63cf\u304f\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n

import numpy as np\nimport matplotlib.pyplot as plt\n      \nx = np.random.normal(50, 10, 1000)\n\nplt.hist(x)\nplt.show()<\/code><\/pre><\/div>\n\n\n\n

\u30ad\u30fc\u30ef\u30fc\u30c9\u5f15\u6570\u3092\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408\u306f\u3001\u968e\u7d1a\u6570\u306f10\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

\u968e\u7d1a\u6570\u306e\u8a2d\u5b9a\u65b9\u6cd5<\/h3>\n\n\n\n

\u968e\u7d1a\u6570\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001\u300cbins\u300d\u306b\u300c\u968e\u7d1a\u6570\u300d\u3092\u6e21\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

plt.hist(x, bins=20)<\/code><\/pre><\/div>\n\n\n\n
\"\"<\/figure>\n\n\n\n

\u968e\u7d1a\u7bc4\u56f2\u306e\u8a2d\u5b9a\u65b9\u6cd5<\/h3>\n\n\n\n

\u968e\u7d1a\u7bc4\u56f2\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001\u300crange\u300d\u306b\u300c(\u6700\u5c0f\u5024, \u6700\u5927\u5024)\u300d\u3092\u6e21\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

plt.hist(x, range=(40,80))<\/code><\/pre><\/div>\n\n\n\n
\"\"<\/figure>\n\n\n\n

\u6b63\u898f\u5316\u65b9\u6cd5<\/h3>\n\n\n\n

\u6b63\u898f\u5316\u3059\u308b\u306b\u306f\u3001\u300cdensity\u300d\u306b\u300cTrue\u300d\u3092\u6e21\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

plt.hist(x, density=True)<\/code><\/pre><\/div>\n\n\n\n
\"\"<\/figure>\n\n\n\n

\u30b0\u30e9\u30d5\u8272\u306e\u8a2d\u5b9a\u65b9\u6cd5<\/h3>\n\n\n\n

\u30b0\u30e9\u30d5\u8272\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001\u300ccolor\u300d\u306b\u300c\u8272\u5024\u300d\u3092\u6e21\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

plt.hist(x, color='r')<\/code><\/pre><\/div>\n\n\n\n
\"\"<\/figure>\n\n\n\n

\u307e\u3068\u3081<\/h2>\n\n\n\n

matplotlib\u3092\u4f7f\u3063\u3066\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3092\u63cf\u753b\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n

\u4eca\u56de\u306e\u8a18\u4e8b\u304c\u7686\u3055\u3093\u306ePython\u5b66\u7fd2\u306b\u5f79\u7acb\u3064\u306a\u3089\u5e78\u3044\u3067\u3059\u3002<\/p>\n\n\n\n

Python\u72ec\u5b66\u304c\u5927\u5909\u306a\u65b9\u306f\u3001\u66f8\u7c4d\u3084\u30b9\u30af\u30fc\u30eb\u3092\u6d3b\u7528<\/span><\/strong>\u3059\u308b\u306e\u3082\u624b\u3067\u3059\u3002<\/p>\n\n\n\n