@@ -5,7 +5,7 @@ use plotly::{
55 color:: { NamedColor , Rgb , Rgba } ,
66 common:: {
77 ColorScale , ColorScalePalette , DashType , Fill , Font , Line , LineShape , Marker , Mode ,
8- Orientation , Title ,
8+ Orientation ,
99 } ,
1010 layout:: { Axis , BarMode , Layout , Legend , TicksDirection , TraceOrder } ,
1111 sankey:: { Line as SankeyLine , Link , Node } ,
@@ -117,9 +117,9 @@ fn data_labels_hover() {
117117 plot. add_trace ( trace2) ;
118118
119119 let layout = Layout :: new ( )
120- . title ( "Data Labels Hover" . into ( ) )
121- . x_axis ( Axis :: new ( ) . title ( "x" . into ( ) ) . range ( vec ! [ 0.75 , 5.25 ] ) )
122- . y_axis ( Axis :: new ( ) . title ( "y" . into ( ) ) . range ( vec ! [ 0. , 8. ] ) ) ;
120+ . title ( "Data Labels Hover" )
121+ . x_axis ( Axis :: new ( ) . title ( "x" ) . range ( vec ! [ 0.75 , 5.25 ] ) )
122+ . y_axis ( Axis :: new ( ) . title ( "y" ) . range ( vec ! [ 0. , 8. ] ) ) ;
123123 plot. set_layout ( layout) ;
124124
125125 plot. show ( ) ;
@@ -142,7 +142,7 @@ fn data_labels_on_the_plot() {
142142 plot. add_trace ( trace2) ;
143143
144144 let layout = Layout :: new ( )
145- . title ( "Data Labels on the Plot" . into ( ) )
145+ . title ( "Data Labels on the Plot" )
146146 . x_axis ( Axis :: new ( ) . range ( vec ! [ 0.75 , 5.25 ] ) )
147147 . y_axis ( Axis :: new ( ) . range ( vec ! [ 0. , 8. ] ) ) ;
148148 plot. set_layout ( layout) ;
@@ -215,14 +215,14 @@ fn colored_and_styled_scatter_plot() {
215215 . marker ( Marker :: new ( ) . color ( Rgb :: new ( 142 , 124 , 195 ) ) . size ( 12 ) ) ;
216216
217217 let layout = Layout :: new ( )
218- . title ( Title :: new ( "Quarter 1 Growth" ) )
218+ . title ( "Quarter 1 Growth" )
219219 . x_axis (
220220 Axis :: new ( )
221- . title ( Title :: new ( "GDP per Capita" ) )
221+ . title ( "GDP per Capita" )
222222 . show_grid ( false )
223223 . zero_line ( false ) ,
224224 )
225- . y_axis ( Axis :: new ( ) . title ( Title :: new ( "Percent" ) ) . show_line ( false ) ) ;
225+ . y_axis ( Axis :: new ( ) . title ( "Percent" ) . show_line ( false ) ) ;
226226 let mut plot = Plot :: new ( ) ;
227227 plot. add_trace ( trace1) ;
228228 plot. add_trace ( trace2) ;
@@ -279,7 +279,7 @@ fn adding_names_to_line_and_scatter_plot() {
279279 . mode ( Mode :: LinesMarkers )
280280 . name ( "Scatter + Lines" ) ;
281281
282- let layout = Layout :: new ( ) . title ( Title :: new ( "Adding Names to Line and Scatter Plot" ) ) ;
282+ let layout = Layout :: new ( ) . title ( "Adding Names to Line and Scatter Plot" ) ;
283283 let mut plot = Plot :: new ( ) ;
284284 plot. add_trace ( trace1) ;
285285 plot. add_trace ( trace2) ;
@@ -304,7 +304,7 @@ fn line_and_scatter_styling() {
304304 . marker ( Marker :: new ( ) . color ( Rgb :: new ( 128 , 0 , 128 ) ) . size ( 12 ) )
305305 . line ( Line :: new ( ) . color ( Rgb :: new ( 128 , 0 , 128 ) ) . width ( 1.0 ) ) ;
306306
307- let layout = Layout :: new ( ) . title ( Title :: new ( "Line and Scatter Styling" ) ) ;
307+ let layout = Layout :: new ( ) . title ( "Line and Scatter Styling" ) ;
308308 let mut plot = Plot :: new ( ) ;
309309 plot. add_trace ( trace1) ;
310310 plot. add_trace ( trace2) ;
@@ -325,7 +325,7 @@ fn styling_line_plot() {
325325 . line ( Line :: new ( ) . color ( Rgb :: new ( 55 , 128 , 191 ) ) . width ( 1.0 ) ) ;
326326
327327 let layout = Layout :: new ( )
328- . title ( Title :: new ( "Styling Line Plot" ) )
328+ . title ( "Styling Line Plot" )
329329 . width ( 500 )
330330 . height ( 500 ) ;
331331 let mut plot = Plot :: new ( ) ;
@@ -594,7 +594,7 @@ fn basic_sankey_diagram() {
594594 ) ;
595595
596596 let layout = Layout :: new ( )
597- . title ( "Basic Sankey" . into ( ) )
597+ . title ( "Basic Sankey" )
598598 . font ( Font :: new ( ) . size ( 10 ) ) ;
599599
600600 let mut plot = Plot :: new ( ) ;
0 commit comments