My paper was accepted, but I found an error affecting all of the figures. What will happen next? I submitted a paper to a journal, and the decision was "accept with minor revisions."  As I was addressing the reviewer questions to submit a final copy, I realized that I may have misrepresented the data.  

Specifically, I may have over-reached with a statistical model.  The model involved repeated measures of individuals who were initially one group (let's call it condition A), but were later split into two groups (B and C).  The model gives me differences between conditions.  My mistake was to calculate the actual values at each condition based on these differences, which was wrong because by dumb luck the 2 groups had a systematic offset at A before they were split (even though the members of each group were chosen randomly).  Hopefully that explanation makes some sense.  I presented the data in terms of "actual" values rather than differences because I thought this would be more informative for the reader.  So, basically, all the numbers are wrong.  It's a stupid mistake in hindsight, since I could find this information in the raw data.

The conclusions of the paper and the statistically significant relationships would still be the same in the corrected version, because I believe the model to be the correct one.  However, almost all of the numbers, tables, and figures would need modification.  And of course the strange systematic offset between randomized groups will raise eyebrows.

I'm certainly going to notify the editor and attempt to submit a corrected version of the paper.  I'm wondering what I should expect to happen, though.  Are journals understanding of this type of error, or does it represent something so egregious that the paper would be rejected and my credibility would be damaged?  Or would it simply be reviewed again?  I understand that it's largely up to the editor to decide, but I'm wondering if anyone with similar experience might give me an idea of what I'm dealing with.  Thanks!
Though I don't have any prior experience with this, I agree that you should notify the editor and should explain to them how and why this mess happened. Also let then know that it was a mistake and as soon as you realized it, you let them know. Also let them know that you are ready if they want to have the paper reviewed again. I believe that they would understand the mistake and would not make a scene out of it. But yes, you have to choose your words carefully and should politely explain them the point and admit your mistake.