Skip to content

Incorrect marker shape displayed in legend #2172

@szescxz

Description

@szescxz

Bug Report

Issue:
Incorrect marker shape displayed in legend when using SignalXYConst. All plottables are displayed as filledCircle.
scatter_markerShape

Reproducing:
Simply replace AddScatter with AddSignalXYConst in this cookbook example:

var plt = new ScottPlot.Plot(600, 400);

int pointCount = 51;
double[] xs = DataGen.Consecutive(pointCount);

string[] markerShapeNames = Enum.GetNames(typeof(MarkerShape));
for (int i = 0; i < markerShapeNames.Length; i++)
{
    Enum.TryParse(markerShapeNames[i], out MarkerShape ms);
    double[] ys = DataGen.Sin(pointCount, 2, -i);
    var sp = plt.AddSignalXYConst(xs, ys); // <- replace this line
    sp.LineWidth = 2;
    sp.LineColor = Color.FromArgb(50, sp.LineColor);
    sp.MarkerSize = 7;
    sp.MarkerShape = ms;
    sp.Label = ms.ToString();
}

plt.Grid(enable: false);
var legend = plt.Legend();
legend.FontSize = 10;

plt.SaveFig("scatter_markerShape.png");

System Details

  • ScottPlot Version: 4.1.58
  • Operating System: Windows 11
  • Application Type: WinForms
  • .NET Version: NET Framework 4.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGunexpected behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions