Plotting FinBIF data

William K. Morris

Visualisation is an important part of data exploration and analysis. The {finbif} package has a few functions and methods that can be used to visualise occurrence data from FinBIF.

Occurrence points

The default plot() method for the result of a call to finbif_occurrence() will display (if available) coordinates of the occurrence points in a scatter-plot.

recent_obs <- finbif_occurrence(filter = c(country = "Finland"), n = 1000)

Occurrence density

When you have many points to visualise it may be beneficial to display them in a 2-dimensional histogram with the density of points indicated by the shading or colour of filled grid-cells. The following outlines how this can be achieved using some tools provided by {finbif}.


First you’ll need to acquire some occurrence records. For example, you can use the following to get the latitude and longitude of all the Finnish records of Eurasian Jays where the coordinate uncertainty is less then 100m1.


Now you will need to define the break points of the grid cells over which to plot the density of occurrence records.

The {finbif} package has an inbuilt Finland map object which includes its bounding box.

You can use the function breaks_xy in combination with map bounding box to compute break points that a quarter of a degree in both dimensions.

2d histogram

The function hist_xy can be used compute the density of occurrences in the grid-cells defined by a set of break points.


The function image() creates a grid of colored rectangles with colors corresponding to the density of occurrence records. You can use its arguments to control properties of the plot such as the aspect ratio2, the breaks3, the color palette, the axis labels and grid lines.


You can add a plot legend to indicate how the image breakpoints are mapped to the image colors.


Finally, you can use {finbif}’s internal map to add the border of Finland to your plot.

  1. Or the coordinate uncertainty has not been specified.

  2. An aspect ratio of 2.4 minimizes the distortion of displaying Finland in a unprojected coordinate system.

  3. Note that this is different from the break points for the grid cells. This breaks argument defines the break points for the grid cell colors.