I would like to "zero" the window at the end of void setup().
What does this mean? What, exactly, is supposed to become 0?
const int analogPin = A0; // pin that the sensor is attached to
const int analogPin1 = A1; // pin that the sensor is attached to
Do you count uh-huh, one, two? Or, do you count one, two, three? When you feel the need to number variables, number ALL of the variables in a set. Or, better yet, use an array.
// read the value of the potentiometer:
int analogValue = analogRead(analogPin);
int analogValue1 = analogRead(analogPin1);
Which potentiometer? When you have useless comments, they need to be specific useless comments.
lastAnalogValue=temperature;
}
That's useless, since lastAnalogValue is local to loop() and goes out of scope at the }. Next iteration of loop(), you get a new variable, with a value of 0.
Other than two lines of comments, that is the end of your code. I can't see anything there related to opening or closing a window.