Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Please include mpldatacursor in the installer #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jondo opened this issue May 20, 2015 · 16 comments
Closed

Please include mpldatacursor in the installer #95

jondo opened this issue May 20, 2015 · 16 comments

Comments

@jondo
Copy link

jondo commented May 20, 2015

Currently it has to be installed via pip install mpldatacursor in the "WinPython Command Prompt" (Spyder menu Tools->Open command prompt), which is annoying when I want to convince people to switch from Matlab.

It should be included to reduce the functionality differences to Matlab.

@stonebig
Copy link
Contributor

there is no wheel format
it's not referenced by Christoph Gohlke (who would then do a wheel)
the web pypi page is not written in valid .rst format.

@jondo
Copy link
Author

jondo commented May 21, 2015

@joferkington - could you maybe create a wheel package? And fix the pypi page?

@joferkington
Copy link

Will do on both with the next release (which is long overdue). Thanks!

@stonebig
Copy link
Contributor

is mpldatacursorpython 3 compatible ?

@jondo
Copy link
Author

jondo commented May 26, 2015

Yes, it works for me with Python 3.4.3.

@joferkington
Copy link

@stonebig - Yes it is, though the current release has a few python3-specific bugs that have been fixed in the github HEAD. (And my apologies for the radio silence. I've been traveling lately.)

On a side note, while I can easily build a wheel, mpldatacursor is a pure python package. There shouldn't be any need for a wheel. Am I missing something?

@stonebig
Copy link
Contributor

Winpython ships only wheel packages.

The wheel format has three BIG advantages, for binary AND source packages:

  • ZERO code is run during installation process, giving 100% stability to the Winpython "build" process,
  • the dependancies can be SPECIFIED in the wheel format, and so can be MANAGED by the standard pip system.
  • a lot of new features are coming to the standard Python packaging as a result, some being used by Winpython "build" process.

Doing a wheel from a source package should be super easy for you:

python setup.py sdist bdist_wheel --universal
twine upload dist/*

Not doing a Wheel is, in my point of view, slowing/hurting python communauty improvements.

@joferkington
Copy link

Good to know, thanks!

@joferkington
Copy link

@stonebig - Just FYI, if you do decide to include mpldatacursor, the new 0.6 release should meet your requirements.

@stonebig
Copy link
Contributor

I see. did you test it against coming matplotlib 1.5 ? (as matplotlib 1.5 should make it for next winpython release). otherwise, this doesn't work in matplotlib1.4 / Ipython3.2.1, I don't know if it's normal:

%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
from mpldatacursor import datacursor

data = np.outer(range(10), range(1, 5))

fig, ax = plt.subplots()
lines = ax.plot(data)
ax.set_title('Click somewhere on a line')

datacursor(lines)

plt.show()

(maybe I shot in a dark corner, as few things are working as expected with this backend. it would be great if all that works in matplotlib 1.5 as it works nicely in tkinter)

@stonebig
Copy link
Contributor

stonebig commented Oct 5, 2015

testing now with spyder 3.0dev and Qt4 and Qt5:

  • on Qt4 (or tcl/tk) It seem I don't see the interactive cursor anymore
  • all fails apart in Qt5, and matplotlib seems to say winpythonQt5 has a problem:
import numpy as np
import matplotlib.pyplot as plt
from mpldatacursor import HighlightingDataCursor

x = np.linspace(0, 10, 100)

fig, ax = plt.subplots()

# Plot a series of lines with increasing slopes...
lines = []
for i in range(1, 20):
    line, = ax.plot(x, i * x, label='$y = {}x$'.format(i))
    lines.append(line)

HighlightingDataCursor(lines)

plt.show()

gives

>>> runfile('D:/result_tests/winpython-3.4.3.6Qt5_build3.amd64/settings/.spyder-py3/temp.py', wdir='D:/result_tests/winpython-3.4.3.6Qt5_build3.amd64/settings/.spyder-py3')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 786, in runfile
    execfile(filename, namespace)
  File "D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 87, in execfile
    exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
  File "D:/result_tests/winpython-3.4.3.6Qt5_build3.amd64/settings/.spyder-py3/temp.py", line 9, in <module>
    import matplotlib.pyplot as plt
  File "D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\matplotlib\pyplot.py", line 114, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 15, in <module>
    from .backend_qt5 import QtCore
  File "D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\matplotlib\backends\backend_qt5.py", line 27, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\matplotlib\backends\qt_editor\figureoptions.py", line 17, in <module>
    import matplotlib.backends.qt_editor.formlayout as formlayout
  File "D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\matplotlib\backends\qt_editor\formlayout.py", line 58, in <module>
    from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
  File "D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\matplotlib\backends\qt_compat.py", line 144, in <module>
    raise RuntimeError("PyQt{4,5} bindings found despite sip importing\n"
RuntimeError: PyQt{4,5} bindings found despite sip importing
Please install PyQt4 or PyQt5, uninstall sip or explicitly set the pyside backend.
>>> 

I don't know what to do from here, and the Qt5 messages is worrying me (a non-Qt expert as I am)

@joferkington , can you have a look on your on pc with a matplotlib 1.5rc2 ?

@joferkington
Copy link

I can verify that mpldatacursor (and matplotlib in general) work as expected on my Linux system with mpl v1.5rc2 on with the Qt4Agg, TkAgg, GtkAgg, and NbAgg (notebook) backends.

However, I don't currently have access to a non-work Windows machine, so I can't test on Windows. I also can't build with Qt5 at the immediate moment, so I haven't tested the Qt5Agg backend (I'll have that built shortly, though).

Qt5 problems aside, I'm not sure what the issue might be for mpldatacursor with the TkAgg and Qt4Agg backends might be. They're working fine for me. However, I've never tried to run anything through Spyder. I'll install it and see if I can see the same issues when running things through Spyder.

It's entirely possible that there are platform-specific issues with mpldatacursor that are causing it to not work with mpl v1.5rc2 on Windows. I'll see if I can get access to a Windows machine to test on.

@stonebig
Copy link
Contributor

stonebig commented Oct 6, 2015

maybe it's my fault, maybe it's a new matplotlib bug on windows. I may let the dust settle around matplotlib 1.5 before retrying.

@stonebig
Copy link
Contributor

Updating seaborn and holoviews to Matplotlib 1.5 level was a nightmare, I don't dare to add anymore complementary package over Matplotlib.

@jondo
Copy link
Author

jondo commented Jul 14, 2017

@stonebig, could you please retry?

I have just successfully tested mpldatacursor-0.6.2 with the Qt5 backend in WinPython-64bit-3.6.1.0Qt5.exe.

@stonebig stonebig reopened this Jul 14, 2017
@stonebig stonebig added this to the 2017-02 Matplotlib-2.0.2 / pandas-0.20.3 / JupyterLab-0.25.1 milestone Jul 15, 2017
@jondo
Copy link
Author

jondo commented Jul 15, 2017

Great, I see mpldatacursor 'checked' in the release checklist!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants