Skip to content

Commit

Permalink
🐛 fix: example image of scatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerohertz committed Dec 24, 2024
1 parent 2286d8c commit 9e01cc9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
23 changes: 15 additions & 8 deletions sphinx/example_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,23 @@ def example_candle():

# plot.scatter.png
def example_scatter():
data = {
"Terran": [list(np.random.rand(200) * 10), list(np.random.rand(200) * 10)],
"Zerg": [list(np.random.rand(200) * 5 - 1), list(np.random.rand(200) * 5 + 1)],
"Protoss": [
list(np.random.rand(200) * 10 + 3),
list(np.random.rand(200) * 10 - 2),
],
xdata = {
"Terran": [list(np.random.rand(200) * 10)],
"Zerg": [list(np.random.rand(200) * 5 + 1)],
"Protoss": [list(np.random.rand(200) * 10 - 2)],
}
ydata = {
"Terran": [list(np.random.rand(200) * 10)],
"Zerg": [list(np.random.rand(200) * 5 - 1)],
"Protoss": [list(np.random.rand(200) * 10 + 3)],
}
path = zz.plot.scatter(
data, xlab="Cost [Mineral]", ylab="Scores", title="Star Craft", markersize=400
xdata,
ydata,
xlab="Cost [Mineral]",
ylab="Scores",
title="Star Craft",
markersize=400,
)
shutil.move(path, f"{EXAMPLE_PATH}/plot.scatter.png")

Expand Down
5 changes: 3 additions & 2 deletions zerohertzLib/plot/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ def scatter(
``str``: 저장된 graph의 절대 경로
Examples:
>>> data = {"Terran": [list(np.random.rand(200) * 10), list(np.random.rand(200) * 10)], "Zerg": [list(np.random.rand(200) * 5 - 1), list(np.random.rand(200) * 5 + 1)], "Protoss": [list(np.random.rand(200) * 10 + 3), list(np.random.rand(200) * 10 - 2)]}
>>> zz.plot.scatter(data, xlab="Cost [Mineral]", ylab="Scores", title="Star Craft", markersize=400)
>>> xdata = {"Terran": [list(np.random.rand(200) * 10)], "Zerg": [list(np.random.rand(200) * 5 + 1)], "Protoss": [list(np.random.rand(200) * 10 - 2)]}
>>> ydata = {"Terran": [list(np.random.rand(200) * 10)], "Zerg": [list(np.random.rand(200) * 5 - 1)], "Protoss": [list(np.random.rand(200) * 10 + 3)]}
>>> zz.plot.scatter(xdata, ydata, xlab="Cost [Mineral]", ylab="Scores", title="Star Craft", markersize=400)
.. image:: _static/examples/dynamic/plot.scatter.png
:align: center
Expand Down

0 comments on commit 9e01cc9

Please sign in to comment.