File: tutorial3.rst

package info (click to toggle)
psychopy 2020.2.10%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 44,056 kB
  • sloc: python: 119,649; javascript: 3,022; makefile: 148; sh: 125; xml: 9
file content (15 lines) | stat: -rw-r--r-- 1,085 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Tutorial 3: Analysing data in Python
=========================================

You could simply output your data as tab- or comma-separated text files and analyse the data in some spreadsheet package. But the `matplotlib`_ library in Python also allows for very neat and simple creation of publication-quality plots. 

This script shows you how to use a couple of functions from PsychoPy to open some data files (:func:`psychopy.gui.fileOpenDlg`) and create a psychometric function out of some staircase data (:func:`psychopy.data.functionFromStaircase`). 

`Matplotlib`_ is then used to plot the data.

.. note:: `Matplotlib`_ and :mod:`pylab`. Matplotlib is a python library that has similar command syntax to most of the plotting functions in Matlab(tm). In can be imported in different ways; the ``import pylab`` line at the beginning of the script is the way to import matploblib as well as a variety of other scientific tools (that aren't strictly to do with plotting *per se*).

.. _matplotlib: http://matplotlib.sourceforge.net/

.. literalinclude:: tutorial3.py
   :linenos: