Vera-ZWY commited on
Commit
49707d6
·
verified ·
1 Parent(s): 9410534

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -146,9 +146,10 @@ def heatmap(top_n):
146
 
147
 
148
 
149
- def decode_plot(plot_base64):
150
  plot_bytes = base64.b64decode(plot_base64['plot'].split(',')[1])
151
  img = plt.imread(BytesIO(plot_bytes), format='PNG')
 
152
  plt.imshow(img)
153
  plt.axis('off')
154
  plt.show()
@@ -165,7 +166,7 @@ def linePlot(viz_type, weight, top_n):
165
  )
166
  # print(result)
167
  # result is a tuble of dictionary of plot_base64, and a string message of description of the plot
168
- return decode_plot(result[0]), result[1]
169
 
170
 
171
 
 
146
 
147
 
148
 
149
+ def decode_plot(plot_base64, top_n):
150
  plot_bytes = base64.b64decode(plot_base64['plot'].split(',')[1])
151
  img = plt.imread(BytesIO(plot_bytes), format='PNG')
152
+ plt.figure(figsize = (12, 2*top_n, dpi = 150)
153
  plt.imshow(img)
154
  plt.axis('off')
155
  plt.show()
 
166
  )
167
  # print(result)
168
  # result is a tuble of dictionary of plot_base64, and a string message of description of the plot
169
+ return decode_plot(result[0],top_n), result[1]
170
 
171
 
172