Skip to content

FloatingAxis: new plottable for displaying axes anywhere in the data area#4428

Merged
swharden merged 5 commits intomainfrom
3377
Nov 3, 2024
Merged

FloatingAxis: new plottable for displaying axes anywhere in the data area#4428
swharden merged 5 commits intomainfrom
3377

Conversation

@swharden
Copy link
Member

@swharden swharden commented Nov 3, 2024

Resolves #3377

// create floating X and Y axes using one of the existing axes for reference
ScottPlot.Plottables.FloatingAxis floatingX = new(myPlot.Axes.Bottom);
ScottPlot.Plottables.FloatingAxis floatingY = new(myPlot.Axes.Left);

// hide the default axes and add the custom ones to the plot
myPlot.Axes.Frameless();
myPlot.HideGrid();
myPlot.Add.Plottable(floatingX);
myPlot.Add.Plottable(floatingY);

// add sample data last so it appears on top
myPlot.Add.Signal(Generate.Sin(51));
myPlot.Add.Signal(Generate.Cos(51));

image

@swharden swharden enabled auto-merge (squash) November 3, 2024 19:08
@swharden swharden merged commit 880b6b3 into main Nov 3, 2024
@swharden swharden deleted the 3377 branch November 3, 2024 19:14
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.

Axis: add an option to draw in the center of the plot

1 participant