> ## 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">function</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 값의 시퀀스입니다. 각 iterable은 별도의 선 시리즈를 나타냅니다.
</ResponseField>

<ResponseField name="keys" type="Iterable[str] | None">
  각 선 시리즈에 레이블을 지정하기 위한 키의 시퀀스입니다. 제공되지 않으면 키가 "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에서 table을 별도의 섹션으로 분할할지 여부입니다. `True`인 경우 table이 "Custom Chart Tables"라는 섹션에 표시됩니다. 기본값은 `False`입니다.
</ResponseField>

<h2 id="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})
```

이 예제에서는 모든 `ys` 시리즈에 하나의 `xs` 시리즈(공유 x값)를 사용합니다.
따라서 각 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)],  # 첫 번째 시리즈의 x
        [2 * i for i in range(10)],  # 두 번째 시리즈의 x (간격 확대)
        [3 * i for i in range(10)],  # 세 번째 시리즈의 x (간격 더 확대)
    ]

    # 각 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` 인수를 사용하여 선에 맞춤형 레이블을 지정하는 방법을 보여줍니다.
범례에는 키가 "Linear",
"Quadratic", "Cubic"으로 표시됩니다.


## Related topics

- [Custom Charts 개요](/ko/products/wandb/ref/python/custom-charts.md)
