qplotView: Plot view

Description Usage Arguments Details Value Author(s)

View source: R/view.R


An extension of QGraphicsView with special functionality for plotting statistical graphics.


qplotView(scene, parent, rescale=c("geometry", "transform", "none"), opengl=TRUE)



The scene, a QGraphicsScene


The parent QObject, usually a QWidget to contain the view


The rescale mode, see details


If TRUE, use OpenGL, otherwise the software driver


The PlotView class extends QGraphicsView to add two new features, from the user perspective. First, it automates rescaling when the widget is resized. There are three rescale modes: geometry, transform and none:


Most similar to how base R graphics devices behave: the geometry of the figure is fixed to the geometry of the view. This mode is often convenient but really only works if there is only a single view for each scene.


Adjusts the view transform so that the visible region of the scene does not change due to size changes. This is most similar to the behavior of GGobi and supports multiple views of the same scene. The downside is that the layout is not activated, so it cannot adapt to make better use of the available space. It works best with graphics that overlay guides on the plot, rather than position them adjacent to the plot in a layout.


No rescaling is performed; when the size changes, more or less of the plot is shown. This is probably the most common mode in zoomable user interfaces.

The other feature is the overlay scene: a separate scene that is fixed to the geometry of the viewport. It is always shown over the primary scene and it is stationary across transformations and scrolling of the viewport. This is useful for overlaying guides on a plot in a fixed position, like the axes in GGobi. Call the overlay method on a plot view instance to obtain the overlay scene and manipulate it directly.


A C++ PlotView object


Michael Lawrence

qtpaint documentation built on May 30, 2017, 8:14 a.m.