MATLAB: Unwanted vertical black line in horizontal bar graph

MATLAB

I tried to plot a horizontal bar graph, but there's always this unwanted thin, black, vertical line touching the rightmost bar. The x and y values were reversed, so the line is at the smallest x value. I didn't use anything like 'xline' and commenting out the 'xlim' resolves the issue, but I want to set the x limits to be larger than the automatic x limits.

Best Answer

The horizontal bar graph was created with 'barh' and included the property 'BaseValue', which creates a vertical line. If you do not include the name-value pair for 'BaseValue', the issue should be resolved.