-1

I have a very simple data frame but I could not plot a line using a row and a column. Here is an image, I would like to plot a "line" that connects them.

enter image description here

enter image description here

enter image description here

I tried to plot it but x-axis disappeared. And I would like to swap those axes. I could not find an easy way to plot this simple thing.

AVANISH RAJBHAR
  • 527
  • 3
  • 9
vrd.gn
  • 198
  • 1
  • 18
  • 1
    To help you, please follow [these](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) guidelines – Ukrainian-serge Feb 26 '20 at 17:19
  • What is the problem? Have you done any research? – AMC Feb 26 '20 at 18:08
  • if you read properly, I did my research and plotted second plot. I could not find any solution regarding pandas' data.frame but found in matplotlib. Please check posts carefully before giving negative votes. – vrd.gn Feb 27 '20 at 10:53

1 Answers1

1

Try:

import matplotlib.pyplot as plt

# Categories will be x axis, sexonds will be y
plt.plot(data["Categories"], data["Seconds"])
plt.show()

Matplotlib generates the axis dynamically, so if you want the labels of the x-axis to appear you'll have to increase the size of your plot.

Cal
  • 631
  • 3
  • 11