# Getting started

Start the device:

    library(httpgd)
    hgd()

Open the displayed URL in a browser, or call `hgd_browse()` to open one automatically.

Any plotting code will work:

    x <- seq(0, 3 * pi, by = 0.1)
    plot(x, sin(x), type = "l")

    library(ggplot2)
    ggplot(mpg, aes(displ, hwy, colour = class)) +
      geom_point()

Close the device when done:

    dev.off()

## Keyboard shortcuts

Keys | Result
--- | ---
`←` `→` `↑` `↓` | Navigate plot history.
`+` / `-` | Zoom in and out.
`0` | Reset zoom level.
`N` | Jump to the newest plot.
`del` / `D` | Delete plot.
`alt`+`D` | Clear all plots.
`S` | Download plot as SVG.
`P` | Download plot as PNG.
`C` | Copy plot to clipboard (as PNG).
`H` | Toggle plot history (sidebar).

For more on rendering and output formats, see the `unigd` plotting guide.