Skip to content

Commit

Permalink
Update corner_plot.py
Browse files Browse the repository at this point in the history
using named colors instead of seaborn color palette to allow single contour.
  • Loading branch information
sahiljhawar authored Oct 18, 2023
1 parent 1b3a592 commit 941faf7
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions tools/corner_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import matplotlib.pyplot as plt
import argparse
import os
import seaborn as sns
import matplotlib.patches as mpatches
import re
import matplotlib
Expand Down Expand Up @@ -177,7 +176,23 @@ def corner_plot(data, labels, filename, truths, legendlabel, ext, **kwargs):
else:
truth_values = truths

color_array = sns.color_palette("deep", n_colors=len(data), desat=0.8)
red = '#F42969'
orange = 'orange'
blue = '#22ADFC'
purple = '#4635CE'
green = '#4CAF50'
yellow = '#FFD700'
pink = '#FF69B4'
teal = '#008080'
gold = '#FFD700'
gray = '#808080'
brown = '#8B4513'
lavender = '#E6E6FA'
cyan = '#00FFFF'
deep_blue = '#00008B'
tomato = '#FF6347'

color_array = [blue, purple, orange, red, green, gold, teal, deep_blue, cyan, brown, tomato]

_limit = np.concatenate(data, axis=0)
limit = np.array([np.min(_limit, axis=0), np.max(_limit, axis=0)]).T
Expand Down Expand Up @@ -396,4 +411,4 @@ def corner_plot(data, labels, filename, truths, legendlabel, ext, **kwargs):
corner_plot(posteriors, labels, output_filename, truths, legendlabel, ext, **kwargs)

## Example usage
# python corner_plot.py -f GRB_res12_linear2dp/injection_posterior_samples.dat GRB_res12_linear4dp/injection_posterior_samples.dat -p GRB170817A_emsys_4dp.prior -o linear2d_vs_linear4dp --kwargs "{'levels':[0.05,0.5,0.95]}"
# python corner_plot.py -f GRB_res12_linear2dp/injection_posterior_samples.dat GRB_res12_linear4dp/injection_posterior_samples.dat -p GRB170817A_emsys_4dp.prior -o linear2d_vs_linear4dp --kwargs "{'levels':[0.05,0.5,0.95]}"

0 comments on commit 941faf7

Please sign in to comment.