Giter Site home page Giter Site logo

plot's Introduction

Gonum Plot

Build status Build status codecov.io coveralls.io GoDoc go.dev reference

gonum/plot is the new, official fork of code.google.com/p/plotinum. It provides an API for building and drawing plots in Go. Note that this new API is still in flux and may change. See the wiki for some example plots.

For additional Plotters, see the Community Plotters Wiki page.

There is a discussion list on Google Groups: [email protected].

gonum/plot is split into a few packages:

  • The plot package provides simple interface for laying out a plot and provides primitives for drawing to it.
  • The plotter package provides a standard set of Plotters which use the primitives provided by the plot package for drawing lines, scatter plots, box plots, error bars, etc. to a plot. You do not need to use the plotter package to make use of gonum/plot, however: see the wiki for a tutorial on making your own custom plotters.
  • The plotutil package contains a few routines that allow some common plot types to be made very easily. This package is quite new so it is not as well tested as the others and it is bound to change.
  • The vg package provides a generic vector graphics API that sits on top of other vector graphics back-ends such as a custom EPS back-end, draw2d, SVGo, X-Window, gopdf, and Gio.

Documentation

Documentation is available at:

https://godoc.org/gonum.org/v1/plot

Installation

You can get gonum/plot using go get:

go get gonum.org/v1/plot/...

If you write a cool plotter that you think others may be interested in using, please post to the list so that we can link to it in the gonum/plot wiki or possibly integrate it into the plotter package.

plot's People

Contributors

bnoon avatar btracey avatar campoy avatar chmike avatar ctessum avatar decibelcooper avatar deleplace avatar dirkmueller avatar eaburns avatar egurnov avatar fawick avatar fhs avatar hollingberry avatar igrmk avatar jonas-schulze avatar jonlawlor avatar kortschak avatar kostya-sh avatar mccoyst avatar npotts avatar rogerwelin avatar sbinet avatar scorpiokat avatar skiesel avatar sosiska avatar stellentus avatar szaydel avatar vladimir-ch avatar whereswaldon avatar ylz-at avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plot's Issues

Legends

Original issue 14 created by eaburns on 2012-06-05T19:38:30.000Z:

You cannot add legends to a plot yet.

plot: make GlyphBox support plot area-dependent sized glyphs

At the moment, a plot.GlyphBox represents a zero-sized point in the data space surrounded by an pair of offsets in the plot space. There is no way to represent the extent of glyphs that have a size dependent on the size of the plot.

This is due to the fact that the GlyphBoxes method is not passed any information regarding the plot area.

This can be fixed by adding a second pair of normalised x,y coordinates.

type GlyphBox struct {
    // The glyph location in normalized coordinates.
    MinX, MinY float64
    MaxX, MaxY float64

    // Rect is the offset of the glyph's minimum drawing
    // point relative to the glyph location and its size.
    Rect
}

The details of types etc need to be fleshed out.

Rethink Palette/Contour/Heatmap interface

Palettes specify a list of colors. Strictly this is always a specific list, though may of the implemented palettes can create a long list of colors. These are being used at present to choose colors as part of Heatmaps and contours. In these cases, the z-axis values can be a real number, and a sort of interpolation function is being used to get the specific palette color. There are some special cases introduced, for example OverflowColor, which allow warning of specific colors.

In my mind, it's much better instead to have

// ColorFunc associates each float64 value with a color.Color
type ColorFunc func(float64) color.Color

A ColorFunc could use a palette as its underlying color choice. It could use a "threshholded palette", where it uses a palette for some intermediate range and uses warning colors outside of that range. There are many other possible uses, for example, returning a third warning color when the value is NaN, or having a grayscale image with a specific range of float64 returned as red to highlight their locations. It's much more powerful to have a function rather than just a palette with linear indexing, it's more composable because the special cases are located with the choice of color and not the choice of plotter, and (to me at least) it's more conceptually aligned with what's happening.

Return errors

Original issue 32 created by eaburns on 2012-06-19T17:01:59.000Z:

makeAxis, NewLegend, anything making a font should return an error instead of panicing.

Labels

Original issue 40 created by eaburns on 2012-06-21T15:27:52.000Z:

You should be able to add labels to the plot at x,y locations.

Plotting functions

Original issue 36 created by eaburns on 2012-06-20T16:40:03.000Z:

You should be able to plot func(float64)float64 with a line style, sampled at some number of points along the range of the X axis.

Plot data

Original issue 13 created by eaburns on 2012-06-05T19:37:21.000Z:

