ggtb

fun ggtb(): OptionsMap

Add a toolbar to a chart.

This function adds a toolbar containing three tool-buttons (pan, rubber-band zoom, and center-point zoom) to a chart. Each tool uses mouse-drag for its specific functionality. Additionally, the mouse wheel can be used for zooming in and out, regardless of the selected tool.

The toolbar includes:

  • Pan: Drag to move the plot.

  • Rubber-band zoom: Drag to define a rectangular area to zoom into.

  • Center-point zoom: Drag up or down to zoom in or out from a center point.

  • Reset button: Click to reset the plot and tools to their original state.

Double-clicking anywhere on the plot resets it to its original coordinates, regardless of whether a tool is selected or not.

Limitations:

  • The toolbar does not work with interactive maps.

  • The toolbar is not compatible with GGBunch.

  • The toolbar cannot be used with plots using a polar coordinate system.

Examples

Return

OptionsMap - toolbar feature specification.