Skip to content
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

Feature/qt plot #290

Closed
wants to merge 9 commits into from
Closed

Feature/qt plot #290

wants to merge 9 commits into from

Conversation

MerlinSmiles
Copy link
Contributor

@MerlinSmiles MerlinSmiles commented Jul 29, 2016

Fixes the Qt part of #266
Fixes #259 I think
Fixes the Qt part of #217
Fixes #34 since setGeometry is now directly available and _repr_png_ exists
Fixes #289 I implemented it here too...

Changes proposed in this pull request:

  • Use pyqtgraph Docks for subplots
  • Expose some of the Dock-functionality to QtPlot.add()
  • Add transpose argument to QtPlot.add() (flip x, y axes, and transpose z)
  • Fix plotting when x, y, z datasets are defined
  • Remove Javascript update widget which is only used for update timing, replaced with native Qt timer
  • Add PNG representation of the plot windows
  • Add plotting tutorial
  • Add get default array title currently the location and array_id, maybe it should be reduced to the name and array_id, in the case where name exists. however, location is nice to later relate screenshots to the right dataset.
  • Add get_units
  • renamped update to update_data in base.py so it wont interfere with update() from the Qwidget
  • removed pyqtgraph remote plotting stuff

I'm leaving for a holiday now, but it would be great if someone could check this over, and give some input

This PR is mostly meant to fix some of the urgent issues I came across, there is still a lot to do but for that we need to refactor the whole plotting system, which seems somewhat complicated right now. Make it more modular and allow for easy additions...

@giulioungaretti @alexcjohnson @AdriaanRol @peendebak @nataliejpg

@qcodes-bot
Copy link

qcodes-bot commented Jul 29, 2016

Current coverage is 88.00% (diff: 100%)

No coverage report found for master at e76f95b.

Powered by Codecov. Last update e76f95b...b428c98

@MerlinSmiles
Copy link
Contributor Author

I forgot to mention that this plot is now a QtWidget, which allows to integrate it in other qt guis easily...

@eendebakpt
Copy link
Contributor

Just tested the PR and it works fine on my system. I took the liberty of adding part of my own additions to QtPlot: copying a figure to the system clipboard.

@MerlinSmiles
Copy link
Contributor Author

Great idea, what system are you using?
If I remember right I had problems with this clipboard stuff on windows, when the window was in the background...
Also for the naming maybe copy_to_clipboard would fit better? I have the feeling we should stick to qcodes style even though Qt does the other thing.

@eendebakpt
Copy link
Contributor

Some minor issues:

  • We might want to use qtpy (https://pypi.python.org/pypi/QtPy) to select the Qt interface. PyQt4 is pretty standard, but people also use PySide or PyQt5
  • Going from windowTitle to windowtitle makes the PR not backwards compatible. I just searched for a style-guide on function arguments in qcodes, but could not find it. One of the other arguments is show_window. I suggest we either use (showwindow, windowtitle) or (show_window, window_title), but no other combination

@MerlinSmiles
Copy link
Contributor Author

Good points!
yes I was struggling with those argument names, its really annoying if one package uses one style and another one another style, and if it basically just passes through... and then I just get it messed up.

As for QtPy, I never tried it, but it might be a good idea. I remember though having problems with PySide, and PyQtgraph wont work with PyQt5 I think. But yes, that shouldnt stop us from doing it right.

@eendebakpt
Copy link
Contributor

System is ubuntu 16.04, but our measurement system is windows, so we'll need that one as well (I can test next week). I agree using qcodes style is the right thing to do.

@MerlinSmiles
Copy link
Contributor Author

And thanks for testing this!

@peendebak peendebak mentioned this pull request Aug 3, 2016
@CJvanDiepen
Copy link
Contributor

@MerlinSmiles The dockarea .clear() function is not in 0.9.10 (the default installed by anaconda)
This gives an error when runnin the QtPlot.clear().

The commit for pyqtgraph is here:

pyqtgraph/pyqtgraph@76dbdaf

@CJvanDiepen
Copy link
Contributor

CJvanDiepen commented Aug 9, 2016

Also Dock.setTitle was only added later:

pyqtgraph/pyqtgraph@138fbb7

To solve the issues one can install a more recent version of pyqtgraph:

conda install -c nmearl pyqtgraph=0.9.11

@eendebakpt
Copy link
Contributor

@lgnjanssen
Copy link

@eendebakpt I can confirm. This solved it for me in python 3.4.5
geometry_settings = itertools.chain(figposition,figsize)
self.setGeometry(*geometry_settings)

@giulioungaretti
Copy link
Contributor

@MerlinSmiles 🍻 +review ?

@peendebak
Copy link
Contributor

@giulioungaretti @MerlinSmiles Any news on this PR?

@giulioungaretti giulioungaretti added the Qt Related to Qt-based features label Oct 27, 2016
'''
Get the default title for a data_array, which is used as the subplot
title. It is just the DataSet location and the array_id.
A custom title can be passed using **kwargs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MerlinSmiles kwargs? Am I missing something?

@giulioungaretti
Copy link
Contributor

@MerlinSmiles which version of py qt graph are you using ? the last release is 0.9.10

@giulioungaretti
Copy link
Contributor

actually, let's all wait until pyqtgraph/pyqtgraph#377 is closed and v 0.10.0 is released !

@giulioungaretti giulioungaretti self-assigned this Oct 31, 2016
@giulioungaretti giulioungaretti mentioned this pull request Nov 4, 2016
@giulioungaretti giulioungaretti deleted the feature/QtPlot branch November 10, 2016 12:31
@giulioungaretti giulioungaretti restored the feature/QtPlot branch November 10, 2016 13:44
@MerlinSmiles MerlinSmiles mentioned this pull request Nov 15, 2016
@giulioungaretti giulioungaretti modified the milestones: v0.1.2, v.0.1.3 Nov 21, 2016
@WilliamHPNielsen
Copy link
Contributor

I am closing this PR and deleting the branch after testimonies from Giulio and Merlin that this is nukeable.

@WilliamHPNielsen WilliamHPNielsen deleted the feature/QtPlot branch February 20, 2017 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement GUI Qt Related to Qt-based features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PyQtgraph live plot does not update positioning of plotting windows
8 participants