Skip to content

Code style in examples hard to read in reference docs #4092

Closed
@rjake

Description

@rjake

Really minor but the code could be easier to read in some of the examples.

In the sec_axis() example it looks ok if I copy and paste the code but in the help menu and the ref docs, it's hard to see where the parentheses start and end and the piping of the plot elements

When copied, it's easier to read:

ggplot(df, aes(x = dx, y = price)) + geom_line() +
  scale_x_datetime("Date", date_labels = "%b %d",
                   date_breaks = "6 hour",
                   sec.axis = dup_axis(name = "Time of Day",
                                       labels = scales::time_format("%I %p")))

I'd like for it to look like this:

ggplot(df, aes(x = dx, y = price)) +
  geom_line() +
  scale_x_datetime(
    name = "Date",
    date_labels = "%b %d",
    date_breaks = "6 hour",
    sec.axis = dup_axis(
      name = "Time of Day",
      labels = scales::time_format("%I %p")
    )
  )

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