Code covered by the BSD License  

Highlights from

5.0 | 3 ratings Rate this file 11 Downloads (last 30 days) File Size: 2.14 KB File ID: #27237
image thumbnail



Cris Luengo


Prettier line plots with markers.

| Watch this File

File Information

PRETTYPLOT works just like PLOT, but avoids the line and markers being on top of each other. Instead, the line joins the markers without touching them.

   hold on
   x = -pi:pi/10:pi;
   y = tan(sin(x)) - sin(tan(x));
   h = prettyplot(x,y,'-+b',x,2*cos(x),'-xr','LineWidth',2,'MarkerSize',8);
   h = [h;prettyplot(x,randn(size(x)),'-o','LineWidth',1,'MarkerSize',6,'color',[0,0.8,0])];

MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
28 Feb 2011 Husam Aldahiyat

Husam Aldahiyat

Great function!

18 Jun 2010 Gustaf Kylberg

Gustaf Kylberg

I was looking for an alternative to the Matlab function plot to solve this specific problem with lines on top of markers, so thank you! Funny that I found your function via Matlab Fileexchange when you have written the function "inhouse" =)

Comment only
18 Jun 2010 Gustaf Kylberg

Gustaf Kylberg

30 Apr 2010 Joao Henriques

Joao Henriques


Contact us