wPlot2D
Introduction
wPlot2D is a lightweight C++ plotting library designed to create clean and customizable 2D visualizations. It provides essential features such as axes, labels, titles, legends, and annotations, while allowing users to export high-quality graphics for reports, teaching, or research. The library is built with a modular design, making it easy to integrate into existing C++ projects. Its focus is on clarity, precision, and reproducibility, providing an accessible tool for academic and scientific work.
Features
- Entity and Component system
- Dynamic component management with type-safe access
- Support for SFML-based rendering
example
#include <cmath>
{
graph.setOrigin( { 0.5f, 0.5f } );
graph.setScale( { 0.1f, 0.1f } );
title->setFont( graph.getFont( "Inconsolata" ) );
title->setFrameThickness( 5.0f );
title->setPadding( { 20.0f, 20.0f } );
xAxis->addTitle( "x" );
yAxis->addTitle( "f(x)" );
auto fSinus = graph.addFunction( [ ](double x ) { return std::sin( x ); }, -3.3, 3.3 );
fSinus->setColor( sf::Color::Red );
auto legend = graph.addLegend( { 0.2f, 0.8f }, true );
legend->addItem( "Sinus", fSinus );
legend->setCharacterSize( 30.0f );
legend->setFont( graph.getFont( "Courier" ) );
graph.saveToFile( "/../output/Example.png" );
return 0;
}
Central entity responsible for graphical rendering in wPlot2D.
Definition wGraphicsEntity.hpp:65
int main()
Definition main.cpp:84
@ X_AXIS
Definition wAxisEntity.hpp:36
@ Y_AXIS
Definition wAxisEntity.hpp:37
@ Top
Definition wGraphicsEntity.hpp:38
@ Center
Definition wAxisEntity.hpp:46
Main public include file for the wPlot2D library.
Links
Author
Created by Wilfried Koch.
Copyright @ 2025 Wilfried Koch. All rights reserved.