-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Wiring together two plots with a shared axis is a pain!
This works now
This is how I do it currently as described by https://scottplot.net/faq/shared-axes/
formsPlot1.AxesChanged += (s, e) =>
{
formsPlot2.Configuration.AxesChangedEventEnabled = false;
formsPlot2.Plot.MatchAxis(formsPlot1.Plot, horizontal: true);
formsPlot2.Refresh();
formsPlot2.Configuration.AxesChangedEventEnabled = true;
};
formsPlot2.AxesChanged += (s, e) =>
{
formsPlot1.Configuration.AxesChangedEventEnabled = false;
formsPlot1.Plot.MatchAxis(formsPlot2.Plot, horizontal: true);
formsPlot1.Refresh();
formsPlot1.Configuration.AxesChangedEventEnabled = true;
};Could it be easier?
Something like this could handle the event twiddling and the refresh too
formsPlot1.AxesChanged += (s, e) =>
{
formsPlot1.CopyAxesFrom(formsPlot1.Plot, horizontal: true, vertical: false);
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels