Skip to content

Instantly share code, notes, and snippets.

@tkshnkmr
Last active November 30, 2019 15:53
Show Gist options
  • Save tkshnkmr/bdcc7c0f7278fbdc7891e39272a9870b to your computer and use it in GitHub Desktop.
Save tkshnkmr/bdcc7c0f7278fbdc7891e39272a9870b to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
# Input x, output y
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)
# Plot
plt.plot(x, y)
# Change the fontsize of ticks
plt.xticks(fontsize=8)
plt.yticks(fontsize=8, rotation=90)
# Add label
plt.xlabel('X input', fontsize=14)
plt.ylabel('Y output', fontsize=14)
plt.title('Simple plot')
# Save plot
plt.savefig('Simple_plot.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment