dummy-link

Hinton

Hinton diagram generation.

Readme

0.5 status 0.6 status Build status Coverage status

Hinton is a small Julia library for generating Hinton diagrams. It supports standard graphics formats such as PNG, SVG, and PDF, as well as generating diagrams in a terminal with Unicode and colour support.

Installation

To install Hinton and its dependencies, simply type the following into the Julia REPL:

    Pkg.add("Hinton")

Usage

Hinton diagrams are commonly used to analyse the relative values of matrices. The diagram consists of rectangles whose area corresponds to the magnitude of the given element. White/black rectangles correspond to positive/negative values respectively. This visualisation makes it possible to gain an intuition about the matrix structure at a glance.

To demonstrate, we will generate a random matrix and visualise it.

    srand(0x4711) # Fix the random seed.
    w = eye(17, 17) + randn(17, 17)

First, we generate a terminal-friendly text-only version:

    using Hinton
    println(hintontxt(w))

An example Hinton diagram plotted in a terminal.

While the text-only version is good for quick analysis, it is hardly of "publication quality". Thus, there is also a vector graphics version that draws upon Compose:

    using Hinton
    draw(SVG("example_vec.svg", 256px, 256px), hintonvec(w))

An example Hinton diagram using vector graphics.

First Commit

12/27/2014

Last Touched

3 months ago

Commits

15 commits

Used By: