Multiple Y-Axes with Subplots positioning

Open
#173 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fsharp

Research direction

Start by running the F# reproduction in the issue and inspect how Chart.Grid and the two Chart.withYAxisStyle calls position the y2 axis. The issue is resolved when the y2 axis is attached to the corresponding subplot rather than appearing in a separate position.

Written by the indexing model from the issue text.

Description

Type: Bug

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??

Dominant language
F#
Stars
860
Forks
99
Avg merge
22m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plotly/Plotly.NET

All issues in plotly/Plotly.NET

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.