Code Monkey home page Code Monkey logo

cassius's Introduction

cassius

Cassius is a plotting toolset for the Augustus statistical modeling package.

The front-end (user) interface is designed to be intuitive: common tasks should be easy and all tasks should be possible. It follows the brief syntactical style of Python and, unlike many plotting toolkits, does not depend on a global state that would make copying script segments unreliable.

The back-end (graphical output) interface is designed to be flexible: the primary output format is scalable SVG, which can be converted to a broad range of vector and raster formats, but other form

from cassius import *

# load the data
dataset = inspect("wiki_Frontpage_dataset.csv")

# take a quick look at it, to get familiar with the fields
dataset.scan()

# top_plot
timeseriesX = dataset.timeseries("tx,x", linecolor="blue",
                                 informat="%m/%d/%Y-%H:%M:%S", outformat="%b %d")
timeseriesX.xlabel = None
timeseriesX.ylabel = "x or y"

timeseriesY = dataset.timeseries("ty,y", ey="ey", limit=200, informat="%m/%d/%Y-%H:%M:%S")
curveY = Curve("10*cos(x * 2*pi/(60*60*24*7)) + 30", linecolor="red")

legend = Legend([["timeseriesX", timeseriesX],
                 ["timeseriesY", timeseriesY],
                 ["curveY", curveY]],
                justify="cc", width=0.3, colwid=[0.7, 0.3], x=0., y=1., anchor="tl")

top_plot = Overlay(timeseriesX, timeseriesY, curveY, legend, frame=0)

# bottom_left_plot
categoricalHist = dataset.histogram("category", fillcolor="yellow",
                                    leftmargin=0.23, bottommargin=0.17, xlabeloffset=0.17)

bottom_left_plot = Overlay(Grid(horiz=regular(200.)), categoricalHist, frame=-1)

# bottom_right_plot
histX = dataset.histogram("x", numbins=100, lowhigh=(15, 45), fillcolor=RGB("blue", opacity=0.5),
                          ymax=600., rightmargin=0.1, bottommargin=0.17, xlabeloffset=0.17)
histX.xlabel = "x or y"

histY = dataset.histogram("y", numbins=100, lowhigh=(15, 45), fillcolor=lighten("red"))

legend2 = Legend([[None, None, "mean"],
                  [histX, "histX", str_sigfigs(histX.mean(), 3)],
                  [histY, "histY", str_sigfigs(histY.mean(), 3)]],
                 justify="ccr", width=0.6, colwid=[0.3, 0.4, 0.3])

bottom_right_plot = Overlay(histY, histX, legend2, frame=1)

# combining everything into one image
everything = Layout(2, 1, top_plot, Layout(1, 2, bottom_left_plot, bottom_right_plot))

# view(everything)
draw(everything, fileName="wiki_Frontpage_output.svg")

cassius's People

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.