fixing compilation bug for plotting