Compressing plotted data with variable sample rate?
Here is what I did. The basic idea is to mimic what you would see if you were plotting every single sample, just do it much faster


Calculate roughly how many data points will fall in one horizontal pixel. There is no point in plotting more points than the are pixels on the screen. 
Divvy up the data in blocks so that you roughly get one block per pixel
Calculate the min and the max for each block
For each block just add the max and the min in the correct order to your plot data


This way you get a plot array that has about twice the number of data points than there are pixels which is about the highest number that makes sense. You have to recalculate whenever you zoom, change the data range or re-size the window, but that tends to be fairly quick. If you don't want to handle window resizing, you can simply just calculate for the worst case (full screen).

Here is a code snippet that shows that in Matlab (it omits the ordering for brevity). The hi-res and the low-res plot look almost the same.

%% reduced sample plot example
n = 200000; % lots of samples
fs = 44100;
% noise with exponential decay
x = randn(n,1).*exp(-(0:n-1)'/fs/3);
% block approach
npix = 2000; % emulate an HD display
x1 = reshape(x,n/npix,npix); % chop into blocks
x2 = [min(x1); max(x1)];  % cal min and max
x2 = x2(:); % interleave
figure(1); plot(x); % plot with 200000 data points
figure(2); plot(x2); % plot with 2000 data points