Skip to content

Commit

Permalink
fix(distrib): Distribution.plotPeak() legend background more transparent
Browse files Browse the repository at this point in the history
- to see more of the curve behind for very narrow plots
  • Loading branch information
ibressler committed Mar 26, 2024
1 parent 5625290 commit 4a148f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/jupyter_analysis_tools/distrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,11 @@ def plotPeak(self, peakRange, mom, momLo, momHi, dp, dpLo, dpHi, showFullRange=F
if showFullRange:
ax.set_xlim((self.x.min(), self.x.max()))
ax.set_xlabel(self.xlabel)
ax.legend(prop=font_manager.FontProperties(family="monospace"))
ax.grid(True)
legend = ax.legend(prop=font_manager.FontProperties(family="monospace"))
# make the legend background more transparent
legend.get_frame().set_alpha(None)
legend.get_frame().set_facecolor((1, 1, 1, 0.2))

def plot(self, ax, distPar, name=""):
"""plot complete distribution as loaded from file"""
Expand Down

0 comments on commit 4a148f1

Please sign in to comment.