Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Plot line with rounded ends
Replies: 8   Last Post: Nov 11, 2012 11:43 AM

 Messages: [ Previous | Next ]
 David Posts: 3 Registered: 2/7/11
Plot line with rounded ends
Posted: Nov 10, 2012 12:00 PM

Hello All,

I am putting together a quick (at-a-glace) style plot for some geochemical data.

plot(0,(METHANE(L(i,:),1)*-1),'linewidth',4,'marker','.','markersize',74,'markerfacecolor','m','markeredgecolor','m');

line([0 0],[0 (METHANE(L(i,:),1)*-1)],'LineStyle','-','LineWidth',24,'marker','.','markersize',74,'color','m');

I am essentially plotting a single point then drawing a line from the origin to the plotted point. A line drawn at width of 24 creates a line with square ends. I would like the line to have rounded ends. 'marker','.' or 'o' does handle this with the marker diameter set to the same width as the line itself, however, on a line of this width it essentially falsing elongates the line since the marker is centered on the data point. The line is then visual lengthed by the amount proportional to the marker radius at each end of the line.

So my question: is there a function or way to create a thick line with rounded ends starting at the original and ending the line at the data point?

Thank you in advance for you help.
Dave

Date Subject Author
11/10/12 David
11/10/12 David T
11/10/12 David T
11/10/12 dpb
11/10/12 Nasser Abbasi
11/11/12 David T
11/11/12 dpb
11/11/12 David T
11/11/12 dpb