Commit 955a2ff2 authored by Vincent Noël's avatar Vincent Noël
Browse files

Fix style, physiboss figure

parent ff5ef405
......@@ -27,7 +27,9 @@ class PhysiBoSSTab(object):
# height=tab_height, overflow_y='scroll')
self.output_dir = '.'
self.figsize_width = 15.0 # allow extra for colormap
self.figsize_height = 8
constWidth = '180px'
# self.fig = plt.figure(figsize=(6, 6))
......@@ -84,7 +86,7 @@ class PhysiBoSSTab(object):
box_layout = Layout(display='flex',
flex_flow='row',
align_items='stretch',
width='70%')
width='900px')
row1 = Box(children=items_auto, layout=box_layout)
self.tab = VBox([row1, self.svg_plot])
......@@ -139,12 +141,13 @@ class PhysiBoSSTab(object):
title_str = svals[2] + "d, " + svals[4] + "h, " + svals[7] + "m"
title_str += " (" + str(num_cells) + " agents)"
self.fig = plt.figure(figsize=(15, 15))
# self.fig = plt.figure(figsize=(15, 15))
plt.xlim(self.axes_min, self.axes_max)
plt.ylim(self.axes_min, self.axes_max)
plt.title(title_str)
ax.margins(0, 0) # Set margins to avoid "whitespace"
......@@ -252,7 +255,7 @@ class PhysiBoSSTab(object):
else:
percent = a
x = np.arange(len(self.count_dict))
self.fig = plt.figure(figsize=(10,5), dpi=200)
self.fig = plt.figure(figsize=(self.figsize_width, self.figsize_height))
ax = self.fig.add_subplot(111)
ax.stackplot(x, percent, labels=all_state)
ax.legend(labels=all_state, loc='upper center', bbox_to_anchor=(0.5, -0.05),shadow=True, ncol=2)
......
......@@ -202,3 +202,4 @@ class PopulationsTab(object):
ax.stackplot(range(0, frame), t_data , labels=t_names)
ax.legend(labels=t_names, loc='upper center', bbox_to_anchor=(0.5, -0.05), ncol=2)
ax.margins(0, 0) # Set margins to avoid "whitespace"
......@@ -2,7 +2,29 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"style = \"\"\"\n",
" <style>\n",
" .jupyter-widgets-output-area .output_scroll {\n",
" height: unset !important;\n",
" border-radius: unset !important;\n",
" -webkit-box-shadow: unset !important;\n",
" box-shadow: unset !important;\n",
" }\n",
" .jupyter-widgets-output-area {\n",
" height: auto !important;\n",
" width: 100%; !important;\n",
" }\n",
" </style>\n",
" \"\"\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"extensions": {
"jupyter_dashboards": {
......@@ -20,14 +42,14 @@
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"from IPython.core.display import display, HTML\n",
"display(HTML(\"<style>.container { width:100% !important; }</style>\"))\n",
"%matplotlib inline"
"display(HTML(style))"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"extensions": {
"jupyter_dashboards": {
......@@ -136,10 +158,10 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.8.3"
},
"tool": true
},
"nbformat": 4,
"nbformat_minor": 2
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment