Skip to content

x- and y-axes translations fail silent with invalid numbers #14

Description

@Chilipp

Screenshot

[add screenshots of your problem]
image

Problem description

When inserting a string that cannot be converted to a floating point number (e.g. 70,01 instead of 70.01), the mark is created and appears on the plot, but it not added to straditize.

Expected Output

Straditize should directly give an error to inform about the invalid number. Instead, this is printed to the terminal:

Terminal output
Traceback (most recent call last):
  File "/Users/psommer/miniconda/envs/work/lib/python3.7/site-packages/matplotlib/cbook/__init__.py", line 215, in process
    func(*args, **kwargs)
  File "/Users/psommer/Documents/myplots-scripts/straditize/straditize/straditizer.py", line 123, in ret
    new_marks = _new_mark(event.xdata, event.ydata)
  File "/Users/psommer/Documents/myplots-scripts/straditize/straditize/straditizer.py", line 128, in _new_mark
    new_marks = func((x, y), **kwargs)
  File "/Users/psommer/Documents/myplots-scripts/straditize/straditize/straditizer.py", line 815, in new_mark
    ret.ask_for_value(initial, label)
  File "/Users/psommer/Documents/myplots-scripts/straditize/straditize/cross_mark.py", line 1139, in ask_for_value
    self.value = self.dtype(value)
ValueError: could not convert string to float: '70,01'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions