GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — DataAnalysis/chapter03/axis_axis.py at master · qiwsir/DataAnalysis

Expand file tree

/

axis_axis.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
40 lines (28 loc) · 998 Bytes
/

axis_axis.py

Copy path

File metadata and controls

40 lines (28 loc) · 998 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
t = np.linspace(0, 100, 100)
s = 9.8 * np.power(t, 2) / 2
fig, ax = plt.subplots(figsize=(8, 4))
ax.plot(t, s)
ax.set_ylabel('displacement')
ax.set_xlim(0, 100)
ax.set_xlabel('time')
xmajor_locator = MultipleLocator(20)
xmajor_formatter = FormatStrFormatter('%1.1f')
xminor_locator = MultipleLocator(5)
ymajor_locator = MultipleLocator(10000)
ymajor_formatter = FormatStrFormatter('%1.1f')
yminor_locator = MultipleLocator(5000)
ax.xaxis.set_major_locator(xmajor_locator)
ax.xaxis.set_major_formatter(xmajor_formatter)
ax.yaxis.set_major_locator(ymajor_locator)
ax.yaxis.set_major_formatter(ymajor_formatter)
ax.xaxis.set_minor_locator(xminor_locator)
ax.yaxis.set_minor_locator(yminor_locator)
ax.grid(True, which='major')
ax.grid(True, which='minor')
for tick in ax.xaxis.get_major_ticks():
tick.label1.set_fontsize(16)
plt.show()
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.