import numpy as np def errorbar_modified(): # Data data = [1, 1.5, 1.2] std_devs = [0.15, 0.25, 0.12] # X axis positions x_pos = range(len(data)) colors = ['lightblue', 'pink', 'lightgreen'] fig = plt.gca() ax = plt.subplot(111) # draw plots for d, std, col, x in zip(data, std_devs, colors, x_pos): plt.errorbar(x=x, y=d, yerr=std, fmt='o', color=col, ecolor='black') # setting axis limits plt.xlim([min(x_pos)-1, max(x_pos)+1]) plt.ylim([min(data)*0.7, max(data)*1.3]) # setting labels and titles plt.ylabel('x label') plt.text(1, 2, 'Modified', horizontalalignment='center', fontsize=14) # remove axis spines ax.spines["top"].set_visible(False) ax.spines["right"].set_visible(False) ax.spines["bottom"].set_visible(False) ax.spines["left"].set_visible(False) # hiding axis ticks plt.tick_params(axis="both", which="both", bottom="off", top="off", labelbottom="off", left="off", right="off", labelleft="on") # adding horizontal grid lines ax.yaxis.grid(True) plt.legend(['X1', 'X2', 'X3'], loc='upper right', fancybox=True, numpoints=1) plt.tight_layout() plt.show()
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4