0

I have a data frame called that looks like this. It is called p1plot1:

         0
0   139245
1   125395
2   116835
3    85170
4    58075
5    40050

I want to create a bar plot with the integers on the x axis and the values on the y axis. I tried using:

p1plot1.plot(kind='bar')

And got the output:

<matplotlib.axes.AxesSubplot object at 0x1fec7ca10>

How do I get an actual image file with the plot? Was I supposed to import something?

3 Answers 3

4

In the non-interactive mode, you need to use show to display the image

import matplotlib.pyplot as plt

# plt.plot something

plt.show()

If you want to display the figure as you plot it, turn it into interactive mode

import matplotlib.pyplot as plt

plt.ion()

# plt.plot something
Sign up to request clarification or add additional context in comments.

Comments

1

Finish up with

show()

to display.

Comments

0

Launch Ipython notebook with

--pylab=inline

Then all of your plots will be shown inline

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.