Horizontal line on a figure
                    Version 1.1.0.0 (675 Bytes) by  
                  Shoaibur Rahman
                
                
                  Horizontal Line in Matlab
                
                  
              hr(yPos) plot a horizontal line at yPos getting current axis values with default color gray, line width 1, and a solid line with no markers. 
However, hr(yPos,varargin) plot a horizontal line at yPos getting current axis, while varargin takes any plot property as defined in built-in plot function in Matlab.
Cite As
Shoaibur Rahman (2025). Horizontal line on a figure (https://uk.mathworks.com/matlabcentral/fileexchange/48736-horizontal-line-on-a-figure), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
              Created with
              R2014b
            
            
              Compatible with any release
            
          Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > 2-D and 3-D Plots > Line Plots >
      Find more on Line Plots in Help Center and MATLAB Answers
    
  Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
