Skip to content

How to show a 2D histogram of the difference between two snapshots? #66

Answered by nvaytet
nvaytet asked this question in Q&A
Discussion options

You must be logged in to vote

Here, we want to make a map of the difference in 2D histograms between two snapshots (outputs 5 and 8).
Because we do not necessarily have the same number of cells at the same place, we first have to make uniform 2D maps using the histogram2d function, which we can then directly compare.

The histogram2d function actually returns an object that contains the raw data that was used to create the figure.
By using the plot=False argument, we can silence the figure generation, and use the data in a custom figure.

Note: For the comparison to make sense, both histograms have to use the same horizontal and vertical range.

import osyris
import numpy as np
import matplotlib.pyplot as plt

path = "os…

Replies: 1 comment

Comment options

nvaytet
Feb 8, 2022
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by nvaytet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant