Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ShujiaHuang committed Sep 10, 2024
1 parent 790ae64 commit e91a30c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions scripts/hist2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import pandas as pd
import numpy as np

import matplotlib
matplotlib.use("Agg")
# import matplotlib
# matplotlib.use("Agg")

from matplotlib.colors import LogNorm
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -38,7 +38,6 @@ def scale_format(value):

def draw_hist2d(argv):

MIN_MAF = 0.0003
ax = plt.gca()

data = pd.read_table(argv[0])
Expand All @@ -65,9 +64,6 @@ def draw_hist2d(argv):
max_a = max([max(np.log10(x)), max(np.log10(y))])
ax.plot([min_a, max_a], [min_a, max_a], 'k--', linewidth=1)

ax.set_xlim([np.log10(MIN_MAF), max_a])
ax.set_ylim([np.log10(MIN_MAF), max_a])

locs, _ = plt.xticks()
# ax.set_xticklabels(['${10}^{%.1f}$'%i for i in locs])
ax.set_xticklabels([scale_format(10 ** i) for i in locs])
Expand All @@ -84,10 +80,11 @@ def draw_hist2d(argv):
plt.tight_layout()
plt.savefig(out_fig_file)

#plt.show()
plt.show()


if __name__ == '__main__':

# usage: python hist2d.py basvarc_plot.txt.gz "Real:Basevar" test.pdf
draw_hist2d(sys.argv[1:])
draw_hist2d(sys.argv[1:])


0 comments on commit e91a30c

Please sign in to comment.