Skip to content

Conversation

@janw20
Copy link
Owner

@janw20 janw20 commented Apr 24, 2025

Add a function to plot the A-dependence of a NuclearPDFSet in a pseudo-3D plot, i.e. using insets.

)
ax_i.fill_between(
x_i,
*pdf_set.get_uncertainties(observable=obs_i, Q=Q_i),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier Möglichkeit einfügen, zwischen uncertainty convention "asym" und "sym" zu wählen.

kwargs_annotation: dict[str, Any] | list[dict[str, Any] | None] = {},
kwargs_xlabel: dict[str, Any] = {},
kwargs_ylabel: dict[str, Any] = {},
kwargs_legend: dict[str, Any] = {},
Copy link
Collaborator

@Katrin-Greve Katrin-Greve Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plus variable für uncertainty convention

ax_i.plot(
x_i,
pdf_set.get_uncertainty("+", obs_i, Q=Q_i),
**kwargs,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hier dann ebenfallls uncertainty convention als Argumen übergeben

# ... or as ylabel
elif pdf_label == "ylabel":
ax_i.set_ylabel(
f"${to_str(obs_i, Q=Q_i_label)}$", **kwargs_ylabel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier würde ich den text des y_labels auch in kwargs_y_label default packen und dem kwargs überschreiben arbeiten, sodass der Nutzer seine y-Achse mit beliebigem Text beschriften kann

f"${to_str(obs_i, Q=Q_i_label)}$", **kwargs_ylabel
)

ax_i.set_xlabel("$x$", **kwargs_xlabel)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier würde ich den text des x_labels auch in kwargs_x_label_default packen und dem kwargs überschreiben arbeiten, sodass der Nutzer seine y-Achse mit beliebigem Text beschriften kann, das kann zb praktisch sein, wenn man nur an einem vn vielen plots überhaupt ein label möchte. Und solange es in den default_kwargs ist, wird es ja trotzdem per default genauso gesetzt

kwargs_annotation: dict[str, Any] = {},
kwargs_xlabel: dict[str, Any] = {},
kwargs_ylabel: dict[str, Any] = {},
kwargs_legend: dict[str, Any] = {},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncertainty convention hinzufügen

)
ax_i.fill_between(
x_i,
*pdf_set.get_uncertainties(observable=obs_i, Q=Q_i),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncertainty convention hinzufügen

)
ax_i.plot(
x_i,
pdf_set.get_uncertainty("+", obs_i, Q=Q_i),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncertainty convention

)
ax_i.plot(
x_i,
pdf_set.get_uncertainty("-", obs_i, Q=Q_i),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncertainty convention

kwargs_annotation,
)
ax_i.annotate(
f"${to_str(obs_i, Q=Q_i_label)}$",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text der annotation in default kwargs

)

else:
ax_i.set_xlabel("$x$", **kwargs_xlabel)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text des x-labels in default kwargs s.o.


# add the ylabel
if pdf_label == "ylabel":
ax_i.set_ylabel(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text ylabel in default kwargs s.o.

np.max(
[
self.get(A=A_i).get_uncertainty("+", obs_i, x=x, Q=Q, Q2=Q2)
for A_i in A
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add uncertainty convention

)
l = ax_i.plot(
x_i,
pdf_set.get_central(obs_i, Q=Q_i),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich versteh nicht ganz wie hier (und überall sonst wo geplottet wird) das mit Q_i als array läuft. Ich denke das muss ein float sein an dieser Stelle.

Copy link
Collaborator

@Katrin-Greve Katrin-Greve Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Habs getestet und in der Tat funktioniert es nur, wenn Q ein float ist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants