Skip to content

ScottPlot5: Support legend alignment #2584

@chhh

Description

@chhh

Bug Report

Issue:
Plotting off-screen, setting legend location with plt.GetLegend().Alignment seems to have no effect.

Reproducing:

double[] xData = Enumerable.Range(0, 10).Select(x => x * 0.1).ToArray();
double[] yData = Enumerable.Range(0, 10).Select(x => x * 0.1).ToArray();
Plot plt = new ScottPlot.Plot() { };
Scatter scatter = plt.Add.Scatter(xData, yData);
s1.Label = "Plot 1";
plt.GetLegend().Alignment = Alignment.UpperRight;
plt.SavePng("test.png", 640, 480);

Sample from an actual plot I was making, UpperRight (or any other location) didn't help moving the legend.
test

System Details

  • ScottPlot Version: 5.0.2-beta
  • Operating System: Win10
  • Application Type: console
  • .NET Version: NET 6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueThis issue has limited complexity and may be a good start for new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions