Giter Club home page Giter Club logo

gr.jl's Introduction

The GR module for Julia

The MIT License GitHub tag Build Status DOI Binder Join the chat at https://gitter.im/jheinen/GR.jl

Screenshots

This module provides a Julia interface to GR, a framework for visualisation applications.

Installation

From the Julia REPL an up to date version can be installed with:

Pkg.add("GR")

or in the Pkg REPL-mode:

add GR

The Julia package manager will download and install a pre-compiled run-time (for your hardware architecture), if the GR software is not already installed in the recommended locations.

Getting started

In Julia simply type using GR and begin calling functions in the GR framework API.

Let's start with a simple example. We generate 10,000 random numbers and create a histogram. The histogram function automatically chooses an appropriate number of bins to cover the range of values in x and show the shape of the underlying distribution.

using GR
histogram(randn(10000))

Using GR as backend for Plots.jl

Plots is a powerful wrapper around other Julia visualization "backends", where GR seems to be one of the favorite ones. To get an impression how complex visualizations may become easier with Plots, take a look at these examples.

Plots is great on its own, but the real power comes from the ecosystem surrounding it. You can find more information here.

Alternatives

Besides GR and Plots there is a nice package called GRUtils which provides a user-friendly interface to the low-level GR subsytem, but in a more "Julian" and modular style. Newcomers are recommended to use this package. A detailed documentation can be found here.

GR and GRUtils are currently still being developed in parallel - but there are plans to merge the two modules in the future.

Basic Troubleshooting

Due to conflicts with already installed GR installations or problems with the download, it can happen that the GR runtime environment is not found. Unfortunately, to classify the problem, one can only proceed step by step:

  1. The first troubleshooting step is to force GR to rebuild. This should reset GR to using GR_jll.

    ENV["JULIA_DEBUG"] = "GR" # Turn on debug statements    for the GR package
    ENV["GRDIR"] = "" # Force GR to rebuild from default settings
    import Pkg; Pkg.build("GR")
    using GR

    Check the generated build.log for errors.

  2. The second step is try binaries from GR tarballs which are provided directly by the GR developers as self-contained distributions for selected platforms - independent of the programming language

    ENV["JULIA_DEBUG"] = "GR" # Turn on debug statements for the GR package
    ENV["GRDIR"] = ""
    ENV["JULIA_GR_PROVIDER"] = "GR"
    # ENV["JULIA_GR_PROVIDER"] = "BinaryBuilder" # Alternatively, uncomment this
    import Pkg; Pkg.build("GR")
    using GR
  3. There might be an issue with GR_jll. Check if it can be loaded.

    import Pkg; Pkg.add("GR_jll")
    using GR_jll
    ccall( (:gr_initgr, "libGR",), Nothing, () )

    If none of these steps lead to success, please contact the developers.

gr.jl's People

Contributors

asinghvi17 avatar barche avatar cnliao avatar dalum avatar danielkaiser avatar eschnett avatar eugene avatar falobaid avatar florianrhiem avatar fonsp avatar fredrikekre avatar goropikari avatar heliosdrm avatar hessammehr avatar jheinen avatar joshday avatar juliatagbot avatar kojix2 avatar machakann avatar maltedeckers avatar mkitti avatar moelf avatar mpastell avatar mtsch avatar pfitzseb avatar thoappelsin avatar tkelman avatar tomaklutfu avatar v-i-s-h avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.