Skip to main content

Function: axisLogos()

axisLogos(axis, o): Markish

Defined in: packages/sdvplot/src/plot/axis.ts:59

Axis mark whose tick text is swapped for the team image; categories that do not resolve keep their text.

Parameters​

axis​

Axis

o​

AxisLogosOptions

Returns​

Markish

Example​

import * as Plot from "@observablehq/plot";
import { loadLeague } from "@sportsdataverse/sdvplot";
import { axisLogos } from "@sportsdataverse/sdvplot/plot";

await loadLeague("nfl");
const wins = [
{ team: "KC", wins: 15 },
{ team: "BUF", wins: 13 },
{ team: "LAC", wins: 11 },
];
Plot.plot({ marks: [Plot.barY(wins, { x: "team", y: "wins" }), axisLogos("x", { league: "nfl" })] });