> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# line_series()

export const GitHubLink = ({url, compact = false}) => <a href={url} target="_blank" rel="noopener noreferrer" className={compact ? "source-link" : "github-source-link"}>
    {compact ? "View source" : <>
    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
      <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
    </svg>
    GitHub source
      </>}
  </a>;

<GitHubLink compact url="https://github.com/wandb/wandb/blob/main/wandb/plot/line_series.py#L13" />

<h2 id="function-wandbplotline_series">
  <Badge color="blue" size="lg" shape="rounded">関数</Badge> wandb.plot.line\_series()
</h2>

折れ線チャートを構築します。

```python theme={"system"}
xs: 'Iterable[Iterable[Any]] | Iterable[Any]',
ys: 'Iterable[Iterable[Any]]',
keys: 'Iterable[str] | None' = None,
title: 'str' = '',
xname: 'str' = 'x',
split_table: 'bool' = False
```

<h2 id="args">
  引数
</h2>

<ResponseField name="xs" type="Iterable[Iterable[Any]] | Iterable[Any]">
  x 値のシーケンス。単一の配列が提供された場合、すべての y 値はその x 配列に対してプロットされます。配列の配列が提供された場合、各 y 値は対応する x 配列に対してプロットされます。
</ResponseField>

<ResponseField name="ys" type="Iterable[Iterable[Any]]">
  y 値のシーケンス。各イテラブルは個別の line 時系列を表します。
</ResponseField>

<ResponseField name="keys" type="Iterable[str] | None">
  各 line 時系列にラベルを付けるためのキーのシーケンス。指定しない場合、キーは自動的に "line\_1"、"line\_2" などとして生成されます。
</ResponseField>

<ResponseField name="title" type="str">
  チャートのタイトル。
</ResponseField>

<ResponseField name="xname" type="str">
  X 軸のラベル。
</ResponseField>

<ResponseField name="split_table" type="bool">
  表を W\&B UI の別セクションに分割するかどうか。`True` の場合、表は「カスタム チャート Tables」という名前のセクションに表示されます。デフォルトは `False` です。
</ResponseField>

<h2 id="returns">
  Returns
</h2>

`CustomChart`: W\&B にログできるカスタム チャート オブジェクトです。チャートをログするには、`wandb.log()` に渡します。

<h2 id="examples">
  サンプル
</h2>

単一の x 配列をログし、すべての y 時系列を同じ x 値に対してプロットする例:

```python theme={"system"}
import wandb

# W&B run を初期化します
with wandb.init(project="line_series_example") as run:
    # すべての y 時系列で共有する x 値
    xs = list(range(10))

    # 描画する複数の y 時系列
    ys = [
        [i for i in range(10)],  # y = x
        [i**2 for i in range(10)],  # y = x^2
        [i**3 for i in range(10)],  # y = x^3
    ]

    # 折れ線チャートを生成してログします
    line_series_chart = wandb.plot.line_series(
        xs,
        ys,
        title="title",
        xname="step",
    )
    run.log({"line-series-single-x": line_series_chart})
```

この例では、単一の `xs` 時系列 (共有の x 値) をすべての
`ys` 時系列に使用します。これにより、各 y 時系列は
同じ x 値 (0-9) に対してプロットされます。

複数の x 配列をログし、各 y 時系列を対応する x 配列に対してプロットする例:

```python theme={"system"}
import wandb

# W&B run を初期化します
with wandb.init(project="line_series_example") as run:
    # 各 y 時系列に個別の x 値を用意します
    xs = [
        [i for i in range(10)],  # 1 番目の時系列の x 値
        [2 * i for i in range(10)],  # 2 番目の時系列の x 値（間隔を拡大）
        [3 * i for i in range(10)],  # 3 番目の時系列の x 値（間隔をさらに拡大）
    ]

    # 対応する y 時系列
    ys = [
        [i for i in range(10)],  # y = x
        [i**2 for i in range(10)],  # y = x^2
        [i**3 for i in range(10)],  # y = x^3
    ]

    # 折れ線チャートを生成してログします
    line_series_chart = wandb.plot.line_series(
        xs, ys, title="Multiple X Arrays Example", xname="Step"
    )
    run.log({"line-series-multiple-x": line_series_chart})
```

この例では、各 y 時系列を、それぞれ固有の x 時系列に対してプロットします。
これにより、x 値がデータ時系列間で均一でない場合に、
より柔軟に対応できます。

`keys` を使用した線ラベルのカスタマイズ：

```python theme={"system"}
import wandb

# W&B run を初期化します
with wandb.init(project="line_series_example") as run:
    xs = list(range(10))  # 単一の x 配列
    ys = [
        [i for i in range(10)],  # y = x
        [i**2 for i in range(10)],  # y = x^2
        [i**3 for i in range(10)],  # y = x^3
    ]

    # 各線のカスタムラベル
    keys = ["Linear", "Quadratic", "Cubic"]

    # 折れ線チャートを生成してログします
    line_series_chart = wandb.plot.line_series(
        xs,
        ys,
        keys=keys,  # カスタムキー（線のラベル）
        title="Custom Line Labels Example",
        xname="Step",
    )
    run.log({"line-series-custom-keys": line_series_chart})
```

この例では、`keys` 引数を使用して線にカスタムラベルを指定する
方法を示します。キーは凡例に "線形"、
"二次"、"三次" と表示されます。
