src/beanmachine/tutorials/utils/baseball.py [253:292]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    whiskers = Whisker(
        base="x",
        upper="upper_hdi",
        lower="lower_hdi",
        source=source,
        line_color="steelblue",
    )
    whiskers.upper_head.line_color = "steelblue"
    whiskers.lower_head.line_color = "steelblue"
    plot.add_layout(whiskers)

    # Create the player's at-bat hit chance for the complete-pooling model.
    glyph = plot.circle(
        x="x",
        y="y",
        source=source,
        size=10,
        line_color="white",
        fill_color="steelblue",
        legend_label="Players",
    )
    tooltips = HoverTool(
        renderers=[glyph],
        tooltips=[
            ("Name", "@name"),
            ("Posterior Upper HDI", "@upper_hdi{0.000}"),
            ("Posterior Mean", "@y{0.000}"),
            ("Posterior Lower HDI", "@lower_hdi{0.000}"),
        ],
    )
    plot.add_tools(tooltips)

    # Add a legend to the figure.
    plot.legend.location = "top_left"
    plot.legend.click_policy = "mute"

    # Style the figure.
    plots.style(plot)

    return plot
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/beanmachine/tutorials/utils/baseball.py [492:531]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    whiskers = Whisker(
        base="x",
        upper="upper_hdi",
        lower="lower_hdi",
        source=source,
        line_color="steelblue",
    )
    whiskers.upper_head.line_color = "steelblue"
    whiskers.lower_head.line_color = "steelblue"
    plot.add_layout(whiskers)

    # Add the modeled player at-bat hit chance to the figure.
    glyph = plot.circle(
        x="x",
        y="y",
        source=source,
        size=10,
        line_color="white",
        fill_color="steelblue",
        legend_label="Players",
    )
    tooltips = HoverTool(
        renderers=[glyph],
        tooltips=[
            ("Name", "@name"),
            ("Posterior Upper HDI", "@upper_hdi{0.000}"),
            ("Posterior Mean", "@y{0.000}"),
            ("Posterior Lower HDI", "@lower_hdi{0.000}"),
        ],
    )
    plot.add_tools(tooltips)

    # Add a legend to the figure.
    plot.legend.location = "top_left"
    plot.legend.click_policy = "mute"

    # Style the figure.
    plots.style(plot)

    return plot
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



