Skip to content

Challenge - Plot Multiple Layers of Spatial Data has some surprising additions in the answer #511

Description

@sstevens2

How could the content be improved?

There are some pieces of this that we aren't sure what they do and they kinda pop up with no explanation. This one has these named vectors that we haven't learned about our used before. It is unclear exactly what they are doing but it seems like they are mapping some values? for example the use of aes(color ="color") and then values = c("color" = "gray18")) and the same with shape. Also unclear what the theme adds here.

I suggest adding a callout that describes how this use of named vectors works in ggplot and then what the theme is supposed to do (if anything).

ggplot() +
    geom_sf(data = ne_states_outline, aes(color ="color"),
            show.legend = "line") +
    scale_color_manual(name = "", labels = "State Boundary",
                       values = c("color" = "gray18")) +
    geom_sf(data = point_harv, aes(shape = "shape"), color = "purple") +
    scale_shape_manual(name = "", labels = "Fisher Tower",
                       values = c("shape" = 19)) +
    ggtitle("Fisher Tower location") +
    theme(legend.background = element_rect(color = NA)) +
    coord_sf()

Which part of the content does your suggestion apply to?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions