diff --git a/CHANGELOG.rst b/CHANGELOG.rst index dc20e94..c7d72a3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 diff --git a/examples/basic_usage.py b/examples/basic_usage.py index 4039a39..1be6940 100644 --- a/examples/basic_usage.py +++ b/examples/basic_usage.py @@ -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), +) diff --git a/examples/penguins_eda.py b/examples/penguins_eda.py index fa05448..b8a7a98 100644 --- a/examples/penguins_eda.py +++ b/examples/penguins_eda.py @@ -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" # )