Python library that makes it easy for data scientists to create charts.

Overview

Chartify

status release python CI

Chartify is a Python library that makes it easy for data scientists to create charts.

Why use Chartify?

  • Consistent input data format: Spend less time transforming data to get your charts to work. All plotting functions use a consistent tidy input data format.
  • Smart default styles: Create pretty charts with very little customization required.
  • Simple API: We've attempted to make the API as intuitive and easy to learn as possible.
  • Flexibility: Chartify is built on top of Bokeh, so if you do need more control you can always fall back on Bokeh's API.

Examples

https://raw.githubusercontent.com/spotify/chartify/master/docs/_static/chartify1.png

https://raw.githubusercontent.com/spotify/chartify/master/docs/_static/chartify2.png

https://raw.githubusercontent.com/spotify/chartify/master/docs/_static/chartify3.png

https://raw.githubusercontent.com/spotify/chartify/master/docs/_static/chartify4.png

https://raw.githubusercontent.com/spotify/chartify/master/docs/_static/chartify5.png

https://raw.githubusercontent.com/spotify/chartify/master/docs/_static/chartify6.png

See this notebook for more examples!.

Installation

  1. Chartify can be installed via pip:

pip3 install chartify

  1. Install chromedriver requirement (Optional. Needed for PNG output):
    • Install google chrome.
    • Download the appropriate version of chromedriver for your OS here.
    • Copy the executable file to a directory within your PATH.
      • View directorys in your PATH variable: echo $PATH
      • Copy chromedriver to the appropriate directory, e.g.: cp chromedriver /usr/local/bin

Getting started

This tutorial notebook is the best place to get started with a guided tour of the core concepts of Chartify.

From there, check out the example notebook for a list of all the available plots.

Docs

Documentation available on chartify.readthedocs.io

Getting support

Join #chartify on spotify-foss.slack.com (Get an invite)

Use the chartify tag on StackOverflow.

Code of Conduct

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

Contributing

See the contributing docs.

