Describe the bug
When using view.neuron(neu, output_path=output_path, output_name= output_name, neurite_type=ntype_view,xlim=xlim,ylim=ylim,show_plot=False), the image saved is blank.
Optional link from https://TMD.readthedocs.io which documents the behavior that is expected
No response
To Reproduce
filename is a .asc file from a pyramidal cell
neu = tmd.io.load_neuron_from_morphio(filename)
output_path = "./"
view.neuron(neu, output_path=output_path, output_name= "neuron", title = "Neuron", neurite_type=['apical_dendrite','basal_dendrite'],show_plot=False)
Error
Additional context
The view.neuron function is calling several times common.plot_style. Therefore, with show_plot=False, the image is erased at each step.
Proposed solution
In https://github.com/BlueBrain/TMD/blob/master/tmd/view/view.py#L356-#L358, replace by
show_plot = all_kwargs.pop("show_plot")
fig, ax = cm.plot_style(fig=fig, ax=ax, **all_kwargs)
if show_plot == False:
fig.close()
return (None,None)
return fig,ax
The idea is simply to pass show_plot at the end of the neuron plot
tmd Version in Use
bb32da1
Python Version
3.10.14
Operating system
MacOS