Adding vertical and horizontal lines in 2D plots

23 views
Skip to first unread message

Michael Wesoly

unread,
Aug 2, 2022, 12:21:50 PM8/2/22
to dislin-users
Hello together!

First of all, amazing good library! Just started to use it three days ago and it does all what i need. almost all ;) that's why i have a question:
How can i draw vertical and horizontal lines in an 2d plot the easiest way? I need these to show some limits, and want them to draw through the whole 2D plot (from one axis to the other one) Is there a curve plotting fuction, where i can just say y=100 or x=200 to get these lines?
I looked quite a bit but didn't find some special function for that.
Thank you already so much for the help!

Helmut Michels

unread,
Aug 3, 2022, 4:26:21 AM8/3/22
to dislin-users
Hi,

the easiest way to draw single lines in an axis system is to use the routine rline.
For example:

                    rline (x, y1, x, y2)   plots a vertical line
                    rline (x1, y, x2, y)   plots a horizontal line

There are no special routines for just plotting vertical or horizontal lines, but the line
algorithm switches internally to  a faster algorithm if a vertical or horizontal line is
detected.

With best regards,

Helmut

Michael Wesoly

unread,
Aug 7, 2022, 10:55:23 AM8/7/22
to dislin-users
Hello Helmut,

thank you for the answer! That is helping me very much and i get the needed results easily.
I will try more stuff with this library in the near future and most probably come back with more questions.

until then, with best regards
Michael
Reply all
Reply to author
Forward
0 new messages