Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ZTaiIT1025 opened this issue Feb 18, 2024 · 1 comment · Fixed by #4428
Closed

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

ZTaiIT1025 opened this issue Feb 18, 2024 · 1 comment · Fixed by #4428

Comments

@ZTaiIT1025
Copy link

The default coordinate axis intersection point is in the bottom left corner. Can we set the coordinate axis intersection point position to be in the middle of the chart by setting properties

Snipaste_2024-02-18_09-27-23

@swharden swharden changed the title Set axis intersection points Axis: add an option to draw in the center of the plot Mar 15, 2024
@swharden
Copy link
Member

swharden commented Nov 3, 2024

Adding this feature in the next release 🚀

// 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

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 a pull request may close this issue.

2 participants