rgerum / pylustrator

Visualisations of data are at the core of every publication of scientific research results. They have to be as clear as possible to facilitate the communication of research. As data can have different formats and shapes, the visualisations often have to be adapted to reflect the data as well as possible. We developed Pylustrator, an interface to directly edit python generated matplotlib graphs to finalize them for publication. Therefore, subplots can be resized and dragged around by the mouse, text and annotations can be added. The changes can be saved to the initial plot file as python code.
GNU General Public License v3.0
707 stars 37 forks source link

pylustrator generates unused code? #24

Open mmagnuski opened 4 years ago

mmagnuski commented 4 years ago

Hi, first of all - thanks for a great package! I only used it for a while now but I already see how it will make my life easier. :)

The issue I'm reporting is just a small nuisance: during my testing pylustrator seemed to add unused code at the begining of its generated output, namely:

plt.figure(1).ax_dict = {ax.get_label(): ax for ax in plt.figure(1).axes}
import matplotlib as mpl

The mpl import is unused in the generated code below. The ax_dict is also not used anywhere below. If it is used internally by pylustrator it might be useful to add a comment to this line.