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

Create pcolormesh figure for data_amount data #15

Closed
8 tasks done
veenstrajelmer opened this issue Apr 9, 2024 · 0 comments · Fixed by #16
Closed
8 tasks done

Create pcolormesh figure for data_amount data #15

veenstrajelmer opened this issue Apr 9, 2024 · 0 comments · Fixed by #16

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Apr 9, 2024

Example code:

import pandas as pd
import matplotlib.pyplot as plt
plt.close("all")
import numpy as np

df = pd.read_csv(r"p:\11210325-005-kenmerkende-waarden\work\measurements_wl_18700101_20240101\data_amount_ts.csv")
df = df.set_index("Groeperingsperiode")
df[df==0] = np.nan
df_relative = df.div(df.median(axis=1), axis=0)
df_relative = df_relative.clip(upper=2)

# df = df_relative # this is useful for ts, because the frequency was changed from hourly to 10-minute

fig, ax = plt.subplots(figsize=(14,8))
pc = ax.pcolormesh(df.columns, df.index, df.values) # , cmap="turbo")
fig.colorbar(pc, ax=ax)
ax.tick_params(axis='x', labelrotation=90)
ax.grid(zorder=-5)
fig.tight_layout()
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 a pull request may close this issue.

1 participant