Skip to content
Plotly templates

Math — Plot: Reciprocal Function

The two branches of y = 1/x.

Template previewPlotly
Rendering…

Make it your own.

{
  "data": [
    {"type":"scatter","mode":"lines","name":"x > 0","line":{"color":"#2563eb","width":3},
     "x":[0.5,1,2,3,4,5],"y":[2,1,0.5,0.333,0.25,0.2]},
    {"type":"scatter","mode":"lines","name":"x < 0","line":{"color":"#2563eb","width":3},
     "x":[-5,-4,-3,-2,-1,-0.5],"y":[-0.2,-0.25,-0.333,-0.5,-1,-2]}
  ],
  "layout": {"title":"Reciprocal function y = 1/x","xaxis":{"title":"x"},"yaxis":{"title":"y"}}
}