Currently you can't plot any data!

SVG

Original issue 4 created by eaburns on 2012-05-23T12:03:27.000Z:

vecsvg should be an SVG implementation of vecgfx.

Examples

Original issue 28 created by eaburns on 2012-06-15T15:38:54.000Z:

There should be some example code for building plots.

plotter: add Thumbnail method to HeatMap

A heatmap needs a colour scale in the legend. This means HeatMap needs to satisfy plot.Thumbnailer. There may be additional requirements, but this is the first step.

Multi-line text.

Original issue 12 created by eaburns on 2012-06-05T19:36:38.000Z:

Currently you cannot have multi-line text (plot title, axis label, and tick-labels; the latter is the most important). There should probably be a new Text object that handles multiple lines of text for which you can compute the various extents of the entire block.

This also requires thought about drawing the text centered, left, and right aligned and possibly justified, ick!

Better default ticks

Original issue 16 created by eaburns on 2012-06-11T20:35:11.000Z:

Figure out a good tick placement. We want no fewer than 3 major ticks.

GlyphStyle needs to be re-designed

Original issue 22 created by eaburns on 2012-06-13T20:08:37.000Z:

There is information (such as line width and font name) that is currently not configurable. Maybe GlyphStyle should be an interface?

PDF

Original issue 3 created by eaburns on 2012-05-23T12:03:06.000Z:

vecpdf should be a PDF implementation of vecgfx.

Bar charts

Original issue 35 created by eaburns on 2012-06-20T16:31:20.000Z:

You should be able to make bar charts.

Un-comment vecimg

Original issue 42 created by eaburns on 2012-07-28T01:25:50.000Z:

draw2d is broken with the latest freetype-go changes, thus vecimg doesn't compile and is commented out in the examples.

Better handling of lengths.

Original issue 8 created by eaburns on 2012-06-04T17:55:31.000Z:

Currently everything is just a float64 and I keep forgetting various unit conversions. There should probably be a size type to prevent all of this.

Plot background color

Original issue 39 created by eaburns on 2012-06-21T12:22:19.000Z:

Currently plots always have a white background. We should allow this to be specified, and we should allow for no background color too.

Encapsulated postscript

Original issue 2 created by eaburns on 2012-05-23T12:02:43.000Z:

veceps should be an encapsulated postscript implementation of vecgfx.

Histograms

Original issue 34 created by eaburns on 2012-06-20T16:30:56.000Z:

Should be able plot histograms.

Change number of ticks based on plot size

Original issue 38 created by eaburns on 2012-06-21T12:20:38.000Z:

It's nice to have the number of tick marks computed by DefaultTicks change based on the size of the plot.

SPT (code.google.com/p/caml-spt) uses 1 major tick every 4cm, but no fewer than 2 major ticks, as its hint for how many ticks to attempt. IMGO, SPT sometimes uses too few ticks. Maybe 1 tick every 4cm, but no fewer than 3 would be good for Plotinum.

Error bars

Original issue 33 created by eaburns on 2012-06-20T16:30:27.000Z:

You should be able to add error bars to a plot.

Figure out what to export.

Original issue 6 created by eaburns on 2012-06-04T16:51:46.000Z:

For example, all of the drawing functions, GlyphBox, and possibly more do not need to be exported. The trade-off is allowing 3rd party extend-ability (a 3rd party package could implement a new plot element type) versus simplifying the visible portion of the plt interface.

Draw ticks so they join nicely with the axis

Original issue 20 created by eaburns on 2012-06-13T19:34:47.000Z:

Currently, if ticks are drawn on the end of the axis then it doesn't make a nice 90 degree corner, instead you can see a wedge where they don't join correctly. The way to fix this is to draw ticks Axis.Width/2 longer so they go right to the top of the axis line.

Drawing clipped polygons

Original issue 30 created by eaburns on 2012-06-17T16:43:01.000Z:

Boxplots should be drawn as polygons instead of lines, barcharts will want to be polygons too. Also polygons would allow shading beneath or above lines.

Actual tests

Original issue 29 created by eaburns on 2012-06-15T15:39:34.000Z:

Currently, the tests don't really test anything. They are just used as a convenient way to look at sample plots as I code. There should be some actual tests.

Fix axis squishing.

Original issue 19 created by eaburns on 2012-06-12T19:53:15.000Z:

Instead of computing glyphBoxes for the top-most or right-most tick of the axes, the plot should figure out the squishing based on a bunch of things, including the existence of and size of title text and also the axis padding.

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.