function [] = vis_noveltyCurve(noveltyCurve,parameter, no_new_figure)

if nargin<3
    no_new_figure = 0;
end
if nargin<2
    parameter = [];
end

if isfield(parameter,'markers')==0
    parameter.markers = [];
end

if isfield(parameter,'featureRate')==0 
    parameter.featureRate = 1;
end

if isfield(parameter,'name')==0 
    parameter.name = '';
end

if isfield(parameter,'showMarkers')==0 
    parameter.showMarkers = 1;
end

if isfield(parameter,'imageRange')==0 
    parameter.imageRange = 0;
end
if isfield(parameter,'colorBlack')==0 
    parameter.colorBlack = 1;
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% visualize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
featureRate = parameter.featureRate;
name = parameter.name;
markers = parameter.markers;

if ~no_new_figure
    figure
end

if parameter.showMarkers && ~isempty(markers)
    hold on
    for m_idx=1:size(markers)
        if any(parameter.imageRange)
            plot([markers(m_idx) markers(m_idx)], [parameter.imageRange(1) parameter.imageRange(2)], 'r');
        elseif max(noveltyCurve) == 0
            plot([markers(m_idx) markers(m_idx)], [min(0,min(noveltyCurve)) 1], 'r');
        else
            plot([markers(m_idx) markers(m_idx)], [min(0,min(noveltyCurve)) 1.1*max(max(noveltyCurve))], 'r');
        end
    end
end
n = (0:length(noveltyCurve)-1)./featureRate; % time in sec
if parameter.colorBlack
    plot(n,noveltyCurve,'k');
else
    plot(n,noveltyCurve);
end

title(['Novelty curve ' name  ', Feature rate = ' num2str(featureRate)],'interpreter','none');
if parameter.imageRange
    ylim(parameter.imageRange);
else
    axis tight
end
hold off
box on
