Skip to content

Instantly share code, notes, and snippets.

@singhpratyush
Created July 11, 2017 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save singhpratyush/fb0758294342b1a5870888b7a70f1355 to your computer and use it in GitHub Desktop.
Save singhpratyush/fb0758294342b1a5870888b7a70f1355 to your computer and use it in GitHub Desktop.
A plot to visualise the score for a Tweet with various properties in loklak's PriorityKaizen harvester
import numpy
from matplotlib import pyplot
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
x = numpy.arange(0, 30, 0.1)
y = numpy.arange(0, 30, 0.1)
x, y = numpy.meshgrid(x, y)
z = x * 5 + y
Z = z / (z + 10 * numpy.exp(-0.01 * z))
plot = pyplot.figure()
ax = Axes3D(plot)
surf = ax.plot_surface(x, y, Z, cmap=cm.coolwarm)
ax.set_xlabel("Retweets")
ax.set_ylabel("Favourites")
ax.set_zlabel("Score")
ax.set_title("Score vs. Retweets and Favourites")
pyplot.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment