Signalsmith's Basic C++ Plots  1.1.0
A minimal C++ plotting library
Nested Classes | Methods | Attributes
signalsmith::plot::HeatMap Struct Reference

#include <heatmap.h>

Detailed Description

Pixel-based heat-map.

You create this separately, and then attach to a Figure or Plot later, or save directly to PNG.

Nested Classes

struct  EmbeddedHeatMap
 
struct  RetainedMap
 

Methods

 HeatMap (int width, int height)
 
 HeatMap (int width, int height, int outputWidth, int outputHeight)
 
void write (std::string pngFile, bool flippedY=false)
 
std::string dataUrl (bool flippedY=false)
 
double & operator() (int x, int y)
 
const double & operator() (int x, int y) const
 
void flipY ()
 
Plot2DaddTo (Plot2D &plot, Bounds dataBounds)
 
Plot2DaddTo (Plot2D &plot, Bounds dataBounds, Plot2D &scalePlot)
 
Plot2DaddTo (Plot2D &plot, bool flippedY=true)
 
Plot2DaddTo (Plot2D &plot, Plot2D &scalePlot, bool flippedY=true)
 
Plot2DaddScaleTo (Plot2D &scalePlot)
 
Plot2DaddTo (Grid &grid, double width, double height, double scaleWidth=15)
 Adds data and scale plots to a grid (e.g. a figure), returning the data plot. More...
 
template<class Drawable , class... Args>
auto copyTo (Drawable &drawable, Args &&...args) -> decltype(this->addTo(drawable, std::forward< Args >(args)...))
 Makes a retained copy of the map, then calls .addTo(...) More...
 
std::vector< double >::iterator begin ()
 
std::vector< double >::iterator end ()
 
std::vector< double >::const_iterator begin () const
 
std::vector< double >::const_iterator end () const
 

Attributes

Axis scale
 
bool light = false
 

Method Details

◆ addTo()

Plot2D& signalsmith::plot::HeatMap::addTo ( Grid grid,
double  width,
double  height,
double  scaleWidth = 15 
)
inline

Adds data and scale plots to a grid (e.g. a figure), returning the data plot.

◆ copyTo()

template<class Drawable , class... Args>
auto signalsmith::plot::HeatMap::copyTo ( Drawable &  drawable,
Args &&...  args 
) -> decltype(this->addTo(drawable, std::forward<Args>(args)...))
inline

Makes a retained copy of the map, then calls .addTo(...)