2

Plotting a graph between the voting and ratings for movies from IMDB data, What is the best way to show "Weighted Rank" Voting vs Rating Graph with the help of Pandas and Matplotlib.

Tried this so far but doesn't appears in correct format, even the x-axis text is overlapping each other. Any help much appreciatedenter image description here

Sample Data: enter image description here

Mock up Graph I'm looking for:

enter image description here

min2bro
  • 4,509
  • 5
  • 29
  • 55
  • 2
    Please provide [example data](http://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples), and if possible a mockup of the graph you're looking to plot. – IanS May 27 '16 at 15:43
  • Added Sample Data and Mock Graph I'm looking for – min2bro May 27 '16 at 15:49
  • 4
    Start with using plt.scatter() instead of using a barplot. This might be enough to produce the example depending on point-size and alpha-value. The task looks quite easy if you would give us some *running code incl. data*. – sascha May 27 '16 at 15:52
  • the data and code that you post need to included as next, *not* images. the whole point is to make it as *easy as possible* for the people offering free help to you. – Paul H May 27 '16 at 16:04
  • 2
    @min2bro you haven't followed my link, have you? ;) – IanS May 27 '16 at 16:13

1 Answers1

2

You could do

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('darkgrid')

df = pd.DataFrame(np.random.randint(100000, size=(10000, 2)), 
                  columns=['Votes', 'Rating'])

df.plot(kind='scatter', x='Votes', y='Rating', logx=True, alpha=0.5, color='purple', edgecolor='')
plt.ylabel('IMDB Rating')
plt.xlabel('Number of Votes')
plt.show()

which produces the plot you want enter image description here

John Karasinski
  • 977
  • 7
  • 16