View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
DSPLOT - downsampled plot

3.8 | 9 ratings Rate this file 19 Downloads (last 30 days) File Size: 4.58 KB File ID: #15850 Version:
image thumbnail

DSPLOT - downsampled plot


Jiro Doke (view profile)


06 Aug 2007 (Updated )

This function creates a downsampled plot to improve the speed of exploration (zoom, pan)

Editor's Notes:

This was a File Exchange Pick of the Week

| Watch this File

File Information

This version of "plot" will allow you to visualize data that has very large number of elements. Plotting large data set makes your graphics sluggish, but most times you don't need all of the information displayed in the plot. Your screen only has so many pixels, and your eyes won't be able to detect any information not captured on the screen.
This function will downsample the data and plot only a subset of the data, thus improving the memory requirement. When the plot is zoomed in, more information gets displayed. Some work is done to make sure that outliers are captured.

 dsplot(x, y)
 dsplot(x, y, numpoints)

 x =linspace(0, 2*pi, 1000000);


This file inspired Stability Analyzer 53230 A and Jplot.

MATLAB release MATLAB 7.4 (R2007a)
Other requirements Only works for R2006b or later. It uses the zoom/pan customization feature which became available in R2006b.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
14 Feb 2017 tim .

tim . (view profile)

18 Apr 2016 Jesse Hopkins

Jesse Hopkins (view profile)

11 Jun 2013 jake reimer

Also check out jplot, which combines downsampling and cropping and can be used with subplots and combined with normal plots in the same axes.

Comment only
11 Jun 2013 jake reimer

11 Jun 2013 jake reimer

16 Dec 2011 Hoi Wong

Hoi Wong (view profile) more thing. I put NaNs in my signal so it wouldn't plot, but turns out it confuses dsplot's outlier search routine. Any good ways to get around that?

Comment only
16 Dec 2011 Hoi Wong

Hoi Wong (view profile)

The function is great, but I'd really love to use it in subplots. Any chance to add support to subplots?

It'd be tricky to tell whether the plot is downsampled or true representation without changing the figure title. One way I can think of is to set the 'Color' property of the subplot axesHandle to very light yellow for downsampled display.

Comment only
10 May 2011 Yuval Cohen

You should also look at 'tplot'
It uses minimum and maximum rather than resample and runs much faster.

Comment only
20 Jul 2010 M. A. Hopcroft

M. A. Hopcroft (view profile)

Really useful! Thanks for sharing!

25 Nov 2009 Joseph Kirk

Joseph Kirk (view profile)

This is an excellent function to have. Good work. Have you considered writing code to do something similar for other plotting functions such as IMAGESC for example?

26 Oct 2009 Kai

Kai (view profile)

Great! This function saved me. Large data plots run like hell with it! But I was missing the possibility to specify figure or axes handles to plot into.

19 Mar 2008 Scott Miller

10 Aug 2007 Jiro Doke

I'm sorry to say that it is not designed to work with MATLAB 7.01, as mentioned in "Other Requirements". This tool only works because it uses a new feature that became available in R2006b (MATLAB 7.3). I've thought about trying to make this usable in earlier versions, but it would be more clunky and won't be able to make use of the built in zoom/pan features.

Comment only
10 Aug 2007 Rob C

Looks very useful but am unable to run any of your examples. When I try this results:

??? One or more output arguments not assigned during call to 'C:\MATLAB701a\toolbox\matlab\graph2d\zoom.m (zoom)'.

Error in ==> dsplot at 94
hZoom = zoom(hFig);

Any ideas?

Comment only
09 Aug 2007 Joacim R├ądstam

Excellent function!
I often plot time series with more than 2 million samples and this function makes the plot so much faster to zoom and pan in. Also the maximizing and minimizing of the figure window is much faster.

01 Sep 2016

Updated license

Contact us