From 81c190b3c5457704cfaea19be745bdb97e5a678e Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sat, 18 Sep 2021 23:55:40 +0200 Subject: [PATCH] Improve errorbar plot types example - use a marker and no line for the data points - hard-code yerr instead of using random with a fixed seed - Slightly move y so that the data points don't always fall on the grid - Remove "specialized" from section title. There are no more special than any other plots. --- plot_types/stats/README.rst | 6 +++--- plot_types/stats/errorbar_plot.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plot_types/stats/README.rst b/plot_types/stats/README.rst index d52fe5de97c9..9944c77acccc 100644 --- a/plot_types/stats/README.rst +++ b/plot_types/stats/README.rst @@ -1,6 +1,6 @@ .. _stats_plots: -Specialized statistics plots ----------------------------- +Statistics plots +---------------- -Specialized plots for statistical analysis. \ No newline at end of file +Plots for statistical analysis. \ No newline at end of file diff --git a/plot_types/stats/errorbar_plot.py b/plot_types/stats/errorbar_plot.py index 39ffd4af597d..95b38c383ca0 100644 --- a/plot_types/stats/errorbar_plot.py +++ b/plot_types/stats/errorbar_plot.py @@ -13,13 +13,13 @@ # make data: np.random.seed(1) x = [2, 4, 6] -y = [4, 5, 4] -yerr = np.random.uniform(0.5, 1.5, 3) +y = [3.6, 5, 4.2] +yerr = [0.9, 1.2, 0.5] # plot: fig, ax = plt.subplots() -ax.errorbar(x, y, yerr, linewidth=2, capsize=6) +ax.errorbar(x, y, yerr, fmt='o', linewidth=2, capsize=6) ax.set(xlim=(0, 8), xticks=np.arange(1, 8), ylim=(0, 8), yticks=np.arange(1, 8))