Skip to content

SP5: LockedVertical / LockedHorizontal not working right #3179

@raburton

Description

@raburton

Bug Report

Issue: Using the code from the end of #3160, gives strange results. See screen shots below for various combinations and results.

Reproducing: Try code below, uncommenting the locking lines as required.

private void Form1_Load(object sender, EventArgs e) {

    double[] positions1 = { 1, 4, 7, 10, 13, 16, 19 };
    double[] values1 = { 1, 4, 7, 10, 13, 16, 19 };
    double[] positions2 = { 2, 5, 8, 11, 14, 17, 20 };
    double[] values2 = { 2, 5, 8, 11, 14, 17, 20 };

    BarPlot Plot1 = formsPlot1.Plot.Add.Bars(positions1, values1);
    BarPlot Plot2 = formsPlot1.Plot.Add.Bars(positions2, values2);

    formsPlot1.Plot.Axes.AutoScale();
    //formsPlot1.Plot.Axes.Rules.Add(new LockedVertical(formsPlot1.Plot.Axes.Left));
    //formsPlot1.Plot.Axes.Rules.Add(new LockedHorizontal(formsPlot1.Plot.Axes.Bottom));
}

Code as above, no axes locked:
image

Vertical axis locked:
image

Horizontal axis locked:
image

Both locked:
image

System Details

  • ScottPlot Version: 5.0.12-beta
  • Operating System: Windows 10
  • Application Type: WinForms
  • .NET Version: .NET 8.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions