From: SourceForge.net <no...@so...> - 2009-03-25 01:48:49
|
Bugs item #2590560, was opened at 2009-02-11 16:22 Message generated for change (Settings changed) made by jamcquay You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=821568&aid=2590560&group_id=161868 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: 0.9.9.2 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Brent Browning (brent_browning) >Assigned to: Jamie McQuay (jamcquay) Summary: PlotSurface2D displays data incorrectly when YAxis1.Reversed Initial Comment: I am using NPlot to display contour charts using PlotSurface2D. When I reverse the Y axis order the chart does not display correctly. My data goes from 0,0 to 10,10 (11 rows and 11 columns). I want data point 0,0 to appear in the upper left hand corner of the plot. The default has Y values increasing so 0,0 is in the lower left. When I set YAxis1.Reversed I get the desired effect of the numbers on the Y axis (0 is at the top and 10 is at the bottom). But the data is plotted incorrectly. Data from row 0 is plotted on row 1, etc. Here is a code fragment for how I am plotting the data: int row = 10; int col = 10; double[,] map = new double[row, col]; for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { map[i, j] = i; } } this.myPlotSurface.Clear(); myPlotSurface.Title = "Grid Survey"; NPlot.ImagePlot ip = new NPlot.ImagePlot(map, 0, 1, 0, 1); ip.Gradient = new NPlot.LinearGradient(Color.Blue, Color.Red); ip.Center = false; myPlotSurface.Add(ip); // Reverse Y axis so grid matches physical space myPlotSurface.YAxis1.Reversed = true; NPlot.Grid grid = new NPlot.Grid(); grid.HorizontalGridType = NPlot.Grid.GridType.Fine; grid.VerticalGridType = NPlot.Grid.GridType.Fine; myPlotSurface.Add(grid); myPlotSurface.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; myPlotSurface.AddInteraction(new NPlot.Windows.PlotSurface2D.Interactions.MouseWheelZoom()); myPlotSurface.Refresh(); ---------------------------------------------------------------------- >Comment By: Jamie McQuay (jamcquay) Date: 2009-03-24 21:48 Message: reproduced, looking into. ---------------------------------------------------------------------- Comment By: Brent Browning (brent_browning) Date: 2009-02-12 15:47 Message: I made a tentative fix by changing ImagePlot.cs as follows: public void Draw( Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis ) { .... // BRENTB - 2009/02/12 // Fix for bug when [XY]Axis1.Reversed == true // See artifact 2590560 filed against NPlot for details // //if ( !hPositive ) //{ // wY += yStep_; //} //if (!wPositive ) //{ // wX += xStep_; //} .... } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=821568&aid=2590560&group_id=161868 |