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

CMIP5 and 6 comparing portrait and parallel coordinate plot #843

Merged
merged 17 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pcmdi_metrics/graphics/parallel_coordinate_plot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ Parallel coordinate plot using matplotlib
- Mean Climate: [parallel_coordinate_plot_mean_clim.ipynb](./parallel_coordinate_plot_mean_clim.ipynb)

![plot](./mean_clim_parallel_coordinate_plot_example.png)

- Mean Climate, compare CMIP5 and CMIP6: [parallel_coordinate_plot_mean_clim_multiMIPs.ipynb](./parallel_coordinate_plot_mean_clim_multiMIPs.ipynb)

![plot](./mean_clim_parallel_coordinate_plot_cmip56.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _quick_qc(data, model_names, metric_names, model_names2=None):
for model in model_names2:
if model not in model_names:
sys.exit(
"Error: model_names2 shoudl be a subset of model_names: "
"Error: model_names2 should be a subset of model_names, but "
+ model
+ " is not in model_names"
)
Expand Down Expand Up @@ -296,10 +296,11 @@ def _to_pd_dataframe(
group1_name="group1",
group2_name="group2",
):
print('data.shape:', data.shape)
# Pandas dataframe for seaborn plotting
df = pd.DataFrame(data, columns=metric_names, index=model_names)
# Stack
df_stacked = df.stack().reset_index()
df_stacked = df.stack(dropna=False).reset_index()
df_stacked = df_stacked.rename(
columns={"level_0": "Model", "level_1": "Metric", 0: "value"}
)
Expand Down

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pcmdi_metrics/graphics/portrait_plot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ Portrait plot using matplotlib
- Mean Climate: [portrait_plot_mean_clim.ipynb](./portrait_plot_mean_clim.ipynb)

![plot](./mean_clim_portrait_plot_4seasons_example.png)

- Mean Climate, compare CMIP5 and CMIP6: [portrait_plot_mean_clim_multiple_CMIPs.ipynb](./portrait_plot_mean_clim_multiple_CMIPs.ipynb)

![plot](./mean_clim_portrait_plot_4seasons_cmip56.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading