Skip to content

SignalXY: Improvements to rending and handling of rotated plots#4112

Merged
swharden merged 5 commits intoScottPlot:mainfrom
BrianAtZetica:RotatedSignalXYFixes
Jul 30, 2024
Merged

SignalXY: Improvements to rending and handling of rotated plots#4112
swharden merged 5 commits intoScottPlot:mainfrom
BrianAtZetica:RotatedSignalXYFixes

Conversation

@BrianAtZetica
Copy link
Contributor

This PR resolves some minor and some major rendering artefacts that were occurrign in Rotated SignalXY plots.
This incorporates changes made in a prevfious PR (#4102 ) that also attempted to refactor the plottable type to remove confusion between X and Y data types and X and Y axis directions.

The main artefact was best illustrated when plotting a rotated signal on inverted axes

        var size = 500;
        var cycles = 1;
        double[] xs = Generate.Consecutive(size);
        double[] ys = Generate.Sin(count: xs.Length, oscillations: cycles);

        var sig1 = WpfPlot1.Plot.Add.SignalXY(xs, ys);
        sig1.Data.Rotated = true;
        WpfPlot1.Plot.Axes.InvertX();
        WpfPlot1.Plot.Axes.InvertY();

RotatedSignalXY_InvertedBefore
After this PR the same code produces a smooth sinusoid:
RotatedSignalXY_InvertedAfter

The other artefacts demonstrated in #4102 are also resolved.

The PR also:

  • implements Rotated plots in the generic data type variant of SIgnal XY
  • Introduces an XOffset parameter (this is an offset along the uniform dimension of the SignalXY).

@swharden swharden changed the title SignalXY: Improvements to rending and handling of rotated plots (without refactoring) SignalXY: Improvements to rending and handling of rotated plots Jul 30, 2024
@swharden
Copy link
Member

Thanks @BrianAtZetica, this looks great! I'll merge this in now and issue a new release tonight 🚀

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.

2 participants