From 252ed2feb24c6df4c9fbfd346d44401b9866bd41 Mon Sep 17 00:00:00 2001 From: Piotr Krysik Date: Mon, 1 Apr 2019 09:32:49 +0200 Subject: Improve slightly interface of plotting so it's easier to use it Change-Id: Ia70ab45a8beb81512a9f83e316ad2d2bc385ef19 --- include/grgsm/plotting.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/grgsm/plotting.hpp b/include/grgsm/plotting.hpp index 21890e4..d4e6933 100644 --- a/include/grgsm/plotting.hpp +++ b/include/grgsm/plotting.hpp @@ -31,7 +31,7 @@ boost::shared_ptr current_figure; -void imagesc(arma::mat & x){ +void imagesc(const arma::mat & x){ Gnuplot gp; gp << "set palette rgb 3,2,2;"; gp << "plot "; @@ -39,7 +39,7 @@ void imagesc(arma::mat & x){ gp << std::endl; } -void plot(arma::cx_mat & x, std::string title){ +void plot(const arma::cx_mat & x, std::string title){ arma::mat y = arma::abs(x); if(current_figure.get()==NULL){ current_figure = boost::make_shared(); @@ -50,7 +50,7 @@ void plot(arma::cx_mat & x, std::string title){ (*current_figure) << std::endl; } -void replot(arma::cx_mat & x, std::string title){ +void replot(const arma::cx_mat & x, std::string title){ arma::mat y = arma::abs(x); if(current_figure.get()==NULL){ current_figure = boost::make_shared(); @@ -61,19 +61,19 @@ void replot(arma::cx_mat & x, std::string title){ } template -void plot(std::vector & x){ +void plot(const std::vector & x){ arma::cx_mat y = arma::conv_to::from(x); plot(y,""); } template -void plot(std::vector & x, std::string title){ +void plot(const std::vector & x, std::string title){ arma::cx_mat y = arma::conv_to::from(x); plot(y,title); } template -void replot(std::vector & x, std::string title){ +void replot(const std::vector & x, std::string title){ arma::cx_mat y = arma::conv_to::from(x); replot(y,title); } -- cgit v1.2.3