Skip to content

Commit

Permalink
make the width of bar variable
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Dec 8, 2023
1 parent fcd6f2c commit 43a6a91
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion distfit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = 'Erdogan Tasksen'
__email__ = '[email protected]'
__version__ = '1.7.2'
__version__ = '1.7.3'


# module level doc-string
Expand Down
5 changes: 3 additions & 2 deletions distfit/distfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1980,12 +1980,13 @@ def _plot_pdf(x, y, label, pdf_properties, ax):

def _plot_bar(binedges, histvals, bar_properties, ax):
if bar_properties is not None:
ax.bar(binedges[:-1], histvals[:-1], width=np.diff(binedges), **bar_properties)
bar_properties.setdefault('width', np.diff(binedges))
ax.bar(binedges[:-1], histvals[:-1], **bar_properties)


def _plot_emp(x, y, line_properties, ax):
if line_properties is not None:
if line_properties.get('label', None) is None: line_properties['label'] = 'Emperical PDF'
line_properties.setdefault('label', 'Emperical PDF')
ax.plot(x, y, **line_properties)


Expand Down
2 changes: 1 addition & 1 deletion docs/source/Plots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Change chart properties
fig, ax = dfit.plot(chart='pdf',
pdf_properties={'color': 'r', 'linewidth': 3},
cii_properties={'color': 'r', 'linewidth': 3},
bar_properties={'color': '#1e3f5a'})
bar_properties={'color': '#1e3f5a', 'width': 10})
# Give the previous axes as input.
dfit.plot(chart='cdf',
Expand Down

0 comments on commit 43a6a91

Please sign in to comment.