parameters: (self, plot_kwargs)
docstring: Replot the selected curve with the given plot kwargs
docstring_summary: Replot the selected curve with the given plot kwargs
docstring_tokens: Replot the selected curve with the given plot kwargs
function: def _replot_current_curve(self, plot_kwargs):
          """Replot the selected curve with the given plot kwargs"""
          ax = self.get_selected_ax()
          curve = self.get_current_curve()
  
          waterfall = False
          if isinstance(ax, MantidAxes):
              waterfall = ax.is_waterfall()
          check_line_colour = False
          # If the plot is a waterfall plot and the user has set it so the area under each line is filled, and the fill
          # colour for each line is set as the line colour, after the curve is updated we need to check if its colour has
          # changed so the fill can be updated accordingly.
          if waterfall and ax.waterfall_has_fill() and datafunctions.waterfall_fill_is_line_colour(ax):
              check_line_colour = True
  
          if isinstance(curve, Line2D):
              curve_index = ax.get_lines().index(curve)
              errorbar = False
          else:
              curve_index = ax.get_lines().index(curve[0])
              errorbar = True
  
          # When you remove the curve on a waterfall plot, the remaining curves are repositioned so that they are
          # equally spaced apart. However since the curve is being replotted we don't want that to happen, so here
          # the waterfall offsets are set to 0 so the plot appears to be non-waterfall. The offsets are then re-set
          # after the curve is replotted.
          if waterfall:
              x_offset, y_offset = ax.waterfall_x_offset, ax.waterfall_y_offset
              ax.waterfall_x_offset = ax.waterfall_y_offset = 0
  
          new_curve = FigureErrorsManager.replot_curve(ax, curve, plot_kwargs)
          self.curve_names_dict[self.view.get_current_curve_name()] = new_curve
  
          if isinstance(ax, MantidAxes):
              errorbar_cap_lines = datafunctions.remove_and_return_errorbar_cap_lines(ax)
          else:
              errorbar_cap_lines = []
  
          # When a curve is redrawn it is moved to the back of the list of curves so here it is moved back to its previous
          # position. This is so that the correct offset is applied to the curve if the plot is a waterfall plot, but it
          # also just makes sense for the curve order to remain unchanged.
          ax.lines.insert(curve_index, ax.lines.pop())
  
          if waterfall:
              # Set the waterfall offsets to what they were previously.
              ax.waterfall_x_offset, ax.waterfall_y_offset = x_offset, y_offset
              if check_line_colour:
                  # curve can be either a Line2D or an ErrorContainer and the colour is accessed differently for each.
                  if not errorbar:
                      # if the line colour hasn't changed then the fill colour doesn't need to be updated.
                      update_fill = curve.get_color() != new_curve[0].get_color()
                  else:
                      update_fill = curve[0].get_color() != new_curve[0].get_color()
                  datafunctions.convert_single_line_to_waterfall(ax, curve_index, need_to_update_fill=update_fill)
              else:
                  # the curve has been reset to its original position so for a waterfall plot it needs to be re-offset.
                  datafunctions.convert_single_line_to_waterfall(ax, curve_index)
  
              datafunctions.set_waterfall_fill_visible(ax, curve_index)
  
          ax.lines += errorbar_cap_lines
function_tokens: def _replot_current_curve ( self , plot_kwargs ) : ax = self . get_selected_ax ( ) curve = self . get_current_curve ( ) waterfall = False if isinstance ( ax , MantidAxes ) : waterfall = ax . is_waterfall ( ) check_line_colour = False # If the plot is a waterfall plot and the user has set it so the area under each line is filled, and the fill # colour for each line is set as the line colour, after the curve is updated we need to check if its colour has # changed so the fill can be updated accordingly. if waterfall and ax . waterfall_has_fill ( ) and datafunctions . waterfall_fill_is_line_colour ( ax ) : check_line_colour = True if isinstance ( curve , Line2D ) : curve_index = ax . get_lines ( ) . index ( curve ) errorbar = False else : curve_index = ax . get_lines ( ) . index ( curve [ 0 ] ) errorbar = True # When you remove the curve on a waterfall plot, the remaining curves are repositioned so that they are # equally spaced apart. However since the curve is being replotted we don't want that to happen, so here # the waterfall offsets are set to 0 so the plot appears to be non-waterfall. The offsets are then re-set # after the curve is replotted. if waterfall : x_offset , y_offset = ax . waterfall_x_offset , ax . waterfall_y_offset ax . waterfall_x_offset = ax . waterfall_y_offset = 0 new_curve = FigureErrorsManager . replot_curve ( ax , curve , plot_kwargs ) self . curve_names_dict [ self . view . get_current_curve_name ( ) ] = new_curve if isinstance ( ax , MantidAxes ) : errorbar_cap_lines = datafunctions . remove_and_return_errorbar_cap_lines ( ax ) else : errorbar_cap_lines = [ ] # When a curve is redrawn it is moved to the back of the list of curves so here it is moved back to its previous # position. This is so that the correct offset is applied to the curve if the plot is a waterfall plot, but it # also just makes sense for the curve order to remain unchanged. ax . lines . insert ( curve_index , ax . lines . pop ( ) ) if waterfall : # Set the waterfall offsets to what they were previously. ax . waterfall_x_offset , ax . waterfall_y_offset = x_offset , y_offset if check_line_colour : # curve can be either a Line2D or an ErrorContainer and the colour is accessed differently for each. if not errorbar : # if the line colour hasn't changed then the fill colour doesn't need to be updated. update_fill = curve . get_color ( ) != new_curve [ 0 ] . get_color ( ) else : update_fill = curve [ 0 ] . get_color ( ) != new_curve [ 0 ] . get_color ( ) datafunctions . convert_single_line_to_waterfall ( ax , curve_index , need_to_update_fill = update_fill ) else : # the curve has been reset to its original position so for a waterfall plot it needs to be re-offset. datafunctions . convert_single_line_to_waterfall ( ax , curve_index ) datafunctions . set_waterfall_fill_visible ( ax , curve_index ) ax . lines += errorbar_cap_lines