Skip to content

Replace stat_function() with geom_function() and fix override.aes size for line legends #449

@ishaan-arora-1

Description

@ishaan-arora-1

A few remaining ggplot2 modernization items I found while working on the other deprecation fixes:

1. overlay_function() wraps stat_function()

overlay_function() in bayesplot-helpers.R is a thin wrapper around ggplot2::stat_function(). Since ggplot2 3.3.0, geom_function() is the recommended replacement. The switch is straightforward since overlay_function() just passes ... through.

2. override.aes = list(size = ...) for line-based legends

R/mcmc-traces.R (line ~722) uses size in override.aes for a linetype legend key, where linewidth is the correct aesthetic since ggplot2 3.4.0.

(The similar case in ppd-distributions.R is already covered by #430.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions