add more marker symbols
This commit is contained in:
parent
cbaf9bc071
commit
06cf912490
21
main.py
21
main.py
@ -65,6 +65,22 @@ Marker = Literal[
|
||||
"_",
|
||||
]
|
||||
|
||||
marker_subs = {"=": "$=$", "/": "$/$",
|
||||
"\\": "$\\setminus$",
|
||||
"«": "$«$",
|
||||
"»": "$»$",
|
||||
"~": "$\\sim$",
|
||||
"♪": "$♪$",
|
||||
"♫": "$♫$",
|
||||
"∞": "$\\infty$",
|
||||
"♡": "$♡$",
|
||||
"o": "$\\bigcirc$",
|
||||
"♠": "$♠$",
|
||||
"♣": "$♣$",
|
||||
"♥": "$♥$",
|
||||
"♦": "$♦$",
|
||||
"🥑": "$🥑$"
|
||||
}
|
||||
|
||||
@app.get("/speckles/")
|
||||
def make_wallpaper(
|
||||
@ -110,8 +126,7 @@ def make_wallpaper(
|
||||
markers,
|
||||
np.logspace(0, size, 10, base=np.exp(2)),
|
||||
):
|
||||
marker = marker.replace("=", "$=$")
|
||||
marker = marker.replace("~", "$\sim$")
|
||||
marker = marker_subs.get(marker, marker)
|
||||
ax.scatter(
|
||||
[random.random() * x / 8 for _ in range(speckles_per_colour)],
|
||||
[random.random() * y / 8 for _ in range(speckles_per_colour)],
|
||||
@ -145,4 +160,4 @@ def make_wallpaper(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run("main:app", workers=2, port=8099, reload=False)
|
||||
uvicorn.run("main:app", workers=3, port=8099, reload=True)
|
||||
|
Loading…
Reference in New Issue
Block a user