Skip to content

Commit

Permalink
updated examples and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
CDonnerer committed Dec 25, 2020
1 parent 164493e commit c08deac
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Version 0.1.4
-------------
- Fixed bug in x-axis drawing, spurious rounding
- Added options to modify global figure properties, e.g. xlim, figsize, etc
- Updated docs for manual API reference as opposed to sphinx api-doc
- Updated docs for manually curated API reference as opposed to sphinx api-doc


Version 0.1.3
Expand Down
39 changes: 25 additions & 14 deletions examples/basic_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,33 @@

import shellplot as plt

# x = np.arange(-4, 4, 0.01)
# y = np.cos(x)
# plt.plot(x, y, xlabel="radians", figsize=(30, 15))
# plt.plot(x, y, xlabel="radians", figsize=(60, 20))
#
#
x = np.arange(-4, 4, 0.01)
y = np.cos(x)
plt.plot(x, y, xlabel="x", ylabel="f(x)", figsize=(60, 25))

plt_str = plt.plot(
x,
y,
figsize=(40, 21),
xlim=(0, 3),
ylim=(-1, 1),
xlabel="x",
ylabel="cos(x)",
return_type="str",
)
print(plt_str)


x = [np.random.randn(100) for i in range(3)]
plt.boxplot(x, labels=np.array(["dist_1", "dist_2", "dist_3"]), figsize=(40, 20))
plt.boxplot(x, labels=np.array(["dist_1", "dist_2", "dist_3"]), figsize=(40, 25))

x = np.random.randn(1000)
plt.hist(x, bins=12, figsize=(40, 20), xlabel="normal distribution")

# x = np.logspace(0, 1, 3)
# plt.barh(
# x,
# labels=np.array(["bar_1", "bar_b", "bar_3"]),
# xlabel="my_fun_bars",
# figsize=(40, 20),
# )
x = np.logspace(0, 1, 3)
plt.barh(
x,
labels=np.array(["bar_1", "bar_b", "bar_3"]),
xlabel="my_fun_bars",
figsize=(40, 20),
)
5 changes: 2 additions & 3 deletions examples/penguins_eda.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
# df[["island", "species"]].value_counts().plot.barh(figsize=(30, 30))

df.boxplot(column=["bill_length_mm", "bill_depth_mm"], figsize=(80, 13))
#

df.boxplot(column=["bill_length_mm"], by="species", figsize=(30, 13))
#

df.dropna().plot(
"bill_length_mm", "flipper_length_mm", color="species", figsize=(40, 23)
)


# df.loc[df["species"] == "Adelie"].dropna().plot(
# "bill_depth_mm", "body_mass_g", color="island"
# )

0 comments on commit c08deac

Please sign in to comment.