C library GR


You can manually install prebuilt binaries for the GR runtime or install a Linux package.

Operating System Architecture  
macOS x86_64 gr-latest-Darwin-x86_64.tar.gz
Debian x86_64 gr-latest-Debian-x86_64.tar.gz
Ubuntu x86_64 gr-latest-Ubuntu-x86_64.tar.gz
CentOS 7 x86_64 gr-latest-CentOS-x86_64.tar.gz
CentOS 6 x86_64 gr-latest-Linux-x86_64.tar.gz
Windows x86_64 gr-latest-Windows-x86_64.tar.gz
Windows i686 gr-latest-Windows-i686.tar.gz

You may need to install some additional dependencies on Linux:

  • Debian/Ubuntu:
    apt install libxt6 libxrender1 libgl1-mesa-glx
  • CentOS 7:
    yum install libXt libXrender libXext mesa-libGL
  • Fedora 26:
    dnf install libXt libXrender libXext mesa-libGL
  • openSUSE 42.3:
    zypper install libXt6 libXrender1 libXext6 Mesa-libGL1

For other versions of GR, see the downloads. For information on building the GR runtime yourself, see the Building the GR Runtime.

Linux packages

Since GR v0.17.2 we provide python-gr .rpm and .deb packages for various Linux distributions using openSUSE Build Service. Your operating systems package manager will cope with package dependencies.

Please follow the installation instructions for your operating system described here.

Getting Started

After installing GR, you can try it out by creating a simple plot:

#include <stdio.h>
#include <gr.h>

int main(void) {
    double x[] = {0, 0.2, 0.4, 0.6, 0.8, 1.0};
    double y[] = {0.3, 0.5, 0.4, 0.2, 0.6, 0.7};
    gr_polyline(6, x, y);
    gr_axes(gr_tick(0, 1), gr_tick(0, 1), 0, 0, 1, 1, -0.01);
    // Press any key to exit
    return 0;


You can find several tutorials on using GR in the Tutorials section.

API Reference

The C API for GR consists of: