Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b45cdb1

Browse files
committed
fix for ruff
1 parent e4ebfe5 commit b45cdb1

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

‎examples/basic.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""The most basic example of how to use the pygame-matplotlib backend."""
2+
3+
# Select pygame backend
4+
import matplotlib
5+
import logging
6+
import matplotlib.pyplot as plt
7+
8+
logging.basicConfig()
9+
logger = logging.getLogger("pygame_matplotlib")
10+
logger.setLevel(logging.DEBUG)
11+
matplotlib.use("pygame")
12+
13+
14+
fig, ax = plt.subplots() # Create a figure containing a single axes.
15+
ax.plot([1, 2, 3, 4], [2, 4, 2, 9]) # Plot some data on the axes.
16+
ax.set_ylabel("some y numbers") # Add a y-label to the axes.
17+
ax.set_xlabel("some x numbers") # Add an x-label to the axes.
18+
ax.set_xticklabels(
19+
# Long rotated labels
20+
["label1", "label2", "label3", "label4"],
21+
rotation=45,
22+
)
23+
plt.show()

‎examples/text.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
import matplotlib.pyplot as plt
44
import logging
5+
import matplotlib
56

67
# Set up logging
78
logging.basicConfig()
89
logger = logging.getLogger("pygame_matplotlib")
910
logger.setLevel(logging.DEBUG)
1011

11-
import matplotlib
1212

13-
# matplotlib.use("pygame")
13+
matplotlib.use("pygame")
1414

1515
fig = plt.figure()
1616
ax = fig.add_subplot()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /