I have a series of measurements I want to plot as pandas.plotting.parallel_coordinates, where the color of the individual line is given by the value of one pandas.column.
Code looks like this:
... data retrieval and praparation from a couple of Excel files
---> output = 'largeDataFrame'
theColormap: ListedColormap = cm.get_cmap('some cmap name')
# This is a try to stack the lines in the right order.. (doesn't work)
largeDataFrames.sort_values(column_for_line_color_derivation, inplace=True, ascending=True)
# here comes the actual plotting of data
sns.set_style('ticks')
sns.set_context('paper')
plt.figure(figsize=(10, 6))
thePlot: plt.Axes = parallel_coordinates(largeDataFrame, class_column=column_for_line_color_derivation, cols=[columns to plot], color=theColormap.colors)
plt.title('My Title')
thePlot.get_legend().remove()
plt.xticks(rotation=90)
plt.tight_layout()
plt.show()
This works quite well and yields the following result:
Now I would like to have the yellow lines (high values of "column_for_line_color_derivation") plotted in front of the green and darker lines, so they become more prominent. In other words, I want to influence the order of stacking the lines by values of "column_for_line_color_derivation". Up to now I didn't find a way to do that.



largeDataFrameinstead ofallFrames?ascending=True, meaning the smallest values are moved to the first rows of the dataframe. Tryascending=False