View License

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

» Watch video

Highlights from
Advanced hline and vline

4.5 | 2 ratings Rate this file 20 Downloads (last 30 days) File Size: 4.08 KB File ID: #18796 Version: 1.2
image thumbnail

Advanced hline and vline


Hoi Wong (view profile)


17 Feb 2008 (Updated )

Draws horizontal/vertical lines in graphs. Accept axes handle and allows user to specify label posit

| Watch this File

File Information

I needed to draw some vertical markers to my plots in GUI, so I checked out Brandon Kuczenski's hline/vline submission. However it doesn't accept axes handle as an input argument.
Getting around by switching with 'gca' causes weird behavior due to uncertain timing in GUI. So I reverse engineered the basic idea in his code and added in a few degrees of freedom. I hope this will help other MATLAB GUI programmers.

I haven't done any extensive testing as I'm busy with with my project on hand. Please send any suggestions, bug reports to Thanks!


Hline And Vline inspired this file.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
22 Apr 2012 Felipe

Felipe (view profile)

I'd add at the end:
if (nargout == 0), clear lineHandles; end

25 Oct 2011 Rashbeard

19 Mar 2012 1.1

Refactored to enable linePropertiesList, textPropertiesList, isLineColorSynchronizedWithText

19 Aug 2014 1.2

Added textHandle as an optional output and yLimits for vline() and xLimits for hline() as optional inputs.

Contact us