Skip to content

Multiple Y-Axes with Subplots positioning #173

@MaheshPunna

Description

@MaheshPunna
open Plotly.NET

let x = [for i in 0..10 -> i]
let y = [for i in x -> Math.Pow(float i,2.0)]
let y2 = [for i in x -> Math.Pow(float i,3.0)]

[
    [
        Chart.Point(x,y,Name="1,1") |> Chart.withAxisAnchor(Y=1) 
        Chart.Point(x,y2,Name="1,2") |> Chart.withAxisAnchor(Y=2) 
    ]|>
    Chart.combine
    |> Chart.withYAxisStyle("y1",Side=StyleParam.Side.Left,Id=StyleParam.SubPlotId.YAxis 1)    
    |> Chart.withYAxisStyle("y2", Side=StyleParam.Side.Right,Id=StyleParam.SubPlotId.YAxis 2)
    Chart.Invisible()

]
|> Chart.Grid(2,2)

image

How can I make y2 axis attached to the plot??

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions