Giter Site home page Giter Site logo

py-roughviz's Introduction

py-roughviz

This is the Python wrapper of the JaveScript Library RoughViz which you could use to visualize sketchy/hand-drawn styled charts. You could check out original JS libarary here: RoughViz

Implemented Charts

  • Bar
  • Barh
  • Pie
  • Line
  • Scatter
  • Donut

Before Use it

Please install the dependencies in order to use them, you could clone the repo, and simply do if you are using pip.

pip install -r requirements.txt

How to use it.

Due to design of original RoughViz, there are some restrictions on the format of input data. The detailed description can be found in the documentation.

To use the tool, you could either define all options during chart in the initialization, or to define the options later. And in order to make it easier to use, there are several options provided.

  1. You could define all options using set_options
  2. For common options shared across different charts, you could define it in a more intuitive way, e.g. set_title(title="The plot", fontsize=2), or set_xlabel("X Label", fontsize=3)

Examples

  • Example 1
from roughviz.charts.line import Line

line = Line(data="examples/example_datasets/vis1.csv", y1="a", y2="b", y3="c")
line.set_legend(legend_position="left")
line.set_title("Line Plot", fontsize=2)
line.set_options(colors=["tan", "orange", "coral"])

line.show()

Example 1

  • Example 2
from roughviz.charts.bar import Bar

data = {
    "labels": ["North", "South", "East", "West"],
    "values": [10, 5, 8, 3]
}

bar = Bar(data=data, title="Regions", title_fontsize=3)
bar.set_xlabel("Region", fontsize=2)
bar.set_ylabel("Number", fontsize=2)

bar.show()

Example 2

py-roughviz's People

Contributors

charlesdong1991 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.