Can I correct a mistake that the reviewers didn't spot in a paper that has not been accepted yet?

YES. The responsibility for correctness of the paper is yours not the reviewers’. The reviewers may help you find errors, but that is secondary to their main function: recommending to the editor whether to publish.


Which makes you look worse? Mentioning to the referees that they missed something or publishing a paper with a mistake in it?

Fix the error and include it in the list of changes you've made.

Don't mention that the referees missed it, of course. Just do something like "Response to referee 1: ... Response to referee n: ... Other changes: Figure 4 incorrectly showed blah; fixed.."


The text is yours, you can do whatever you want with it (within reason, if you want it to still get accepted, that is).

The reviewers' opinions are just that, opinions. You do not necessarily have to do what they said, although you should justify in the letter why you didn't and how you disagree with them.

And yes, if feasible, you should correct any and all errors that you spot in the process.