@@ -667,8 +667,12 @@ impl Axes2D
667667 self
668668 }
669669
670- /// Plot a 2D scatter-plot using boxes of automatic width. Box widths are set so that there are no gaps between successive boxes (i.e. each box may have a different width).
670+ /// Plot a 2D box-plot.
671+ /// Box widths are, by default set so that there are no gaps between successive boxes
672+ /// (i.e. each box may have a different width). This may be adjusted with (set_box_width())[Axes2D::set_box_width()]
673+ /// or by using the `BoxWidth` option.
671674 /// Boxes start at the x-axis and go towards the y value of the datapoint.
675+ ///
672676 /// # Arguments
673677 /// * `x` - x values (center of the box)
674678 /// * `y` - y values
@@ -679,6 +683,8 @@ impl Axes2D
679683 /// * `BorderColor` - Sets the color of the border
680684 /// * `Color` - Sets the color of the box fill
681685 /// * `FillAlpha` - Sets the transparency of the box fill
686+ /// * `BoxWidth` - Sets the width of each box. If not supplied, the width will use the
687+ /// previously set box width, or be set to the spacing of the boxes
682688 pub fn boxes <
683689 ' l ,
684690 Tx : DataType ,
@@ -696,42 +702,13 @@ impl Axes2D
696702 self
697703 }
698704
699- /// Plot a 2D scatter-plot using boxes of set (per box) width.
700- /// Boxes start at the x-axis and go towards the y value of the datapoint.
701- /// # Arguments
702- /// * `x` - x values (center of the box)
703- /// * `y` - y values
704- /// * `w` - Box width values
705- /// * `options` - Array of PlotOption<&str> controlling the appearance of the plot element. The relevant options are:
706- /// * `Caption` - Specifies the caption for this dataset. Use an empty string to hide it (default).
707- /// * `LineWidth` - Sets the width of the border
708- /// * `LineStyle` - Sets the style of the border
709- /// * `BorderColor` - Sets the color of the border
710- /// * `Color` - Sets the color of the box fill
711- /// * `FillAlpha` - Sets the transparency of the box fill
712- pub fn boxes_set_width <
713- ' l ,
714- Tx : DataType ,
715- X : IntoIterator < Item = Tx > ,
716- Ty : DataType ,
717- Y : IntoIterator < Item = Ty > ,
718- Tw : DataType ,
719- W : IntoIterator < Item = Tw > ,
720- > (
721- & ' l mut self , x : X , y : Y , w : W , options : & [ PlotOption < & str > ] ,
722- ) -> & ' l mut Self
723- {
724- let ( data, num_rows, num_cols) = generate_data ! ( options, x, y, w) ;
725- self . common . elems . push ( PlotElement :: new_plot (
726- Boxes , data, num_rows, num_cols, options,
727- ) ) ;
728- self
729- }
730-
731705 /// Plot a 2D box-plot with error bars using boxes of automatic width.
732- /// Box widths are set so that there are no gaps between successive boxes (i.e. each box may have a different width).
706+ /// Box widths are, by default set so that there are no gaps between successive boxes
707+ /// (i.e. each box may have a different width). This may be adjusted with (set_box_width())[Axes2D::set_box_width()]
708+ /// or by using the `BoxWidth` option.
733709 /// Boxes start at the x-axis and go towards the y value of the datapoint.
734710 /// Each box has an error bar from y - y_delta to y + y_delta.
711+ ///
735712 /// # Arguments
736713 /// * `x` - x values (center of the box)
737714 /// * `y` - y values
@@ -743,6 +720,8 @@ impl Axes2D
743720 /// * `BorderColor` - Sets the color of the border
744721 /// * `Color` - Sets the color of the box fill
745722 /// * `FillAlpha` - Sets the transparency of the box fill
723+ /// * `BoxWidth` - Sets the width of each box. If not supplied, the width will use the
724+ /// previously set box width, or be set to the spacing of the boxes
746725 pub fn box_error_delta <
747726 ' l ,
748727 Tx : DataType ,
@@ -766,49 +745,10 @@ impl Axes2D
766745 self
767746 }
768747
769- /// Plot a 2D box-plot with error bars using boxes of specified width.
770- /// Box widths are set so that there are no gaps between successive boxes (i.e. each box may have a different width).
771- /// Boxes start at the x-axis and go towards the y value of the datapoint.
772- /// Each box has an error bar from y - y_delta to y + y_delta.
773- /// # Arguments
774- /// * `x` - x values (center of the box)
775- /// * `y` - y values
776- /// * `y_delta` - errors in y (error bars are plotted from y - y_delta to y + y_delta)
777- /// * `x_delta` - errors in x (interpreted as box width)
778- /// * `options` - Array of PlotOption<&str> controlling the appearance of the plot element. The relevant options are:
779- /// * `Caption` - Specifies the caption for this dataset. Use an empty string to hide it (default).
780- /// * `LineWidth` - Sets the width of the border
781- /// * `LineStyle` - Sets the style of the border
782- /// * `BorderColor` - Sets the color of the border
783- /// * `Color` - Sets the color of the box fill
784- /// * `FillAlpha` - Sets the transparency of the box fill
785- pub fn box_error_delta_set_width <
786- ' l ,
787- Tx : DataType ,
788- X : IntoIterator < Item = Tx > ,
789- Ty : DataType ,
790- Y : IntoIterator < Item = Ty > ,
791- Tye : DataType ,
792- YE : IntoIterator < Item = Tye > ,
793- Tw : DataType ,
794- W : IntoIterator < Item = Tw > ,
795- > (
796- & ' l mut self , x : X , y : Y , y_error : YE , x_delta : W , options : & [ PlotOption < & str > ] ,
797- ) -> & ' l mut Self
798- {
799- let ( data, num_rows, num_cols) = generate_data ! ( options, x, y, y_error, x_delta) ;
800- self . common . elems . push ( PlotElement :: new_plot (
801- BoxErrorBars ,
802- data,
803- num_rows,
804- num_cols,
805- options,
806- ) ) ;
807- self
808- }
809-
810- /// Plot a 2D box-plot with error bars using boxes of automatic width.
811- /// Box widths are set so that there are no gaps between successive boxes (i.e. each box may have a different width).
748+ /// Plot a 2D box-plot with error bars.
749+ /// Box widths are, by default set so that there are no gaps between successive boxes
750+ /// (i.e. each box may have a different width). This may be adjusted with (set_box_width())[Axes2D::set_box_width()]
751+ /// or by using the `BoxWidth` option.
812752 /// Boxes start at the x-axis and go towards the y value of the datapoint.
813753 /// Each box has an error bar from y - y_low to y + y_high.
814754 /// # Arguments
@@ -823,6 +763,8 @@ impl Axes2D
823763 /// * `BorderColor` - Sets the color of the border
824764 /// * `Color` - Sets the color of the box fill
825765 /// * `FillAlpha` - Sets the transparency of the box fill
766+ /// * `BoxWidth` - Sets the width of each box. If not supplied, the width will use the
767+ /// previously set box width, or be set to the spacing of the boxes
826768 pub fn box_error_low_high <
827769 ' l ,
828770 Tx : DataType ,
@@ -851,51 +793,11 @@ impl Axes2D
851793 self
852794 }
853795
854- /// Plot a 2D box-plot with error bars using boxes of specified width.
855- /// Box widths are set so that there are no gaps between successive boxes (i.e. each box may have a different width).
856- /// Boxes start at the x-axis and go towards the y value of the datapoint.
857- /// Each box has an error bar from y - y_low to y + y_high.
858- /// # Arguments
859- /// * `x` - x values (center of the box)
860- /// * `y` - y values
861- /// * `y_low` - minimum of error bar
862- /// * `y_high` - maximum of error bar
863- /// * `x_delta` - errors in x (interpreted as box width)
864- /// * `options` - Array of PlotOption<&str> controlling the appearance of the plot element. The relevant options are:
865- /// * `Caption` - Specifies the caption for this dataset. Use an empty string to hide it (default).
866- /// * `LineWidth` - Sets the width of the border
867- /// * `LineStyle` - Sets the style of the border
868- /// * `BorderColor` - Sets the color of the border
869- /// * `Color` - Sets the color of the box fill
870- /// * `FillAlpha` - Sets the transparency of the box fill
871- pub fn box_error_low_high_set_width <
872- ' l ,
873- Tx : DataType ,
874- X : IntoIterator < Item = Tx > ,
875- Ty : DataType ,
876- Y : IntoIterator < Item = Ty > ,
877- Tyl : DataType ,
878- YL : IntoIterator < Item = Tyl > ,
879- Tyh : DataType ,
880- YH : IntoIterator < Item = Tyh > ,
881- Tw : DataType ,
882- W : IntoIterator < Item = Tw > ,
883- > (
884- & ' l mut self , x : X , y : Y , y_low : YL , y_high : YH , x_delta : W , options : & [ PlotOption < & str > ] ,
885- ) -> & ' l mut Self
886- {
887- let ( data, num_rows, num_cols) = generate_data ! ( options, x, y, y_low, y_high, x_delta) ;
888- self . common . elems . push ( PlotElement :: new_plot (
889- BoxErrorBars ,
890- data,
891- num_rows,
892- num_cols,
893- options,
894- ) ) ;
895- self
896- }
897-
898- /// Plot a 2D box-and-whisker plot using boxes of automatic width.
796+ /// Plot a 2D box-and-whisker plot.
797+ ///
798+ /// Box widths are, by default set so that there are no gaps between successive boxes
799+ /// (i.e. each box may have a different width). This may be adjusted with (set_box_width())[Axes2D::set_box_width()]
800+ /// or by using the `BoxWidth` option.
899801 ///
900802 /// # Arguments
901803 /// * `x` - x values (center of the box)
@@ -911,6 +813,8 @@ impl Axes2D
911813 /// * `Color` - Sets the color of the box fill
912814 /// * `FillAlpha` - Sets the transparency of the box fill
913815 /// * `WhiskerBars` - Sets the width of the whisker bars
816+ /// * `BoxWidth` - Sets the width of each box. If not supplied, the width will use the
817+ /// previously set box width, or be set to the spacing of the boxes
914818 pub fn box_and_whisker <
915819 ' l ,
916820 Tx : DataType ,
@@ -940,61 +844,6 @@ impl Axes2D
940844 self
941845 }
942846
943- /// Plot a 2D box-and-whisker plot using boxes of set width.
944- ///
945- /// # Arguments
946- /// * `x` - x values (center of the box)
947- /// * `box_min` - minimum box y value
948- /// * `whisker_min` - minimum whisker y value
949- /// * `whisker_max` - maximum whisker y value
950- /// * `box_max` - maximum box y value
951- /// * `box_width` - width of the box (in x axis units)
952- /// * `options` - Array of PlotOption<&str> controlling the appearance of the plot element. The relevant options are:
953- /// * `Caption` - Specifies the caption for this dataset. Use an empty string to hide it (default).
954- /// * `LineWidth` - Sets the width of the border
955- /// * `LineStyle` - Sets the style of the border
956- /// * `BorderColor` - Sets the color of the border
957- /// * `Color` - Sets the color of the box fill
958- /// * `FillAlpha` - Sets the transparency of the box fill
959- /// * `WhiskerBars` - Sets the width of the whisker bars
960- pub fn box_and_whisker_set_width <
961- ' l ,
962- Tx : DataType ,
963- X : IntoIterator < Item = Tx > ,
964- TBoxMin : DataType ,
965- BoxMin : IntoIterator < Item = TBoxMin > ,
966- TWhiskerMin : DataType ,
967- WhiskerMin : IntoIterator < Item = TWhiskerMin > ,
968- TWhiskerMax : DataType ,
969- WhiskerMax : IntoIterator < Item = TWhiskerMax > ,
970- TBoxMax : DataType ,
971- BoxMax : IntoIterator < Item = TBoxMax > ,
972- TBoxWidth : DataType ,
973- BoxWidth : IntoIterator < Item = TBoxWidth > ,
974- > (
975- & ' l mut self , x : X , box_min : BoxMin , whisker_min : WhiskerMin , whisker_max : WhiskerMax ,
976- box_max : BoxMax , box_width : BoxWidth , options : & [ PlotOption < & str > ] ,
977- ) -> & ' l mut Self
978- {
979- let ( data, num_rows, num_cols) = generate_data ! (
980- options,
981- x,
982- box_min,
983- whisker_min,
984- whisker_max,
985- box_max,
986- box_width
987- ) ;
988- self . common . elems . push ( PlotElement :: new_plot (
989- BoxAndWhisker ,
990- data,
991- num_rows,
992- num_cols,
993- options,
994- ) ) ;
995- self
996- }
997-
998847 /// Plot 2D rectangular boxes - usually used for error bars - using specified by width (x_delta) and height (y_delta).
999848 ///
1000849 /// # Arguments
0 commit comments