1
0
Fork 0
mirror of https://github.com/Findus23/halo_comparison.git synced 2024-09-19 16:03:50 +02:00
halo_comparison/2d.py

32 lines
718 B
Python
Raw Normal View History

2022-05-06 09:51:43 +02:00
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.axes import Axes
from matplotlib.colors import LogNorm
from matplotlib.figure import Figure
from readfiles import read_file
def filter_for_2d(df: pd.DataFrame, group: int):
xs = df_ref.X
ys = df_ref.Y
return np.array([xs, ys]).T
reference_dir = Path(f"/home/lukas/monofonic_tests/shannon_512_100")
df_ref, _ = read_file(reference_dir)
df = df_ref.loc[df_ref["FOFGroupIDs"] == 1]
df2 = df_ref.loc[df_ref["FOFGroupIDs"] == 4]
fig: Figure = plt.figure()
ax: Axes = fig.gca()
# ax.hist2d(df.X, df.Y, bins=500, norm=LogNorm())
ax.hist2d(df2.X, df2.Y, bins=1000, norm=LogNorm())
plt.show()