@@ -1157,38 +1157,27 @@ public static PlotModel NormalHeatMap()
11571157 return model ;
11581158 }
11591159
1160+ /// <summary>
1161+ /// Contains example code for https://github.com/oxyplot/oxyplot/issues/42
1162+ /// </summary>
1163+ /// <returns>The plot model.</returns>
11601164 [ Example ( "#42: ContourSeries not working for not square data array" ) ]
1161- public static PlotModel IssueDescription ( )
1165+ public static PlotModel IndexOutOfRangeContour ( )
11621166 {
1163- int n = 100 ;
1164- double x0 = - 3.1 ;
1165- double x1 = 3.1 ;
1166- double y0 = - 3 ;
1167- double y1 = 3 ;
1168- Func < double , double , double > peaks = ( x , y ) => 3 * ( 1 - x ) * ( 1 - x ) * Math . Exp ( - ( x * x ) - ( y + 1 ) * ( y + 1 ) ) - 10 * ( x / 5 - x * x * x - y * y * y * y * y ) * Math . Exp ( - x * x - y * y ) - 1.0 / 3 * Math . Exp ( - ( x + 1 ) * ( x + 1 ) - y * y ) ;
1169- // see https://github.com/oxyplot/oxyplot/issues/511
1170- var xvalues = ArrayBuilder . CreateVector ( x0 , x1 , n * 10 ) ;
1171- var yvalues = ArrayBuilder . CreateVector ( y0 , y1 , n ) ;
1172- var peaksData = ArrayBuilder . Evaluate ( peaks , xvalues , yvalues ) ;
1173- var model = new PlotModel { Title = "Peaks" } ;
1174- model . Axes . Add ( new LinearColorAxis { Position = AxisPosition . Right , Palette = OxyPalettes . Jet ( 500 ) , HighColor = OxyColors . Gray , LowColor = OxyColors . Black } ) ;
1167+ var model = new PlotModel { Title = "Issue #42" } ;
1168+ model . Axes . Add ( new LinearColorAxis { Position = AxisPosition . Right , Palette = OxyPalettes . Jet ( 5 ) } ) ;
11751169
1176- var hms = new HeatMapSeries { X0 = x0 , X1 = x1 , Y0 = y0 , Y1 = y1 , Data = peaksData } ;
1177- model . Series . Add ( hms ) ;
1178- //if (includeContours)
1170+ var x = ArrayBuilder . CreateVector ( 0 , 1 , 20 ) ;
1171+ var y = ArrayBuilder . CreateVector ( - 1 , 1 , 2 ) ;
1172+ var data = ArrayBuilder . Evaluate ( ( a , b ) => a * b , x , y ) ;
1173+
1174+ var contour = new ContourSeries
11791175 {
1180- var cs = new ContourSeries
1181- {
1182- Color = OxyColors . Black ,
1183- FontSize = 0 ,
1184- ContourLevelStep = 1 ,
1185- LabelBackground = OxyColors . Undefined ,
1186- ColumnCoordinates = yvalues ,
1187- RowCoordinates = xvalues ,
1188- Data = peaksData
1189- } ;
1190- model . Series . Add ( cs ) ;
1191- }
1176+ ColumnCoordinates = y ,
1177+ RowCoordinates = x ,
1178+ Data = data
1179+ } ;
1180+ model . Series . Add ( contour ) ;
11921181
11931182 return model ;
11941183 }
@@ -1631,6 +1620,37 @@ public static PlotModel MinimumRangeAbsoluteMinimumTest()
16311620 return model ;
16321621 }
16331622
1623+ /// Creates a demo PlotModel with the data from the issue.
1624+ /// </summary>
1625+ /// <returns>The created PlotModel</returns>
1626+ [ Example ( "#589: LogarithmicAxis glitches with multiple series containing small data" ) ]
1627+ public static PlotModel LogaritmicAxesSuperExponentialFormatTest ( )
1628+ {
1629+ var model = new PlotModel ( ) ;
1630+ model . Axes . Add ( new LogarithmicAxis
1631+ {
1632+ UseSuperExponentialFormat = true ,
1633+ Position = AxisPosition . Bottom ,
1634+ MajorGridlineStyle = LineStyle . Dot ,
1635+ PowerPadding = true
1636+ } ) ;
1637+
1638+ model . Axes . Add ( new LogarithmicAxis
1639+ {
1640+ UseSuperExponentialFormat = true ,
1641+ Position = AxisPosition . Left ,
1642+ MajorGridlineStyle = LineStyle . Dot ,
1643+ PowerPadding = true
1644+ } ) ;
1645+
1646+ var series1 = new LineSeries ( ) ;
1647+ series1 . Points . Add ( new DataPoint ( 1e5 , 1e-14 ) ) ;
1648+ series1 . Points . Add ( new DataPoint ( 4e7 , 1e-12 ) ) ;
1649+ model . Series . Add ( series1 ) ;
1650+
1651+ return model ;
1652+ }
1653+
16341654 /* NEW ISSUE TEMPLATE
16351655 [Example("#123: Issue Description")]
16361656 public static PlotModel IssueDescription()
0 commit comments