title: Good way to represent odds ratios and p-values in R or Python
body: <p>Let's say I have n binary variables, and I want to compare them with n^2/2-n chi-square tests. As a result, I can get for each interaction an odds ratio (OR) and p-value. These can be shown like two separate nxn matrices (one for OR and one for p-value), but I would like to show them on a single informative plot. </p>
  
  <p>A similar idea would be a <a href="https://www.google.com/search?q=corrplot%20r&amp;sxsrf=ACYBGNRIzySHj-twEBLPmQXutvC7xAReuA:1575136785263&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=2ahUKEwiLqLvkwZLmAhUMxqYKHba9CqIQ_AUoAXoECA0QAw&amp;biw=1280&amp;bih=689&amp;dpr=2" rel="nofollow noreferrer">corrplot</a> in R, but size would be comparable to OR, and p-value to color.</p>
  
  <p>Is there any known package in R or Python that can plot something like this?
  I tried seaborn in python:</p>
  
  <pre><code>import seaborn as sns
  import numpy as np
  import pandas as pd
  import matplotlib.pyplot as plt
  
  p = -np.log10(np.random.random((3,5)))
  odds = (2*np.random.random((3,5))-1)
  
  future_df = []
  for i in range(p.shape[0]):
      for j in range(p.shape[1]):
          future_df.append([j+0.5,i+0.5,p[i,j],odds[i,j]])
  df = pd.DataFrame(future_df, columns=["x","y","-log10(p)","OR"])
  
  # Plotting
  sns.set_style("whitegrid")
  ax = sns.relplot(x="x", y="y", hue="-log10(p)", size="OR", data=df, 
                   palette="Reds", sizes=(0,10000), height=10, aspect=(odds.shape[1]/odds.shape[0])*1.5)
  ax.ax.set(xlim=(0,odds.shape[1]))
  ax.ax.set(ylim=(0,odds.shape[0]))
  ax.ax.set(yticks=range(0,odds.shape[0]))
  
  norm = plt.Normalize(0, 3)
  sm = plt.cm.ScalarMappable(cmap="Reds", norm=norm)
  sm.set_array([])
  
  # Modify old legend
  handles, labels = ax.ax.get_legend_handles_labels()
  ax.ax.figure.colorbar(sm)
  </code></pre>
  
  <p>This starts doing what I intended, but I have two issues:
  1) How to edit the old legend to spread out the values to make them visible?
  2) Is there a way to explicitly control the size of the circles so I do not have to tweak manually? I would need the circles to be up to 1 unit in diameter</p>
  
  <p><a href="https://i.stack.imgur.com/A9AeK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A9AeK.png" alt="enter image description here"></a></p>