AquaPlot is a data visualization library for crystal-lang. It provides an easy to user interface to create visually appealing charts. This project is currently in extremely unstable and active development. Contributions are both welcomed and encouraged, to get this library to a stable and useful state.
-
Add the dependency to your
shard.yml
:dependencies: aquaplot: github: crystal-data/aquaplot
-
Run
shards install
Gnuplot is required. Please review your operating system's installation instructions to install the library.
require "aquaplot"
fns = ["sin(x)", "cos(x)", "tan(x)", "atan(x)", "asin(x)"].map do |fn|
AquaPlot::Function.new fn
end
plt = AquaPlot::Plot.new fns
plt.show
plt.close
fns = ["x**2 + y**2", "x**2 - y**2", "x**2 * y**2", "x**2 / y**2"].map do |fn|
AquaPlot::Function.new fn
end
plt = AquaPlot::Plot3D.new fns
plt.set_key("left box")
plt.show
plt.close
lines = (1...5).map do |n|
AquaPlot::Line.new (0...10).map { |el| Random.rand(50) }, title: "Line #{n}"
end
lines[0].show_points
lines[1].set_linewidth 1
plt = AquaPlot::Plot.new lines
plt.set_title("Showing Some Options")
plt.show
plt.close
TODO: Write development instructions here
- Fork it (https://github.com/crystal-data/aquaplot/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Chris Zimmerman - creator and maintainer