Basic philosophy: Plots must come out pretty by default (no effort from the user), not after hours of tweaking.
Usually plots are generated from aggregated data produced by aggregate() or accuracy(). These DataFrames have a very rich structure allowing for a production of nicely labelled plots.
Create a new Plot instance:
plt = plot.Plot()
Observe that figures are objects in psychopy_ext. The benefit of this approach is a seamless handling of subplots: the figure knows where to put the next subplot. To determine the shape of subplots, define nrows_ncols parameter when creating a Plot object, e.g., nrows_ncols = (2,1). Active subplot is advanced after each plot() call.
Plot any kind of a plot by calling plot() with a kind keyword. Currently recognized kinds of plots: - line - bar - bean - scatter - mds (multidimensional scaling) - histogram
For example, if the data is stored in a variable agg, then a line plot is called like this:
plt.plot(agg, kind='line')
Show the plot:
plt.show()
Note that currently all plot objects will be shown (i.e., if you have plt1 and plt2, and you call plt1.show(), plt2 will be shown as well.
Hint: Did you want a different order of lines or bars? Check Reordering aggregates.
(Note that these plots were generated automatically without any tweaking.)
As powerful as the plot class is, additional tweaking will be necessary. Here are a few useful functions:
Continue to Test stimuli with models.