Skip to content

Scatter: Fills now respect both OffsetX and OffsetY#4473

Merged
swharden merged 2 commits intomainfrom
4433
Nov 9, 2024
Merged

Scatter: Fills now respect both OffsetX and OffsetY#4473
swharden merged 2 commits intomainfrom
4433

Conversation

@swharden
Copy link
Member

@swharden swharden commented Nov 9, 2024

Scatter plot fills now respect both OffsetX and OffsetY. Previously only OffsetX was respected.

Resolves #4433

// create data points that resemble a "hump"
double[] ys = Generate.Cos(100, oscillations: 0.5, phase: -0.25);
double[] xs = Generate.RangeWithCount(0, 1, ys.Length);
// scatter with no offset
var sp1 = plot.Add.ScatterLine(xs, ys);
sp1.LineWidth = 3;
sp1.LineColor = Colors.Black;
sp1.FillY = true;

// scatter with offset
var sp2 = plot.Add.ScatterLine(xs, ys);
sp2.LineWidth = 3;
sp2.LineColor = Colors.Black;
sp2.FillY = true;
sp2.OffsetX = 2;
sp2.OffsetY = 2;
original behavior new behavior
Test_Scatter_FillAndOffset Test_Scatter_FillAndOffset

@swharden swharden enabled auto-merge (squash) November 9, 2024 16:43
@swharden swharden merged commit 00b90cc into main Nov 9, 2024
@swharden swharden deleted the 4433 branch November 9, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scatter: fill under line fails when Y offset is used

1 participant