diff --git a/README.md b/README.md new file mode 100644 index 0000000..5df4857 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +仮想環境 + +```sh +python -m venv venv +.\venv\Scripts\activate +``` \ No newline at end of file diff --git a/graphes/base/positioning_map.py b/graphes/base/positioning_map.py new file mode 100644 index 0000000..876a74d --- /dev/null +++ b/graphes/base/positioning_map.py @@ -0,0 +1,38 @@ +import matplotlib.pyplot as plt + +# サンプルデータを辞書で定義 +data = [ + {"name": "Product A", "x": 8, "y": 7}, + {"name": "Product B", "x": 3, "y": 8}, + {"name": "Product C", "x": 6, "y": 4}, + {"name": "Product D", "x": 2, "y": 6} +] + +# データを軸ごとに分ける +categories = [item["name"] for item in data] +x = [item["x"] for item in data] +y = [item["y"] for item in data] + +# グラフの作成 +plt.figure(figsize=(8, 6)) +plt.scatter(x, y, s=200, color='skyblue', edgecolors='black', alpha=0.7) + +# 各データポイントにラベルを付ける +for i, category in enumerate(categories): + plt.text(x[i] + 0.2, y[i], category, fontsize=10) + +# 軸ラベルとタイトル +plt.title('Positioning Map', fontsize=16) +plt.xlabel('Price (X-axis)', fontsize=12) +plt.ylabel('Quality (Y-axis)', fontsize=12) + +# グリッドを追加 +plt.grid(alpha=0.3) + +# X軸とY軸の範囲を設定 +plt.xlim(0, 10) +plt.ylim(0, 10) + +# グラフを表示 +plt.tight_layout() +plt.show() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4b43f7e --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +matplotlib \ No newline at end of file