92 plot_details_dict: dict) ->
None:
94 Plot a histogram onto the PdfPages object.
97 data (np.ndarray): Array to plot a histogram of.
98 plot_details_dict (dict): Dictionary with keys such as 'title', 'xlabel', etc.
101 Nothing. Mutates :self._pdf: with the new plot.
110 if 'xticks' in plot_details_dict:
111 plt.xticks(**plot_details_dict[
'xticks'])
116 if plot_details_dict.get(
'linear',
True)
and plot_details_dict.get(
'log',
True):
117 ax.hist(data, bins=bins, **plot_details_dict.get(
'linear_style', self.
_DEFAULT_HIST_STYLE[
'linear_style']))
118 ax.set_yscale(
'linear')
121 ax2.hist(data, bins=bins, **plot_details_dict.get(
'log_style', self.
_DEFAULT_HIST_STYLE[
'log_style']))
122 ax2.set_yscale(
'log')
126 ax.patch.set_visible(
False)
131 ax.spines[
'left'].set_color(linear_color)
132 ax.yaxis.label.set_color(linear_color)
133 ax.tick_params(
'y', colors=linear_color)
136 ax.spines[
'right'].set_color(log_color)
137 ax2.yaxis.label.set_color(log_color)
138 ax2.tick_params(
'y', which=
'both', colors=log_color)
140 handles, labels = ax.get_legend_handles_labels()
141 handles2, labels2 = ax2.get_legend_handles_labels()
142 handles = handles + handles2
143 labels = labels + labels2
144 plt.legend(handles=handles, labels=labels)
146 hist_style = plot_details_dict.get(
'linear_style', self.
_DEFAULT_HIST_STYLE[
'linear_style'])
149 plt.hist(data, bins=bins, **hist_style)
150 if plot_details_dict.get(
'log',
False):
153 plt.title(plot_details_dict[
'title'])
154 ax.set_xlabel(plot_details_dict[
'xlabel'])
155 if 'xlim' in plot_details_dict:
156 plt.xlim(plot_details_dict[
'xlim'])
158 if plot_details_dict.get(
'use_integer_xticks',
False):
159 ax.xaxis.set_major_locator(MultipleLocator(base=1))
171 plot_details_dict: dict) ->
None:
173 Plot a scatter plot for the given x and y data to the PdfPages object.
176 x_data (np.ndarray): Array to use as x values.
177 y_data (np.ndarray): Array to use as y values.
178 plot_details_dict (dict): Dictionary with keys such as 'title', 'xlabel', etc.
181 Nothing. Mutates :self._pdf: with the new plot.
183 Error bars are handled by :plot_details_dict: since they are a style
191 plt.errorbar(x_data, y_data, **errorbar_style)
193 plt.title(plot_details_dict[
'title'])
194 plt.xlabel(plot_details_dict[
'xlabel'])
195 plt.ylabel(plot_details_dict[
'ylabel'])