-
Notifications
You must be signed in to change notification settings - Fork 982
Closed
Description
Hi Scott,
thank you for this amazing work.
I would like to suggest to add a feature that enables the user to have the same scaling for both x y axis.
I tried to implement that by adjusting the axes limit from min(x,y) to max(x,y) and then using the aspect ratio of the plot and zoom out by the ratio the y axes. It works somehow but is not really a robust solution, the axis should be adjusted at any plot component resize. Another drawback that i did not solved yet is to re-center the plotted line in my case.
//equal axis scaling
double xmin = xarray.Min();
double xmax = xarray.Max();
double ymin = yarray.Min();
double ymax = yarray.Max();
double minimum = Math.Min(Math.Min(xmin,ymin),Math.Min(xmax,ymax));
double maximum = Math.Max(Math.Max(xmin, ymin), Math.Max(xmax, ymax));
this.axesXY.plt.Axis(minimum, maximum, minimum, maximum);
double Width = this.axesXY.plt.CoordinateToPixel(maximum, minimum).X-
this.axesXY.plt.CoordinateToPixel(minimum,minimum).X;
double Height = this.axesXY.plt.CoordinateToPixel(minimum, maximum).Y - this.axesXY.plt.CoordinateToPixel(minimum, minimum).Y;
double ratio = Math.Abs(Width / Height);
this.axesXY.plt.AxisZoom(1,ratio);
this.axesXY.Render();Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels