Graphical tools

caxis

inline void castor::caxis(figure &fig, matrix<double> const &val)

Sets the colormap limit for the current axis.

fig is the figure object for which those limits must be set and val is a two-element matrix containing the lower- and upper-bound.

matrix<> X,Y;
std::tie(X,Y) = meshgrid(linspace(-M_PI,M_PI,100));
auto Z = 2*sin(X)/X * sin(Y)/Y;

figure fig;
caxis(fig,{-1,1});
mesh(fig,X,Y,Z);
drawnow(fig);

drawnow

inline void castor::drawnow(figure &fig)

Displays all the figure defined since the beginning of the program or the last call to drawnow.

Calling drawnow is blocking meaning that it will suspend the execution of the program. Plotting cannot be deported to another thread as it is not permitted by the VTK framework. The execution will resume all the currently displayed figures are closed.