Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: marker annotations are broken (regression in yt 4.2.1) #4548

Closed
neutrinoceros opened this issue Jun 28, 2023 · 0 comments · Fixed by #4549
Closed

BUG: marker annotations are broken (regression in yt 4.2.1) #4548

neutrinoceros opened this issue Jun 28, 2023 · 0 comments · Fixed by #4549
Milestone

Comments

@neutrinoceros
Copy link
Member

Bug report

Bug summary

annotate_marker is broken. Originally reported by Sriram Swamynathan on Slack.

Code for reproduction

adapted from docs

import yt

yt.set_log_level('info')
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
s = yt.SlicePlot(ds, "x", ("gas", "density"))
s.set_axes_unit("kpc")

# Plot marker and text in data coords
s.annotate_marker((0.2, 0.5, 0.9), coord_system="data")
s.annotate_text((0.2, 0.5, 0.9), "data: (0.2, 0.5, 0.9)", coord_system="data")

# Plot marker and text in plot coords
s.annotate_marker((200, -300), coord_system="plot")
s.annotate_text((200, -300), "plot: (200, -300)", coord_system="plot")

# Plot marker and text in axis coords
s.annotate_marker((0.1, 0.2), coord_system="axis")
s.annotate_text((0.1, 0.2), "axis: (0.1, 0.2)", coord_system="axis")

# Plot marker and text in figure coords
# N.B. marker will not render outside of axis bounds
s.annotate_marker((0.1, 0.2), coord_system="figure", color="black")
s.annotate_text(
    (0.1, 0.2),
    "figure: (0.1, 0.2)",
    coord_system="figure",
    text_args={"color": "black"},
)
s.save("/tmp/test_marker.png")

Actual outcome

test_marker

Expected outcome
test_marker

(this is the output from yt 4.2.0)

The change bisect to 846d9cc (#4475)

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

Successfully merging a pull request may close this issue.

1 participant