@@ -5,7 +5,7 @@ use plotly::{
5
5
color:: { NamedColor , Rgb , Rgba } ,
6
6
common:: {
7
7
ColorScale , ColorScalePalette , DashType , Fill , Font , Line , LineShape , Marker , Mode ,
8
- Orientation , Title ,
8
+ Orientation ,
9
9
} ,
10
10
layout:: { Axis , BarMode , Layout , Legend , TicksDirection , TraceOrder } ,
11
11
sankey:: { Line as SankeyLine , Link , Node } ,
@@ -117,9 +117,9 @@ fn data_labels_hover() {
117
117
plot. add_trace ( trace2) ;
118
118
119
119
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. ] ) ) ;
123
123
plot. set_layout ( layout) ;
124
124
125
125
plot. show ( ) ;
@@ -142,7 +142,7 @@ fn data_labels_on_the_plot() {
142
142
plot. add_trace ( trace2) ;
143
143
144
144
let layout = Layout :: new ( )
145
- . title ( "Data Labels on the Plot" . into ( ) )
145
+ . title ( "Data Labels on the Plot" )
146
146
. x_axis ( Axis :: new ( ) . range ( vec ! [ 0.75 , 5.25 ] ) )
147
147
. y_axis ( Axis :: new ( ) . range ( vec ! [ 0. , 8. ] ) ) ;
148
148
plot. set_layout ( layout) ;
@@ -215,14 +215,14 @@ fn colored_and_styled_scatter_plot() {
215
215
. marker ( Marker :: new ( ) . color ( Rgb :: new ( 142 , 124 , 195 ) ) . size ( 12 ) ) ;
216
216
217
217
let layout = Layout :: new ( )
218
- . title ( Title :: new ( "Quarter 1 Growth" ) )
218
+ . title ( "Quarter 1 Growth" )
219
219
. x_axis (
220
220
Axis :: new ( )
221
- . title ( Title :: new ( "GDP per Capita" ) )
221
+ . title ( "GDP per Capita" )
222
222
. show_grid ( false )
223
223
. zero_line ( false ) ,
224
224
)
225
- . y_axis ( Axis :: new ( ) . title ( Title :: new ( "Percent" ) ) . show_line ( false ) ) ;
225
+ . y_axis ( Axis :: new ( ) . title ( "Percent" ) . show_line ( false ) ) ;
226
226
let mut plot = Plot :: new ( ) ;
227
227
plot. add_trace ( trace1) ;
228
228
plot. add_trace ( trace2) ;
@@ -279,7 +279,7 @@ fn adding_names_to_line_and_scatter_plot() {
279
279
. mode ( Mode :: LinesMarkers )
280
280
. name ( "Scatter + Lines" ) ;
281
281
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" ) ;
283
283
let mut plot = Plot :: new ( ) ;
284
284
plot. add_trace ( trace1) ;
285
285
plot. add_trace ( trace2) ;
@@ -304,7 +304,7 @@ fn line_and_scatter_styling() {
304
304
. marker ( Marker :: new ( ) . color ( Rgb :: new ( 128 , 0 , 128 ) ) . size ( 12 ) )
305
305
. line ( Line :: new ( ) . color ( Rgb :: new ( 128 , 0 , 128 ) ) . width ( 1.0 ) ) ;
306
306
307
- let layout = Layout :: new ( ) . title ( Title :: new ( "Line and Scatter Styling" ) ) ;
307
+ let layout = Layout :: new ( ) . title ( "Line and Scatter Styling" ) ;
308
308
let mut plot = Plot :: new ( ) ;
309
309
plot. add_trace ( trace1) ;
310
310
plot. add_trace ( trace2) ;
@@ -325,7 +325,7 @@ fn styling_line_plot() {
325
325
. line ( Line :: new ( ) . color ( Rgb :: new ( 55 , 128 , 191 ) ) . width ( 1.0 ) ) ;
326
326
327
327
let layout = Layout :: new ( )
328
- . title ( Title :: new ( "Styling Line Plot" ) )
328
+ . title ( "Styling Line Plot" )
329
329
. width ( 500 )
330
330
. height ( 500 ) ;
331
331
let mut plot = Plot :: new ( ) ;
@@ -594,7 +594,7 @@ fn basic_sankey_diagram() {
594
594
) ;
595
595
596
596
let layout = Layout :: new ( )
597
- . title ( "Basic Sankey" . into ( ) )
597
+ . title ( "Basic Sankey" )
598
598
. font ( Font :: new ( ) . size ( 10 ) ) ;
599
599
600
600
let mut plot = Plot :: new ( ) ;
0 commit comments