Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Php Code Coverage | 8,543 | 105,831 | 1,161 | a day ago | 149 | August 30, 2022 | 22 | bsd-3-clause | PHP | |
Library that provides collection, processing, and rendering functionality for PHP code coverage information. | ||||||||||
Vivagraphjs | 3,473 | 31 | 8 | a year ago | 29 | October 27, 2019 | 101 | other | JavaScript | |
Graph drawing library for JavaScript | ||||||||||
Resvg | 1,922 | 9 | 66 | 2 days ago | 28 | June 11, 2022 | 74 | mpl-2.0 | Rust | |
An SVG rendering library. | ||||||||||
Pdfviewpager | 1,463 | 2 years ago | 33 | apache-2.0 | Java | |||||
Android widget that can render PDF documents stored on SD card, linked as assets, or downloaded from a remote URL. | ||||||||||
Rend3 | 757 | 9 | 7 days ago | 14 | February 12, 2022 | 45 | apache-2.0 | Rust | ||
Easy to use, customizable, efficient 3D renderer library built on wgpu. | ||||||||||
Pyray | 701 | 1 | a month ago | 3 | August 11, 2019 | 1 | mit | Python | ||
A 3d rendering library written completely in python. | ||||||||||
Ascii_art | 653 | 6 months ago | gpl-2.0 | C | ||||||
Real-Time ASCII Art Rendering Library | ||||||||||
Uaal Example | 451 | 8 months ago | 39 | other | Objective-C++ | |||||
Fbg | 436 | 10 months ago | 4 | bsd-3-clause | C | |||||
Lightweight C 2D graphics API agnostic library with parallelism support | ||||||||||
Ascii Morph | 425 | 3 years ago | mit | JavaScript | ||||||
Library to animate between two ascii images - |
This is a library for creating plots in python that is guided by the following principles:
a+b+c
, literally.a
, b
and c
, the operation a+b+c
overlays the plots on top of each other.p
, we can render it using matplotlib or plotly as follows:
p.plot()
to display using the default engine (matplotlib)p.plot("mpl")
to display using matplotlibp.plot("ply")
to display using plotlysin
or cos
or any other math functions easily, in order to get an intuition of what they do. Ideally it should be done by just writing a math formula in text, without having to manually create your own x and y arrays using math libraries.funcplot("exp(x)/(1+exp(x))")
Read the white paper for more information about the ambitions of this project.
pip install -e git+https://github.com/ronrest/graphotti.git#egg=graphotti
import graphotti as gh
You can also import the following depending on whether you want to render the plots using matplotlib, or plotly.
# For rendering using plotly engine within a jupyter notebook
from plotly.offline import init_notebook_mode
init_notebook_mode(connected=True)
# For rendering using matplotlib engine within a jupyter notebook
%matplotlib inline
Creating a lineplot is as simple as:
a = gh.line([7,8,9,8,6])
a.plot()
You can use the +
and -
operators to overlay plots on top of each other.
+
makes the plots share the same y axis-
makes the plots on the right hand side of the operator use its own independent y axisIn the following example, three plots are created, overlayed on top of each other, and all sharing the same y axis.
from plot import lineplot
a = gh.line([7,8,9,8,6])
b = gh.line([2,1,3,2])
c = gh.line([11,15,10,9,5])
overlay = a+b+c
overlay.plot()
In the following example, the three plots are overlayed but the final plot uses its own independent y axis.
overlay = a+b-c
overlay.plot()
You can also overlay plots of different types, eg, below we overlay a lineplot, a step plot, and a scatterplot all on top of each other.
s = gh.step(x= [1,4,5,6,7,9], y=[0,1,0,1,2,0], name="step plot")
l = gh.line(x= [0,3,6,7,8,9], y=[1,2,4,1,2,4], name="line plot")
c = gh.scatter([3,8,2,6,2,4], [4,3,3,2,1,6], labels=["a","b","c","d","e","f"], name="scatter plot")
overlayed = (l+s+c)
overlayed.plot(title="Multiple plot types overlayed")
Just like you can slice lists, and arrays to get a subset of the data, you can take a slice of a plot object to get a segment of the plot. This is useful if you want to zoom in and focus on a small region of the plot.
EXAMPLE:
a = gh.line([5,7,8,8,7,5,2,5,6,5,4,2,3])
b = gh.line([2,1,3,2,4,5,4,2,3,2,3,1,1,2,0])
c = gh.line([4,6,5,3,6,5,7,4,5,3,5,2,1,3,4])
overlay = a+b+c
# Unsliced plot
overlay.plot()
# Sliced plot
overlay[6:10].plot()
TODO: Add example of slicing datetime indexed plots
NOTE: only implemented on the plotly engine so far. Not implemented on the matplotlib engine yet.
You can set eg a plot to be in log scale by setting the scaley
property.
a = gh.line([1,10,20,30,40,50,60,70,80], scaley="linear")
b = gh.line([10,20,30,40,50,60,70,80, 90], scaley="log")
# plot shown in log scale
b.plot()
# When sharing a y axis, the settings of the first plot takes precedence,
# so both show as linear
(a+b).plot()
# Here both are shown as log scale
(b+a).plot()
# If not sharing a y axis, then each plot is shown in their corresponding
# y scale setting
(a-b).plot()
Save plots by passing a file path string to the file
argument when calling plot()
.
overlay.plot(file="myplot.jpg")
# Line plot of all the columns of a dataframe, sharing same y axes
p = gh.dfplot(df, kind="line")
# Step plot of all the columns of a dataframe, with independent y axes
p = gh.dfplot(df, kind="step", sharey=False)
By default, the rendering engine used is Matplotlib. But you can change the default as follows.
# Set default rendering engine to be Matplotlib
gh.set_default_engine("mpl")
# Set default rendering engine to be Plotly
gh.set_default_engine("ply")
Possible values are:
"mpl"
Use Matplotlib"plotly"
or "ply"
Use plotlyYou can override the default rendering engine and set a different one for individual plots. The first positional argument to the plot()
function allows you to select which rendering engine to use to render the plot.
Possible values are:
"mpl"
Use Matplotlib"plotly"
or "ply"
Use plotlyEXAMPLES:
# Plot using matplotlib explicitly
overlay.plot("mpl")
# Save as an image using matplotlib explicitly
overlay.plot("mpl", file="myplot.jpg")
# Plot using Plotly
overlay.plot("ply")
# Save as an interactive HTML plot using Plotly
overlay.plot("ply", file="myplot.html")
See the contributing.md file for details on how to contribute to this project.