formatting x axis, ensuring width is positive