Created
July 11, 2017 12:44
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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