@@ -8,225 +8,45 @@ namespace ExampleLibrary
88{
99 using OxyPlot ;
1010 using OxyPlot . Axes ;
11+ using System . Linq ;
1112
1213 [ Examples ( "LinearColorAxis" ) , Tags ( "Axes" ) ]
1314 public class LinearColorAxisExamples
1415 {
15- [ Example ( "Default palette" ) ]
16- public static PlotModel DefaultPalette ( )
16+ private static PlotModel EnableRenderAsImage ( PlotModel plotModel )
1717 {
18- var model = HeatMapSeriesExamples . CreatePeaks ( null , false ) ;
19- model . Axes . Clear ( ) ;
20- model . Axes . Add ( new LinearColorAxis { Position = AxisPosition . Right } ) ;
21- return model ;
22- }
23-
24- [ Example ( "Jet (200 colors) palette" ) ]
25- public static PlotModel Jet200 ( )
26- {
27- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 200 ) , false ) ;
28- }
29-
30- [ Example ( "Jet (20 colors) palette" ) ]
31- public static PlotModel Jet20 ( )
32- {
33- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 20 ) , false ) ;
34- }
35-
36- [ Example ( "Hue (400 colors) palette" ) ]
37- public static PlotModel Hue400 ( )
38- {
39- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Hue ( 400 ) , false ) ;
40- }
41-
42- [ Example ( "Hue distinct (200 colors) palette" ) ]
43- public static PlotModel HueDistinct200 ( )
44- {
45- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . HueDistinct ( 200 ) , false ) ;
46- }
47-
48- [ Example ( "Hue distinct reversed (200 colors) palette" ) ]
49- public static PlotModel HueDistinctReverse200 ( )
50- {
51- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . HueDistinct ( 200 ) . Reverse ( ) , false ) ;
52- }
53-
54- [ Example ( "Hot (200 colors) palette" ) ]
55- public static PlotModel Hot200 ( )
56- {
57- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Hot ( 200 ) , false ) ;
58- }
59-
60- [ Example ( "Hot (64 colors) palette" ) ]
61- public static PlotModel Hot64 ( )
62- {
63- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Hot64 , false ) ;
18+ var axis = plotModel . Axes . OfType < LinearColorAxis > ( ) . Single ( ) ;
19+ axis . RenderAsImage = true ;
20+ plotModel . Title += " - RenderAsImage" ;
21+ return plotModel ;
6422 }
6523
66- [ Example ( "Hot (30 colors) palette " ) ]
67- public static PlotModel Hot30 ( )
24+ [ Example ( "Peaks " ) ]
25+ public static PlotModel Peaks ( )
6826 {
69- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Hot ( 30 ) , false ) ;
27+ return HeatMapSeriesExamples . CreatePeaks ( null , false ) ;
7028 }
7129
72- [ Example ( "Blue-white-red (200 colors) palette " ) ]
73- public static PlotModel BlueWhiteRed200 ( )
30+ [ Example ( "Peaks - RenderAsImage " ) ]
31+ public static PlotModel PeaksRenderAsImage ( )
7432 {
75- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . BlueWhiteRed ( 200 ) , false ) ;
33+ return EnableRenderAsImage ( Peaks ( ) ) ;
7634 }
7735
78- [ Example ( "Blue-white-red (40 colors) palette" ) ]
79- public static PlotModel BlueWhiteRed40 ( )
80- {
81- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . BlueWhiteRed ( 40 ) , false ) ;
82- }
83-
84- [ Example ( "Black-white-red (500 colors) palette" ) ]
85- public static PlotModel BlackWhiteRed500 ( )
86- {
87- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . BlackWhiteRed ( 500 ) , false ) ;
88- }
89-
90- [ Example ( "Black-white-red (3 colors) palette" ) ]
91- public static PlotModel BlackWhiteRed3 ( )
92- {
93- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . BlackWhiteRed ( 3 ) , false ) ;
94- }
95-
96- [ Example ( "Cool (200 colors) palette" ) ]
97- public static PlotModel Cool200 ( )
98- {
99- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Cool ( 200 ) , false ) ;
100- }
101-
102- [ Example ( "Rainbow (200 colors) palette" ) ]
103- public static PlotModel Rainbow200 ( )
104- {
105- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Rainbow ( 200 ) , false ) ;
106- }
107-
108- [ Example ( "Viridis palette" ) ]
109- public static PlotModel Viridis ( )
110- {
111- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Viridis ( ) , false ) ;
112- }
113-
114- [ Example ( "Plasma palette" ) ]
115- public static PlotModel Plasma ( )
116- {
117- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Plasma ( ) , false ) ;
118- }
119-
120- [ Example ( "Magma palette" ) ]
121- public static PlotModel Magma ( )
122- {
123- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Magma ( ) , false ) ;
124- }
125-
126- [ Example ( "Inferno palette" ) ]
127- public static PlotModel Inferno ( )
128- {
129- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Inferno ( ) , false ) ;
130- }
131-
132- [ Example ( "Cividis palette" ) ]
133- public static PlotModel Cividis ( )
134- {
135- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Cividis ( ) , false ) ;
136- }
137-
138- [ Example ( "Viridis (10 colors) palette" ) ]
139- public static PlotModel Viridis10 ( )
140- {
141- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Viridis ( 10 ) , false ) ;
142- }
143-
144- [ Example ( "Rainbow (7 colors) palette" ) ]
145- public static PlotModel Rainbow7 ( )
146- {
147- return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Rainbow ( 7 ) , false ) ;
148- }
149-
150- [ Example ( "Vertical (6 colors)" ) ]
151- public static PlotModel Vertical_6 ( )
36+ [ Example ( "6 Colors" ) ]
37+ public static PlotModel Horizontal6 ( )
15238 {
15339 return HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 6 ) , false ) ;
15440 }
15541
156- [ Example ( "Vertical reverse (6 colors)" ) ]
157- public static PlotModel Vertical_Reverse_6 ( )
158- {
159- var model = HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 6 ) , false ) ;
160- var colorAxis = ( LinearColorAxis ) model . Axes [ 0 ] ;
161- colorAxis . StartPosition = 1 ;
162- colorAxis . EndPosition = 0 ;
163- return model ;
164- }
165-
166- [ Example ( "Horizontal (6 colors)" ) ]
167- public static PlotModel Horizontal_6 ( )
168- {
169- var model = HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 6 ) , false ) ;
170- var colorAxis = ( LinearColorAxis ) model . Axes [ 0 ] ;
171- colorAxis . Position = AxisPosition . Top ;
172- return model ;
173- }
174-
175- [ Example ( "Horizontal reverse (6 colors)" ) ]
176- public static PlotModel Horizontal_Reverse_6 ( )
177- {
178- var model = HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 6 ) , false ) ;
179- var colorAxis = ( LinearColorAxis ) model . Axes [ 0 ] ;
180- colorAxis . Position = AxisPosition . Top ;
181- colorAxis . StartPosition = 1 ;
182- colorAxis . EndPosition = 0 ;
183- return model ;
184- }
185-
186- [ Example ( "RenderAsImage (horizontal)" ) ]
187- public static PlotModel RenderAsImage_Horizontal ( )
188- {
189- var model = HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 1000 ) , false ) ;
190- var colorAxis = ( LinearColorAxis ) model . Axes [ 0 ] ;
191- colorAxis . RenderAsImage = true ;
192- colorAxis . Position = AxisPosition . Top ;
193- return model ;
194- }
195-
196- [ Example ( "RenderAsImage (horizontal reversed)" ) ]
197- public static PlotModel RenderAsImage_Horizontal_Reversed ( )
42+ [ Example ( "6 Colors - RenderAsImage" ) ]
43+ public static PlotModel Horizontal6RenderAsImage ( )
19844 {
199- var model = HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 1000 ) , false ) ;
200- var colorAxis = ( LinearColorAxis ) model . Axes [ 0 ] ;
201- colorAxis . RenderAsImage = true ;
202- colorAxis . Position = AxisPosition . Top ;
203- colorAxis . StartPosition = 1 ;
204- colorAxis . EndPosition = 0 ;
205- return model ;
45+ return EnableRenderAsImage ( Horizontal6 ( ) ) ;
20646 }
20747
208- [ Example ( "RenderAsImage (vertical)" ) ]
209- public static PlotModel RenderAsImage_Vertical ( )
210- {
211- var model = HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 1000 ) , false ) ;
212- var colorAxis = ( LinearColorAxis ) model . Axes [ 0 ] ;
213- colorAxis . RenderAsImage = true ;
214- return model ;
215- }
216-
217- [ Example ( "RenderAsImage (vertical reversed)" ) ]
218- public static PlotModel RenderAsImage_Vertical_Reversed ( )
219- {
220- var model = HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 1000 ) , false ) ;
221- var colorAxis = ( LinearColorAxis ) model . Axes [ 0 ] ;
222- colorAxis . RenderAsImage = true ;
223- colorAxis . StartPosition = 1 ;
224- colorAxis . EndPosition = 0 ;
225- return model ;
226- }
227-
228- [ Example ( "Short vertical" ) ]
229- public static PlotModel Vertical_Short ( )
48+ [ Example ( "Short" ) ]
49+ public static PlotModel Short ( )
23050 {
23151 var model = HeatMapSeriesExamples . CreatePeaks ( OxyPalettes . Jet ( 600 ) , false ) ;
23252 var colorAxis = ( LinearColorAxis ) model . Axes [ 0 ] ;
@@ -235,6 +55,12 @@ public static PlotModel Vertical_Short()
23555 return model ;
23656 }
23757
58+ [ Example ( "Short - RenderAsImage" ) ]
59+ public static PlotModel ShortRenderAsImage ( )
60+ {
61+ return EnableRenderAsImage ( Short ( ) ) ;
62+ }
63+
23864 [ Example ( "Position None" ) ]
23965 public static PlotModel Position_None ( )
24066 {
0 commit comments