Comments
  • Improve docs with interactive tutorial

    Improve docs with interactive tutorial

    What this PR does / why we need it: Hey guys! I spent some time working on an "interactive" version of the Chartify tutorial notebook. We've created RMOTR Notebooks for our students, to help them get started.

    With this version, anybody can just start working on the tutorial immediately in just a couple of seconds.

    Special notes for your reviewer: I'm also working on the Chartify examples notebook, I'll update it as soon as it's done.

    Any feedback is greatly appreciated!

    Release note:

    NONE
    
    opened by matiascaputti 7
  • Bump Pandas requirement to 1.0.0

    Bump Pandas requirement to 1.0.0

    What this PR does / why we need it:

    Pandas 1.0 has been out for a few months, and seems stable enough that we should start supporting it!

    In addition, I noticed some inconsistencies between versions used in the package requirements itself, and in the requirements specified for local development. These have now been rectified (and future-proofed) by including the package requirements.txt from the dev one instead of specifying everything twice.

    Special notes for your reviewer:

    On my local setup (Windows with WSL) there are some problems with chromedriver that I haven't been able to figure out. Because of this, saving images as png doesn't work, and thus that test has been skipped when I've tested locally. I doubt that it would make a difference for this change, but might be worth double-checking in the PR builds.

    Release note:

    Bump Pandas requirement to 1.0
    
    opened by tomasaschan 6
  • Adding orders of magnitude to fractional values in plot_bar_stacked

    Adding orders of magnitude to fractional values in plot_bar_stacked

    Is this a BUG REPORT or FEATURE REQUEST?:

    Uncomment only one, leave it on its own line:

    type: bug

    type: feature

    Environment:

    • Chartify version(s): beta (pip install)
    • Operating System(s): Linux 4.19.3-300.fc29.x86_64 x86_64
    • Python version(s): 3.7

    What happened: I'm getting an extra two orders of magnitude (or more if I set a floating point on the tick value) for values with floating points in stacked bar charts.

    What you expected to happen: When setting the y axis tick values to '0%", I should get percentage values ranging from 0-100%.

    How to reproduce it (as minimally and precisely as possible): Plot all chromosome data using stacked bar plot

    RdGy = chartify.color_palettes['RdGy'] shifted_RdGy = RdGy.shift_palette('black', percent=20) shifted_RdGy.show()

    (chartify.Chart(blank_labels=True, x_axis_type='categorical') .style.set_color_palette('diverging', palette=shifted_RdGy) .plot.bar_stacked( data_frame=results, categorical_columns='#ID', categorical_order_by='labels', categorical_order_ascending=True, numeric_column='Covered_percent', stack_column='sample', normalize=False) .set_legend_location('outside_right', orientation='vertical') .axes.set_yaxis_tick_format('0.0%') .axes.set_xaxis_tick_orientation('vertical') .show('png'))

    Anything else we need to know?: Included the df and ipynb if you want to replicate. Allen_concatData.txt pileup.zip

    opened by magruca 6
  • Outside_bottom legend breaks with Bokeh 1.2

    Outside_bottom legend breaks with Bokeh 1.2

    Bokeh 1.2.0:

    /usr/local/lib/python3.6/dist-packages/confidence/analysis/base.py in _summary_plot(self, level_name, level_df, remaining_groups, groupby)
        233 
        234             ch = self._ordinal_summary_plot(level_name, level_df,
    --> 235                                             remaining_groups, groupby)
        236         else:
        237             ch = self._categorical_summary_plot(level_name, level_df,
    /usr/local/lib/python3.6/dist-packages/confidence/analysis/base.py in _ordinal_summary_plot(self, level_name, level_df, remaining_groups, groupby)
        249         return self._ordinal_plot('point_estimate', df, groupby, level_name,
        250                                   remaining_groups, absolute=True,
    --> 251                                   title=title, y_axis_label=y_axis_label)
        252 
        253     def _ordinal_plot(self, center_name, df, groupby, level_name,
    /usr/local/lib/python3.6/dist-packages/confidence/analysis/base.py in _ordinal_plot(self, center_name, df, groupby, level_name, remaining_groups, absolute, title, y_axis_label)
        278         ch.set_title(title)
        279         if colors:
    --> 280             ch.set_legend_location('outside_bottom')
        281         return ch
        282 
    /usr/local/lib/python3.6/dist-packages/chartify/_core/chart.py in set_legend_location(self, location, orientation)
        332                 self._subtitle_glyph.text)
        333         elif location == 'outside_bottom':
    --> 334             add_outside_legend('bottom_center', 'below')
        335         elif location == 'outside_right':
        336             add_outside_legend('top_left', 'right')
    /usr/local/lib/python3.6/dist-packages/chartify/_core/chart.py in add_outside_legend(legend_location, layout_location)
        320                 return self
        321             new_legend = self.figure.legend[0]
    --> 322             new_legend.plot = None
        323             new_legend.orientation = orientation
        324             self.figure.add_layout(new_legend, layout_location)
    /usr/local/lib/python3.6/dist-packages/bokeh/core/has_props.py in __setattr__(self, name, value)
        286 
        287             raise AttributeError("unexpected attribute '%s' to %s, %s attributes are %s" %
    --> 288                 (name, self.__class__.__name__, text, nice_join(matches)))
        289 
        290     def __str__(self):
    AttributeError: unexpected attribute 'plot' to Legend, possible ```
    good first issue 
    opened by cphalpert 5
  • ValueError: Bad 'legend' parameter value: None

    ValueError: Bad 'legend' parameter value: None

    Hi, I updated to the latest version of bokeh yesterday and get now this warning: `BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead

    followed by: ValueError: Bad 'legend' parameter value: None

    The issue seems to be related to the following section of the plot.py code 1397 if color_column: 1398 legend = bokeh.core.properties.field('color_column') 1399 else: 1400 legend = None

    Please could you tell me how to fix this. Thank you

    opened by jpkoc 4
  • Fixes #128

    Fixes #128

    What this PR does / why we need it:

    Which issue(s) this PR fixes

    Fixes #

    Special notes for your reviewer:

    Release note:

    
    
    opened by haf 2
  • Change bokeh version requirement

    Change bokeh version requirement

    Chartify doesn't work with bokeh 2.3.0, so require <2.3.0 for now, until a fix is in place.

    /Pelle

    What this PR does / why we need it:

    Which issue(s) this PR fixes

    Fixes #

    Special notes for your reviewer:

    Release note:

    
    
    opened by iampelle 2
  • Bokeh 2.0 is imminent

    Bokeh 2.0 is imminent

    Just a heads-up that Bokeh 2.0 will be coming out in the next week or so. At a minimum you may want to release packages that versions to <2.0 if they are not already. Whenever you look to update packages for Bokeh 2.0 compat we'd be happy to help over at the Development topic on the Discourse:

    https://discourse.bokeh.org/c/development/7

    opened by bryevdv 2
  • Calling Chart.plot.line method with all 0 y_column raises OverflowError

    Calling Chart.plot.line method with all 0 y_column raises OverflowError

    type: bug

    Environment:

    • Chartify version(s): 2.3.5
    • Operating System(s): MacOS 10.14.2
    • Python version(s): 3.6.5

    What happened: Calling line method with all 0 y_column raises OverflowError

    What you expected to happen: Return an instance of chart

    How to reproduce it (as minimally and precisely as possible):

    import chartify
    import pandas as pd
    
    df = pd.DataFrame(data={'col1': [1, 2, 3], 'col2': [0, 0, 0]})
    
    ch = chartify.Chart()
    ch.plot.line(data_frame=df,
                 x_column='col1',
                 y_column='col2')
    
    bug 
    opened by fabioconcina 2
  • Annotating the graph with horizontal and vertical lines

    Annotating the graph with horizontal and vertical lines

    Is this a BUG REPORT or FEATURE REQUEST?:

    type: feature

    Maybe this is already possible with Chartify and I missed it, but it would be great if Chartify provided an easy way to overlay/add horizontal and vertical lines (of different colors, different dash patterns) to a graph! e.g. to represent levels, or dates of specific events, on the graph.

    opened by troyshu 2
  • Feature: add (my)binder links for (tutorial and examples) notebooks

    Feature: add (my)binder links for (tutorial and examples) notebooks

    Is this a BUG REPORT or FEATURE REQUEST?:

    type: feature

    Anything else we need to know?:

    A tutorial using mybinder.org (like bokeh's tutorial) makes it much more convenient to test the library before installing it.

    opened by gdementen 2
  • Added image enhancement methods and changed to the show() method.

    Added image enhancement methods and changed to the show() method.

    What this PR does / why we need it: The new changes made on this branch are related to image enhancement, the image quality of the chartify is low when we copy the png to a different platform, as I started to work on this issue. This pull request is related to #37, and #86. I found out that bokeh has the same problem and they have the same alternative as we do, i.e., resizing. But they couldn't work on the dpi(dots per inch) functionality because of the lack of human resources and the technical difficulty they have to change something this huge. I didn't try to do something which bokeh ignored, but I came up with my alternative with the help of the PIL library. I used PIL to add some features to this file. Like colour enhancement, brightness, contrast, etc. The changes could be boiled down to type and filter methods. The type is enhancement classes implementing a common interface, containing a single method. As with filter, it is a pre-defined set of filters, which can be used with the Image.filter() method. I had to add --virtual-time-budget(set the system to wait the specified number of virtual milliseconds before deeming the page to be ready.) This is related to #27.

    Which issue(s) this PR fixes #37, #86, #27.

    opened by valleyofblackpanther 0
  • SECURITY.md

    SECURITY.md

    What this PR does / why we need it: We need a security policies measurement for the chartify package. I tried to add some which resonate with the values that I have seen as a contributor to it. I tried my best to align the security measures with chartify vulnerabilities that I could identify.

    Which issue(s) this PR fixes#132

    Fixes # Security policies

    Special notes for your reviewer: I guess there should be more points that certainly need to be on the document. If anyone has any points, create a patch or comment on the pull request.

    opened by valleyofblackpanther 0
  • Reopen

    Reopen "Update options.py (#133)"

    Reopens spotify/chartify#133

    After merging this into a release branch I realised it doesn't work and isn't trivial to fix. See this repo for inspiration on how to fix it: https://github.com/fmenabe/python-yamlordereddictloader

    opened by iampelle 0
  • cumulative histogram

    cumulative histogram

    FEATURE REQUEST:

    type: feature

    It would be great if you could add the cumulative option type to the histogram plot as there is in:

    https://plotly.com/python/histograms/#cumulative-histogram

    opened by xflc 0
  • Trying to get in touch regarding a security issue

    Trying to get in touch regarding a security issue

    Hey there!

    I'd like to report a security issue but cannot find contact instructions on your repository.

    If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

    Thank you for your consideration, and I look forward to hearing from you!

    (cc @huntr-helper)

    opened by zidingz 1
  • Doesn't plot with

    Doesn't plot with "html" in colab

    First: image

    Then note the empty output:

    image

    bug

    Environment:

    • Chartify version(s): latest
    • Operating System(s): macos
    • Python version(s): 3.8

    What happened: trying first example, in colab.research.google.com

    What you expected to happen: something to show

    How to reproduce it (as minimally and precisely as possible):

    Anything else we need to know?:

    opened by haf 0
Releases(3.0.5)
  • 3.0.5(Dec 13, 2022)

  • 3.0.4(Oct 18, 2022)

    This update is a maintanaince release with no new features and mainly behind the scenes updates:

    • Update github actions
    • Limit versions of bokeh, Jinja, and importlib-metadata to fix build error. This is only necessary for python 3.6 it seems.
    • Updated required versions of pytest and coverage
    • Update setup.py (#135)
    • Update options.py (#133)
    • Change ChromeDriver link to avoid deprecated site (#134)
    • Added test case and fix from PR #127
    • Eliminate a number of deprecation warnings
    • Add publish to PyPi workflow

    Co-authored-by: Anurag Kumar [email protected] Co-authored-by: Moad Akhraz [email protected] Co-authored-by: Damian [email protected] Co-authored-by: Damian [email protected]

    Source code(tar.gz)
    Source code(zip)
  • 3.0.3(Nov 2, 2020)

  • 3.0.2(Nov 2, 2020)

  • 3.0.1(Jun 2, 2020)

  • 3.0.0(May 29, 2020)

  • 2.7.0(Nov 27, 2019)

    Improvements:

    • Updated default yaml loader to move off of deprecated method (Thanks @vh920!)
    • Updated legend handling to adjust for deprecated methods in recent versions of Bokeh (Thanks for reporting @jpkoc)
    • Updated license in setup.py (Thanks for reporting @jsignell)
    • Bump base Pillow dependency to avoid insecure version.
    • Update MANIFEST to include missing files (Thanks @toddrme2178!)
    Source code(tar.gz)
    Source code(zip)
  • 2.6.1(Aug 15, 2019)

    Bugfixes:

    • Moved package requirements and fixed bug that occured with latest version of Bokeh (Thanks @emschuch & @mollymzhu!)
    • Fixed bug in README while generating docs (Thanks @Bharat123rox!)
    Source code(tar.gz)
    Source code(zip)
  • 2.6.0(Mar 8, 2019)

    Improvements:

    • Allows users to plot colors on bar charts that aren't contained in the categorical axis.

    Bugfixes:

    • Fixed bug that caused float types to break when plotted with categorical text plots (Thanks for finding @danela!)
    • Fixed broken readme links.
    Source code(tar.gz)
    Source code(zip)
  • 2.5.0(Feb 17, 2019)

  • 2.4.0(Feb 16, 2019)

    Improvements:

    • Added second Y axis plotting.
    • Removed Bokeh loading notification on import (Thanks @canavandl!)
    • Added support for custom Bokeh resource loading (Thanks @canavandl!)
    • Added example for Chart.save() method (Thanks @david30907d!)

    Bugfixes:

    • Updated documentation for saving and showing svgs.
    • Fixed bug that broke plots with no difference between min and max points. (Thanks for finding @fabioconcina!)
    Source code(tar.gz)
    Source code(zip)
  • 2.3.5(Nov 21, 2018)

    Improvements:

    • Updated docstrings (Thanks @gregorybchris @ItsPugle!)
    • Added SVG output options to Chart.show() and Chart.save() (Thanks for the suggestion @jdmendoza!)

    Bugfixes:

    • Fixed bug that caused source label to overlap with xaxis labels.
    • Fixed bug that prevented x axis orientation changes with datetime axes (Thanks for finding @simonwongwong!)
    • Fixed bug that caused subtitle to disappear with outside_top legend location (Thanks for finding @simonwongwong!)
    • Line segment callout properties will work correctly. (Thanks @gregorybchris!)
    Source code(tar.gz)
    Source code(zip)
  • 2.3.3(Oct 24, 2018)

  • 2.3.2(Oct 18, 2018)

    • Added scatter plots with a single categorical axis. image

    • Stacked bar and area order now matches default vertical legend order.

    • Added method for shifting color palettes.

    • Fixed bug with text_stacked that occurred with multiple categorical levels.

    Source code(tar.gz)
    Source code(zip)
  • 2.3.1(Sep 27, 2018)

  • 2.3.0(Sep 27, 2018)

    • Added hexbin plot type.
    • More control over grouped axis label orientation.
    • Added alpha control to scatter, line, and parallel plots.
    • Added control over marker style to scatter plot.
    • Added ability to create custom color palettes.
    • Changed default accent color.
    • Visual tweaks to lollipop plot.
    • Bar plots with a few number of series will have better widths.
    Source code(tar.gz)
    Source code(zip)
Owner
Spotify
Spotify
Simple and lightweight Spotify Overlay written in Python.

Simple Spotify Overlay This is a simple yet powerful Spotify Overlay. About I have been looking for something like this ever since I got Spotify. I th

27 Sep 03, 2022
A python script editor for napari based on PyQode.

napari-script-editor A python script editor for napari based on PyQode. This napari plugin was generated with Cookiecutter using with @napari's cookie

Robert Haase 9 Sep 20, 2022
A dashboard built using Plotly-Dash for interactive visualization of Dex-connected individuals across the country.

Dashboard For The DexConnect Platform of Dexterity Global Working prototype submission for internship at Dexterity Global Group. Dashboard for real ti

Yashasvi Misra 2 Jun 15, 2021
Library for exploring and validating machine learning data

TensorFlow Data Validation TensorFlow Data Validation (TFDV) is a library for exploring and validating machine learning data. It is designed to be hig

688 Jan 03, 2023
Python implementation of the Density Line Chart by Moritz & Fisher.

PyDLC - Density Line Charts with Python Python implementation of the Density Line Chart (Moritz & Fisher, 2018) to visualize large collections of time

Charles L. Bérubé 10 Jan 06, 2023
Keir&'s Visualizing Data on Life Expectancy

Keir's Visualizing Data on Life Expectancy Below is information on life expectancy in the United States from 1900-2017. You will also find information

9 Jun 06, 2022
matplotlib: plotting with Python

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Check out our home page for more inform

Matplotlib Developers 16.7k Jan 08, 2023
A small script written in Python3 that generates a visual representation of the Mandelbrot set.

Mandelbrot Set Generator A small script written in Python3 that generates a visual representation of the Mandelbrot set. Abstract The colors in the ou

1 Dec 28, 2021
Design your own matplotlib stylefile interactively

Tired of playing with font sizes and other matplotlib parameters every time you start a new project or write a new plotting function? Want all you plots have the same style? Use matplotlib configurat

yobi byte 207 Dec 08, 2022
Fastest Gephi's ForceAtlas2 graph layout algorithm implemented for Python and NetworkX

ForceAtlas2 for Python A port of Gephi's Force Atlas 2 layout algorithm to Python 2 and Python 3 (with a wrapper for NetworkX and igraph). This is the

Bhargav Chippada 227 Jan 05, 2023
A set of three functions, useful in geographical calculations of different sorts

GreatCircle A set of three functions, useful in geographical calculations of different sorts. Available for PHP, Python, Javascript and Ruby. Live dem

72 Sep 30, 2022
Pydrawer: The Python package for visualizing curves and linear transformations in a super simple way

pydrawer 📐 The Python package for visualizing curves and linear transformations in a super simple way. ✏️ Installation Install pydrawer package with

Dylan Tintenfich 56 Dec 30, 2022
Learning Convolutional Neural Networks with Interactive Visualization.

CNN Explainer An interactive visualization system designed to help non-experts learn about Convolutional Neural Networks (CNNs) For more information,

Polo Club of Data Science 6.3k Jan 01, 2023
A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews

hvPlot A high-level plotting API for the PyData ecosystem built on HoloViews. Build Status Coverage Latest dev release Latest release Docs What is it?

HoloViz 694 Jan 04, 2023
A collection of 100 Deep Learning images and visualizations

A collection of Deep Learning images and visualizations. The project has been developed by the AI Summer team and currently contains almost 100 images.

AI Summer 65 Sep 12, 2022
visualize_ML is a python package made to visualize some of the steps involved while dealing with a Machine Learning problem

visualize_ML visualize_ML is a python package made to visualize some of the steps involved while dealing with a Machine Learning problem. It is build

Ayush Singh 164 Dec 12, 2022
Altair extension for saving charts in a variety of formats.

Altair Saver This packge provides extensions to Altair for saving charts to a variety of output types. Supported output formats are: .json/.vl.json: V

Altair 85 Dec 09, 2022
SummVis is an interactive visualization tool for text summarization.

SummVis is an interactive visualization tool for analyzing abstractive summarization model outputs and datasets.

Robustness Gym 246 Dec 08, 2022
A small timeseries transformation API built on Flask and Pandas

#Mcflyin ###A timeseries transformation API built on Pandas and Flask This is a small demo of an API to do timeseries transformations built on Flask a

Rob Story 84 Mar 25, 2022
Easily convert matplotlib plots from Python into interactive Leaflet web maps.

mplleaflet mplleaflet is a Python library that converts a matplotlib plot into a webpage containing a pannable, zoomable Leaflet map. It can also embe

Jacob Wasserman 502 Dec 28, 2022