Commit 6e4a3f8a authored by Félix Hartmann's avatar Félix Hartmann
Browse files

[feature] Add ylim parameter for plotting cellfile.

parent 0eb24edb
......@@ -165,6 +165,7 @@ def init_cell_file_drawing(
axis.set_ylim(*ylim)
# axis.set_xlabel("Distance from cambial initials" + r" ($\mu m$)",
# size=fontsize)
axis.set_xlabel(r"$\mu m$", size=fontsize)
ylabel = "Signal concentration"
if fixed_cambium_right:
axis.invert_xaxis()
......@@ -379,6 +380,7 @@ def draw_cell_file(
linewidth=1,
fontsize="x-large",
xlim=None,
ylim=None,
fixed_cambium_right=True,
figsize=None,
figure=None,
......@@ -430,6 +432,8 @@ def draw_cell_file(
Size argument for labels.
xlim : tuple of two floats, optional, default: None
Limits of the x-axis: ax.set_xlim(*xlim).
ylim : tuple of two floats, optional, default: None
Limits of the y-axis: ax.set_ylim(*ylim).
fixed_cambium_right : Boolean, optional, default: True
If True, the cambium is fixed on the right side of the plot.
figsize : tuple of two floats, optional, default: None
......@@ -454,14 +458,17 @@ def draw_cell_file(
figure, axis = plt.subplots(figsize=figsize)
else:
axis = figure.add_subplot(111)
if xlim is None:
xlim = (0, 1.01 * cf.length(time))
if thresholds:
threshold_list = (cf.division_threshold, cf.enlargement_threshold)
ylim = (0, 2.2 * cf.division_threshold)
else:
threshold_list = None
ylim = (0, 2.2)
if xlim is None:
xlim = (0, 1.01 * cf.length(time))
if ylim is None:
if thresholds:
ylim = (0, 2.2 * cf.division_threshold)
else:
ylim = (0, 2.2)
figure, axis = init_cell_file_drawing(
xlim, ylim,
fixed_cambium_right=fixed_cambium_right,
......@@ -493,6 +500,7 @@ def draw_cell_file(
colors=colors,
linewidth=linewidth
)
figure.tight_layout()
if save:
figure.savefig("{0}_t_{1:04d}.png".format(base_name, time))
plt.close(figure)
......
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