Coder Social home page Coder Social logo

pydygraphs's Introduction

PyDyGraphs

An interactive charting library using Dygraphs for the Jupyter Notebook.

Intent

The Jupyter Notebook is an excellent tool for interacting with python and displaying data in real time. While tools like matplotlib can generate static plots in the Jupyter Notebook, interactive javascript plots are often more useful for exploring the data. This module can be readily included in an Jupyter Notebook and then used to generate beautiful time series plots with Dygraphs.

Screenshots

Simple Example SinglePlot

Subplot with Range Selector RangeSelector

Pandas Dataframe Plot Dataframe

How It Works

This python module generates javascript that interacts with the Dygraphs library, and passes it to the Jupyter Notebook kernel for execution.

Currently the PyDyGraphs module depends on Pandas to generate a JSON representation of the data for plotting. This required dependancy may be removed with future work. Pandas can be installed via pip.

Example

Run the included example:examples/PyDyGraphTester.ipynb, or paste this code into an Jupyter Notebook to generate an interactive timeseries plot:

# Import pydygraphs and numpy
import dygraphs.graph as dy
import numpy as np

# Create a figure
fig = dy.figure(width = 600, height = 400)

# Generate data for the plot
x = np.array(range(100))
y = [np.sin(np.random.rand(100)),-np.sin(np.random.rand(100))]

# Plot the data on the figure
fig.plot(x,y, color=['navy','magenta'])
fig.title("Figure 1")
fig.xlabel('Series')
fig.ylabel('Value')

# Show the figure in this cell of the notebook
fig.show()

Installation:

Simply clone this repository and include the dygraphs.graph module in your Jupyter Notebooks. Note: PyDyGraphs only supports Python 3.

Want to contribute:

Please submit a pull request or issue with any questions you might have!

pydygraphs's People

Contributors

dinkelk avatar janga1997 avatar zachdischner avatar bt- avatar baolinliu avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  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.