Skip to content

Instantly share code, notes, and snippets.

@satoru-takeuchi
Created September 24, 2021 13:24
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 satoru-takeuchi/f62277da75d316bc72ed74497808f51a to your computer and use it in GitHub Desktop.
Save satoru-takeuchi/f62277da75d316bc72ed74497808f51a to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
x, y = np.loadtxt("0.txt", unpack=True)
ax.scatter(x,y,c="red",s=1)
x, y = np.loadtxt("1.txt", unpack=True)
ax.scatter(x, y, c="blue",marker="^",s=1)
ax.set_title("visualize round-robin process scheduling (2 processes on 1 CPU)")
ax.set_xlabel("elapsed time[second]")
ax.set_xlim(0)
ax.set_ylabel("progress[%]")
ax.set_ylim([0,100])
fig.savefig("sched.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment