avoid partial drawing of the smooth curve outside the graph area