def _setup_plots(self):
    if self._plot_valid:
        return
    for plot in self.plots.values():
        plot.axes.cla()
    for line in self.lines:
        dimensions_counter = defaultdict(int)
        for field in self.fields:
            finfo = self.ds.field_info[field]
            dimensions = Unit(finfo.units, registry=self.ds.unit_registry).dimensions
            dimensions_counter[dimensions] += 1
        for field in self.fields:
            plot = self._get_plot_instance(field)
            (x, y) = self.ds.coordinates.pixelize_line(field, line.start_point, line.end_point, line.npoints)
            if (self._x_unit is None):
                unit_x = x.units
            else:
                unit_x = self._x_unit
            if (field in self._y_units):
                unit_y = self._y_units[field]
            else:
                unit_y = y.units
            x = x.to(unit_x)
            y = y.to(unit_y)
            str_seq = []
            str_seq.append(line.label)
            str_seq.append(self.field_labels[field])
            delim = '; '
            legend_label = delim.join(filter(None, str_seq))
            plot.axes.plot(x, y, label=legend_label)
            if (self._field_transform[field] != linear_transform):
                if (y < 0).any():
                    plot.axes.set_yscale('symlog')
                else:
                    plot.axes.set_yscale('log')
            plot._set_font_properties(self._font_properties, None)
            axes_unit_labels = self._get_axes_unit_labels(unit_x, unit_y)
            if (self._xlabel is not None):
                x_label = self._xlabel
            else:
                x_label = (('$\\rm{Path\\ Length' + axes_unit_labels[0]) + '}$')
            if (self._ylabel is not None):
                y_label = self._ylabel
            else:
                finfo = self.ds.field_info[field]
                dimensions = Unit(finfo.units, registry=self.ds.unit_registry).dimensions
                if (dimensions_counter[dimensions] > 1):
                    y_label = ((('$\\rm{Multiple\\ Fields}$' + '$\\rm{') + axes_unit_labels[1]) + '}$')
                else:
                    y_label = (((finfo.get_latex_display_name() + '$\\rm{') + axes_unit_labels[1]) + '}$')
            plot.axes.set_xlabel(x_label)
            plot.axes.set_ylabel(y_label)
            if (field in self._titles):
                plot.axes.set_title(self._titles[field])
            dim_field = self.plots._sanitize_dimensions(field)
            if self.include_legend[dim_field]:
                plot.axes.legend()
    self._plot_valid = True
def _setup_plots(self):
    if self._plot_valid:
        return
    for plot in self.plots.values():
        plot.axes.cla()
    for line in self.lines:
        dimensions_counter = defaultdict(int)
        for field in self.fields:
            finfo = self.ds.field_info[field]
            dimensions = Unit(finfo.units, registry=self.ds.unit_registry).dimensions
            dimensions_counter[dimensions] += 1
        for field in self.fields:
            plot = self._get_plot_instance(field)
            (x, y) = self.ds.coordinates.pixelize_line(field, line.start_point, line.end_point, line.npoints)
            if (self._x_unit is None):
                unit_x = x.units
            else:
                unit_x = self._x_unit
            if (field in self._y_units):
                unit_y = self._y_units[field]
            else:
                unit_y = y.units
            x = x.to(unit_x)
            y = y.to(unit_y)
            str_seq = []
            str_seq.append(line.label)
            str_seq.append(self.field_labels[field])
            delim = '; '
            legend_label = delim.join(filter(None, str_seq))
            plot.axes.plot(x, y, label=legend_label)
            if (self._field_transform[field] != linear_transform):
                if (y < 0).any():
                    plot.axes.set_yscale('symlog')
                else:
                    plot.axes.set_yscale('log')
            plot._set_font_properties(self._font_properties, None)
            axes_unit_labels = self._get_axes_unit_labels(unit_x, unit_y)
            if (self._xlabel is not None):
                x_label = self._xlabel
            else:
                x_label = (('$\\rm{Path\\ Length' + axes_unit_labels[0]) + '}$')
            if (self._ylabel is not None):
                y_label = self._ylabel
            else:
                finfo = self.ds.field_info[field]
                dimensions = Unit(finfo.units, registry=self.ds.unit_registry).dimensions
                if (dimensions_counter[dimensions] > 1):
                    y_label = ((('$\\rm{Multiple\\ Fields}$' + '$\\rm{') + axes_unit_labels[1]) + '}$')
                else:
                    y_label = (((finfo.get_latex_display_name() + '$\\rm{') + axes_unit_labels[1]) + '}$')
            plot.axes.set_xlabel(x_label)
            plot.axes.set_ylabel(y_label)
            if (field in self._titles):
                plot.axes.set_title(self._titles[field])
            dim_field = self.plots._sanitize_dimensions(field)
            if self.include_legend[dim_field]:
                plot.axes.legend()
    self._plot_valid = True