Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.