All Projects â†’ trase-cpp â†’ trase

trase-cpp / trase

Licence: other
📊 A lightweight plotting library

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to trase

labplot
LabPlot is a FREE, open source and cross-platform Data Visualization and Analysis software accessible to everyone.
Stars: ✭ 107 (+42.67%)
Mutual labels:  plotting
btplotting
btplotting provides plotting for backtests, optimization results and live data from backtrader.
Stars: ✭ 159 (+112%)
Mutual labels:  plotting
CRAWLAB-Code-Snippets
Small pieces of code for use in CRAWLAB research
Stars: ✭ 12 (-84%)
Mutual labels:  plotting
plottr
A flexible plotting and data analysis tool.
Stars: ✭ 32 (-57.33%)
Mutual labels:  plotting
GMT.jl
Generic Mapping Tools Library Wrapper for Julia
Stars: ✭ 148 (+97.33%)
Mutual labels:  plotting
dufte
📈 Minimalistic Matplotlib style
Stars: ✭ 196 (+161.33%)
Mutual labels:  plotting
texfig
Utility to generate PGF vector files from Python's Matplotlib plots to use in LaTeX documents.
Stars: ✭ 58 (-22.67%)
Mutual labels:  plotting
BeautifulMakie
https://lazarusa.github.io/BeautifulMakie/
Stars: ✭ 281 (+274.67%)
Mutual labels:  plotting
observable-jupyter
Embed visualizations and code from Observable notebooks in Jupyter
Stars: ✭ 27 (-64%)
Mutual labels:  plotting
elementary-plotlib
C/C++ Plotting Library
Stars: ✭ 19 (-74.67%)
Mutual labels:  plotting
ElectricPy
Electrical Engineering Python Module
Stars: ✭ 35 (-53.33%)
Mutual labels:  plotting
vioplot
Development version of vioplot R package (CRAN maintainer)
Stars: ✭ 25 (-66.67%)
Mutual labels:  plotting
RTGraph
A simple Python application for plotting and storing data in real time
Stars: ✭ 45 (-40%)
Mutual labels:  plotting
biggles
simple, elegant python plotting
Stars: ✭ 19 (-74.67%)
Mutual labels:  plotting
oxyplot-avalonia
A cross-platform plotting library for .NET. This package targets Avalonia apps.
Stars: ✭ 102 (+36%)
Mutual labels:  plotting
machinaris
An easy-to-use WebUI for crypto plotting and farming. Offers Plotman, MadMax, Chiadog, Bladebit, Farmr, and Forktools in a Docker container. Supports Chia, MMX, Chives, Flax, HDDCoin, and BPX among others.
Stars: ✭ 324 (+332%)
Mutual labels:  plotting
SmoothLivePlot.jl
A Julia package for creating live-style plots during calculations.
Stars: ✭ 24 (-68%)
Mutual labels:  plotting
planetMagFields
Routines to plot magnetic fields of planets in our solar system
Stars: ✭ 27 (-64%)
Mutual labels:  plotting
smoothers
Visualizations of various one-dimensional smoothers using the d3 javascript library.
Stars: ✭ 18 (-76%)
Mutual labels:  plotting
GRUtils.jl
Tools for using the GR framework in Julia
Stars: ✭ 29 (-61.33%)
Mutual labels:  plotting

trase

Ubuntu unit macOS unit Windows unit

codecov BCH compliance codedocs.xyz

Trase is a lightweight scientific plotting library for C++ with animation support. It enables you to construct plots and write them out to animated svg files, or display them in an OpenGL window. The main library and svg backend have no dependencies other than the standard library. The OpenGL backend requires GLFW.

For example, the above svg image was generated with the following code.

  auto fig = figure();
  auto ax = fig->axis();
  const int n = 100;
  const int nframes = 10;
  std::vector<float> x(n);
  std::vector<float> y(n);

  // define x points
  for (int i = 0; i < n; ++i) {
    x[i] = static_cast<float>(i) / n;
  }

  // define y = sin(x) with given amplitude and frequency
  auto get_ysinx = [&](const float amplitude, const float freq) {
    for (int i = 0; i < n; ++i) {
      y[i] = amplitude * std::sin(6.28f * freq * x[i]);
    }
    return create_data().x(x).y(y);
  };

  // create a static sin(x) function
  auto static_plot = ax->line(get_ysinx(1.f, 2.f));
  static_plot->set_label("static");

  // create a moving sin(x) function with varying amplitude
  auto moving_plot = ax->line(get_ysinx(1.f, 5.f));
  moving_plot->set_label("moving");

  for (int i = 1; i <= nframes; ++i) {
    const float nf = static_cast<float>(nframes);
    const float amplitude = 1.f - 0.5f * std::sin(6.28f * i / nf);
    moving_plot->add_frame(get_ysinx(amplitude, 5.f), 3.f * i / nf);
  }

  // set label axes
  ax->xlabel("x");
  ax->ylabel("y");
  ax->title("the svg test");
  ax->legend();

  // output to svg
  std::ofstream out;
  out.open("readme.svg");
  BackendSVG backend(out);
  fig->draw(backend);
  out.close();

Contributing to Trase

We welcome community pull requests for Trase, please see the guidelines here. Potential areas for changes are:

  • Bug-fixes. Please add a relevant test in tests/ demonstrating the fixed bug.
  • New geometry, aesthetic or transform. The design of Trase roughly follows the Grammer of Graphics, so looking at existing GOG packages such as ggplot could give you some good ideas
  • New example showing how to use Trase. All the examples shown in the documentation are in examples/.
  • New drawing backend. There are two main types of backend. Classes derived from Backend are "pure" drawing classes in the same vein as NanoVG, while those derived from AnimatedBackend can also draw shapes or paths that have properties which animate over time.
  • Or consult the issues for more ideas

Usage

  1. Clone this repository
$ git clone https://github.com/martinjrobins/trase
$ cd trase
  1. Build and install Trase. This uses an install dir of $HOME/trase, change this to wherever you like. This also builds the OpenGL backend of Trase (requires GLFW installed), switch this to OFF if you only want the svg backend.
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/trase -Dtrase_BUILD_OPENGL=ON ..
$ make install
  1. (alternate) If you are using the Xcode or Visual Studio generator, you need to specify the configuration in build time
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/trase -Dtrase_BUILD_OPENGL=ON ..
$ cmake --build . --target install --config Release
  1. In your C++ project, you might link against Trase with a CMakeLists.txt file like so:
cmake_minimum_required(VERSION 2.8.12)
project(test)

find_package(trase REQUIRED)

add_executable(myexe test.cpp)
target_link_libraries(myexe trase)
  1. When you build your project, you can tell CMake where you installed Trase using the CMAKE_PREFIX_PATH variable
$ cmake -DCMAKE_PREFIX_PATH=$HOME/trase ..
$ make

Acknowledgments

Trase uses NanoVG for the OpenGL backend. The Dirent port for Windows is used for finding local font files.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].