I refer to this example from the Matplotlib site. To the right of the blue "Empirical" curve, there is a vertical blue line, which is the right edge of the rightmost bar.
How can I remove this vertical blue line, without changing the x-axis limits?
To hide the border (aka "spine"): ax. set_frame_on(False) or ax. spines['top']. set_visible(False)
To remove the ticks on the x-axis, tick_params() method accepts an attribute named bottom, and we can set its value to False and pass it as a parameter inside the tick_params() function.
The space between bars can be added by using rwidth parameter inside the “plt. hist()” function. This value specifies the width of the bar with respect to its default width and the value of rwidth cannot be greater than 1.
This is default behavior. You need to delete the last point.
n, bins, patches = ax.hist(x, n_bins, normed=1, histtype='step',
cumulative=True, label='Empirical')
patches[0].set_xy(patches[0].get_xy()[:-1])
The rest are the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With