plot_Macao_SAR_flag: Draw the Regional Flag of the Macao Special Administrative...

View source: R/plot_region_flag.R

plot_Macao_SAR_flagR Documentation

Draw the Regional Flag of the Macao Special Administrative Region

Description

Constructs the flag of the Macao Special Administrative Region of the People's Republic of China entirely from analytic geometry and renders it as a ggplot2 object. The emblem is assembled from three components, each derived from the specification by computing every construction point (circle intersections, line intersections, and rotation angles): a white lotus flower of three petals, a cluster of five yellow five-pointed stars, and a stylised white bridge with water below. The central petal is constructed explicitly and the two lateral petals follow by mirroring across the vertical axis; the star cluster is positioned by rotating a base location about the lotus anchor point.

Usage

plot_Macao_SAR_flag(label = TRUE)

Arguments

label

Logical scalar. If TRUE (the default), the plot is annotated with a title and axis captions identifying the standard and drawing reference. If FALSE, all text annotations are suppressed, yielding a bare flag suitable for embedding or export.

Details

The geometry follows the Chinese national standard GB 17654-1999. The lotus is bounded by a sequence of circular arcs drawn on numerous distinct construction circles (centres O2-O12, radii such as 649/2, 260/2, and 763/2); each arc is sampled into a dense polyline (400 points by default) so that geom_polygon can fill the enclosed region. At this sampling density the chordal deviation from the true arc is several orders of magnitude below any practical display or print resolution.

The five stars comprise one larger central star flanked by two pairs of smaller stars, all seated on an arc of fixed radius about the emblem anchor O1 at angular offsets of \pm 35^{\circ} and \pm 65^{\circ}. The bridge and water are rendered as five white bands beneath the lotus, each band bounded above and below by arcs of the field's large construction circles and mirrored across the vertical axis.

All construction is performed in a local coordinate system anchored near the emblem base (O1 centred at (0, 38)). The green field is a fixed rectangle spanning \pm 1440 horizontally and \pm 960 vertically, giving a 3:2 width-to-height ratio. The field colour is derived from the spot colour Pantone 355 C (hex #007A4D); the lotus and bridge are white and the stars are yellow (#ffff00). The function is self-contained: it defines its own geometric helpers internally and depends only on ggplot2 for rendering and showtext for CJK glyph support.

Value

A ggplot object. The object can be printed, further modified with additional ggplot2 layers, or written to disk with ggsave.

Rendering notes

Correct display of the Chinese title and caption requires a font providing CJK glyphs. The function calls showtext_auto, but the user must register a suitable font beforehand, for example via font_add or font_add_google. Without a registered CJK font the non-ASCII labels may render as blank boxes.

The plot uses coord_fixed to enforce a 1:1 aspect ratio; altering the coordinate system will distort the circular arcs.

References

GB 17654-1999. Regional flag of the Macao Special Administrative Region of the People's Republic of China. Standardization Administration of China.

See Also

ggplot, ggsave, plot_HK_SAR_flag

Examples


# Register a CJK font before plotting annotated output
if (requireNamespace("sysfonts", quietly = TRUE)) {
  sysfonts::font_add_google("Noto Sans SC", "notosans")
  showtext::showtext_auto()
}

# Annotated flag
plot_Macao_SAR_flag()

# Bare flag, no text
plot_Macao_SAR_flag(label = FALSE)




ggChinaFlag documentation built on Oct. 1, 2026, 5:11 p.m.