Skip to content

Request for Info: Is it possible to plot only a portion of an ellipse? #337

@espinielli

Description

@espinielli

I am wondering whether it is possible to plot only part of an ellipse in geom_ellipse(), say from angle alpha to angle beta.
For example I would like to plot only the front part of an ellipse (think of the circle as the Earth, and the black ellipse as the Equator and the red ellipse ad a satellite) from the following code/plot:

ggplot() +
  geom_circle(aes(x0 = 0, y0 = 0, r = 1), fill ="white", alpha = 1) +
  geom_ellipse(aes(x0 = 0, y0 = 0, a = 1.0, b = 0.1, angle = 0), colour = "black") +
  geom_ellipse(aes(x0 = 0, y0 = 0, a = 1.05, b = 0.1, angle = pi / 6), colour = "red") +
  coord_fixed() +
  theme_void()

Image

Any helps much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions