how does one draw a horizontal line across a gosling.js plot
2
2
Entering edit mode
11 months ago
zhangz.cs ▴ 290

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 • 676 views
1
Entering edit mode
10 months ago

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.

0
Entering edit mode
11 months ago
tothepoint ▴ 680

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.

1
Entering edit mode

I don't think this is R, see https://gosling.js.org/