You can see here, I actually get a range from 1020.5 to 1023.5. When the value decreases, the range also gets smaller. I want to see the whole graph (0 to 1023) at once so that I can compare small values with larger ones.
Throw in two additional fixed values, 0 and 1023 into the plot. That will suppress the (sometimes) useful auto scaling behaviour. There may be more elegant ways to achieve the same results.
It is not clear to me what you mean by "compare". The vertical range is automatically set to contain all plotted data. For example, here I plot a large value (1000), followed by a small value (0):
void setup() {
Serial.begin(9600);
while(!Serial) {}
Serial.println(); // Serial Plotter discards the first message
Serial.println(1000);
Serial.println(0);
}
void loop() {}
You see the plotter range is set to still show the large value even after plotting the small value:
So you will always be able to see and compare all the plotted data.
Note that the Arduino IDE 2.x Serial Plotter only plots the last 50 data points. So data points before that are not visible regardless of their relative value. This might give the impression that smaller values were causing the loss of visibility of previous larger values, when really it was only that those previous values were more than 50 data points back in the set. There is a formal feature request to allow plotting more data points here:
In the case where someone is comparing the contents of the Serial Plotter windows of multiple ports or screenshots of previous plots side by side, I can see that if these separate plots had different ranges, that could make it difficult to visually compare them. In that case the technique shared by 6v6gt and J-M-L would be an effective workaround. There is a formal feature request for the option of a user selectable fixed vertical range here:
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.