This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how does one draw a horizontal line across a gosling.js plot

I want to use the rule mark to draw a horizontal line across the whole x-axis and at 2.5 in the y-axis. I don't know how I can do that.

gosling.js

2 answers

Perhaps use the line mark with some placeholder data:

http://gosling-lang.org/docs/mark#line

To define a horizontal line, I presume that the data could something as simple as a JSON object that contains two points, one at each extremum of the x-axis (whatever that is for your dataset), with a signal or score value of 2.5:

http://gosling-lang.org/docs/data#json-no-higlass-server

The line mark would connect these two points, giving you a horizontal line.

Details of your approach is missing. I assume, If you are working in R you can try this:

hline = 2.5, vline = 2.5

or the coordinates you are interested in.

Log in to answer this question.