SciPlot-PyQt (aka SciPlot) is a user-interface/matplotlib wrapper built with PyQt5 that allows interactive plotting through an embedded matplotlib canvas. It enables fast and easy publication-ready plots and images:
Note: These are the developmental system specs. Older versions of certain packages may work.
Note: the installer only checks for the dependencies of matplotlib and numpy. PyQt5 is not checked for, though, it is also required. See Depencies above for more information and requirements.
# Only Python 3.* installed pip install sciplot-pyqt # If you have both Python 2.* and 3.* you may need pip3 install sciplot-pyqt
# Make new directory for sciplot-pyqt and enter it # Clone from github git clone https://github.com/CCampJr/SciPlot-PyQt.git # Only Python 3.* installed pip install -e . # If you have both Python 2.* and 3.* you may need instead pip3 install -e . # To update in the future git pull
You will need to download the repository or clone the repository with git:
# Make new directory for sciplot-pyqt and enter it # Clone from github git clone https://github.com/CCampJr/SciPlot-PyQt.git
Perform the install without building the documentation:
python setup.py install
Perform the install and build the documentation (see dependencies above):
python setup.py build_sphinx python setup.py install
import sciplot
sp = sciplot.main()
Note Sciplot-pyqt relies on an existing, active Qt5 QApplication instance to operate. Some versions of Matplotlib 1.5.* provide this, others do not. Matplotlib 2.* seems to always provide this functionality.
If you perform the examples below and just a non-repsonsive white window appears, follow up the plotting commands with:
sp.app.exec_()
Sciplot tests for this and will provide you with a message to your terminal:
No QApplication instance (this is common with certain version of Matplotlib). Creating one. You will need to exec manually after you finish plotting. -----------Example--------------- import sciplot sp = sciplot.main() # Plot a line sp.plot((0,1),(0,1)) # Start the QApplication sp.app.exec_()
sp.plot((0,1),(2,3),label='Line', x_label='X', y_label='Y', ls='--')
sp.fill_between((0,1),(1,2),(3,4),label='Fill Between', color='r', alpha=0.25)
sp.hist(r, bins=100, label='Histogram', color=[0, .2, .3],
x_label='Amplitude', y_label='Counts', alpha=0.5)
sp.imshow(r, clim=[25,75], cmap='viridis', label='Imshow', x_label='X (pix)',
y_label='Y (pix)')
This software was developed at the National Institute of Standards and Technology (NIST) by employees of the Federal Government in the course of their official duties. Pursuant to Title 17 Section 105 of the United States Code, this software is not subject to copyright protection and is in the public domain. NIST assumes no responsibility whatsoever for use by other parties of its source code, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
Specific software products identified in this open source project were used in order to perform technology transfer and collaboration. In no case does such identification imply recommendation or endorsement by the National Institute of Standards and Technology, nor does it imply that the products identified are necessarily the best available for the purpose.
Charles H Camp Jr: charles.camp@nist.gov
Charles H Camp Jr, Mona Lee
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。