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
706 stars 38 forks source link

Make mpl ToolBar drag, pan and zoom exclusive and fix checkboxes #48

Closed JoostScheffer closed 1 year ago

JoostScheffer commented 1 year ago

Before you could enable and disable drag, pan and zoom individually and you could select multiple at the same time. When selecting multiple the checkboxes would not update, the user can not know which tools are currently selected.

Since I do not see a purpose of using multiple tools at the same time I made them exclusive, you can only use 1 at a time. Also the checkboxes now work as intended

JoostScheffer commented 1 year ago

the previous implementation of color swap had some flaws:

solutions to all of the above have been implemented

3 comments:

  1. because I change lineEdit to Qlabel the padding changed, so I manually added padding based on font size to the stylesheet.
  2. at many places I changed the strings that use % to dynamically add variables to functional strings because I think it is more readable this way
  3. because I want to update the colors_text_widget i needed to differentiate between a color swap (which comes with 2 color changes) and a color change using the color picker (which comes with 1 color change). My current implementation relies on a counter and an extra signal color_changed_by_color_picker, I think this can be more elegant but I don't know how.
rgerum commented 1 year ago

The test*.py in .gitignore is not good as it might hinder adding new tests in the tests folder. Apart from that the changes look good. Thanks for your contribution.