0

I am trying to make a line plot in seaborn for each row. (Each line for each row). Using seaborn functionality as it is, I can only plot by specifying x and y as column names of the data frame.

One way is to simply transpose the data and then plot which works well for me after some adjustments. However, I am wondering if there is a simpler way than this.

PagMax
  • 8,088
  • 8
  • 25
  • 40
  • 2
    IMHO, the best way is to transpose. From the [lineplot documentation]() is clear how the dataframe is expected to be: `data : DataFrame` Tidy (“long-form”) dataframe where each column is a variable and each row is an observation. – CAPSLOCK Jul 09 '19 at 08:04
  • 1
    Transposing is as simple as `.T`, so no, there is no simpler way. – ImportanceOfBeingErnest Jul 09 '19 at 12:01
  • @ImportanceOfBeingErnest Fair enough but just to be clear I did not mean to ask simpler way to transpose. I meant simpler way to plot in seabron. So while .T is simple way to transpose, some more clean up has to be done with row labels and column labels to make it ready for plotting the seaborn way. Apparently that is still the simplest way – PagMax Jul 09 '19 at 13:27
  • We have no idea what cleanups you need; note that questions with [mcve] are in general well received and answered. So if you want to show how you're doing it currently, someone will be able to suggest you an alternative. – ImportanceOfBeingErnest Jul 09 '19 at 13:39
  • @ImportanceOfBeingErnest Once again, the question is not on clean-up and also not on transpose. Hence I did not put the code there. I do not need help with the cleanup and my question did not indicate that either. My question is simply about plotting rows in seaborn instead of columns. And I get it now that answer is NO. – PagMax Jul 09 '19 at 15:16

0 Answers0