I have a dataframe where both columns and rows can be considered as categories. I want to plot the values in each row on a scatter plot with row categories on y-axis and column categories with different colored dots, with x-axis as scale for the values. Preferred plot - plotly or seaborn
Simulated data
import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randint(0, 100, size=(5, 4)),
columns=list('ABCD'), index=list('PQRST'))
df
# A B C D
# P 21 95 91 90
# Q 21 12 9 68
# R 24 68 10 82
# S 81 14 80 39
# T 53 17 19 77
# plot
df.plot(marker='o', linestyle='')
Desired plot (similar to the below plot but with x-axis and y-axis switched)