fn transform_text(&self, slope: f64) -> String {
        let flip = if slope < 0.0 { !self.above } else { self.above };
        let mut opt = String::new();
        if self.offset_v > 0.0 || self.text_offset_v > 0.0 {
            let dv = if flip {
                (self.offset_v + self.text_offset_v) * f64::signum(slope)
            } else {
                -(self.offset_v + self.text_offset_v) * f64::signum(slope)
            };
            write!(
                &mut opt,
                "tfx=tra.offset_copy(plt.gca().transAxes,fig=plt.gcf(),x=0,y={},units='points')\n",
                dv,
            )
            .unwrap();
        } else {
            opt.push_str("tfx=plt.gca().transAxes\n");
        }
        if self.offset_v > 0.0 || self.text_offset_h > 0.0 {
            let dv = if flip {
                self.offset_v * f64::signum(slope)
            } else {
                -self.offset_v * f64::signum(slope)
            };
            let dh = if flip { -self.text_offset_h } else { self.text_offset_h };
            write!(
                &mut opt,
                "tfy=tra.offset_copy(plt.gca().transAxes,fig=plt.gcf(),x={},y={},units='points')\n",
                dh, dv,
            )
            .unwrap();
        } else {
            opt.push_str("tfy=plt.gca().transAxes\n");
        }
        opt
    }
/// Returns the coordinate transform for text
Returns the coordinate transform for text
Returns the coordinate transform for text
fn transform_text(&self, slope: f64) -> String {
        let flip = if slope < 0.0 { !self.above } else { self.above };
        let mut opt = String::new();
        if self.offset_v > 0.0 || self.text_offset_v > 0.0 {
            let dv = if flip {
                (self.offset_v + self.text_offset_v) * f64::signum(slope)
            } else {
                -(self.offset_v + self.text_offset_v) * f64::signum(slope)
            };
            write!(
                &mut opt,
                "tfx=tra.offset_copy(plt.gca().transAxes,fig=plt.gcf(),x=0,y={},units='points')\n",
                dv,
            )
            .unwrap();
        } else {
            opt.push_str("tfx=plt.gca().transAxes\n");
        }
        if self.offset_v > 0.0 || self.text_offset_h > 0.0 {
            let dv = if flip {
                self.offset_v * f64::signum(slope)
            } else {
                -self.offset_v * f64::signum(slope)
            };
            let dh = if flip { -self.text_offset_h } else { self.text_offset_h };
            write!(
                &mut opt,
                "tfy=tra.offset_copy(plt.gca().transAxes,fig=plt.gcf(),x={},y={},units='points')\n",
                dh, dv,
            )
            .unwrap();
        } else {
            opt.push_str("tfy=plt.gca().transAxes\n");
        }
        opt
    }
fn transform_text ( & self , slope : f64 ) -> String { let flip = if slope < 0.0 { ! self . above } else { self . above } ; let mut opt = String :: new ( ) ; if self . offset_v > 0.0 || self . text_offset_v > 0.0 { let dv = if flip { ( self . offset_v + self . text_offset_v ) * f64 :: signum ( slope ) } else { - ( self . offset_v + self . text_offset_v ) * f64 :: signum ( slope ) } ; write ! ( mut opt " \n " dv ) . unwrap ( ) ; } else { opt . push_str ( " \n " ) ; } if self . offset_v > 0.0 || self . text_offset_h > 0.0 { let dv = if flip { self . offset_v * f64 :: signum ( slope ) } else { - self . offset_v * f64 :: signum ( slope ) } ; let dh = if flip { - self . text_offset_h } else { self . text_offset_h } ; write ! ( mut opt " \n " dh dv ) . unwrap ( ) ; } else { opt . push_str ( " \n " ) ; } opt }
Returns the coordinate transform for text
Returns the coordinate transform for text
&self
slope
f64
&self
slope
f64