Satimage Previous | Next
The plot view
Home Documentation SmileLab Scripting Graphic objects Graphic view Plot view  
Introduction
The plot view is dedicated to displaying curves . It contains objects of the class curve. The QuickPlotLib library offers several macro-commands to produce plot views and curves, that you may find quite convenient and fast to use.
Making graphs with QuickPlotLib
Even if you use QuickPlotLib you should know the following basics regarding object resolution:
  • plot views display data in curves
  • c being a reference to a given curve you can retrieve a reference to the plot view that contains that curve as c's container, container of c, c's plot view, plot view of c, c's chart view, chart view of c, c's graphic view or graphic view of c -- these expressions are equivalent.
  • c being a reference to a given curve you can retrieve a reference to the graphic window that contains that curve as c's window or window of c. The plot view as well as the curve supports the window property.
Graphic options for the plot view

Most of the settings available for the plot view are also shared by the planar view class so they are documented above in The chart view object - the common ancestor to both classes.

legend kind
As you can see in the dictionary (Smile ▸ Smile dictionary) the plot view offers settings regarding how it displays legends. Indeed the plot view may display the legends, either as a rectangular cartouche somewhere in its plot frame, or on the curves themselves. Setting legend kind to 1 means "no legend", 2 means "legend in a rectangular cartouche", 3 means "legends on the curves". Each curve owns a in legend boolean property which specifies whether it will be taken or not into account for the legends.
legend frame
If you set legend kind to 2 then by default the plot view will display the rectangular cartouche in the upper left corner of the plot frame. You can change the location of the cartouche by setting the legend frame property. The legend frame should be a list {x0, y0, dx, dy} of real numbers (in pixels) that specify the coordinates of the origin {x0, y0} and the dimensions of the cartouche {dx, dy}. Actually SmileLab will compute itself the horizontal and vertical sizes of the cartouche and will not use dx and dy directly. Instead SmileLab will do its best to guess what corner you really want to pin. This policy may seem a bit complicated but it allows the legend to scale and move with as much grace and user-friendliness as possible when the user resizes the plot.
Thus in most cases you can pass any reasonable values for dx, dy: pass 40, 20 for instance.
legend sample length, legend height
The rectangular cartouche contains a sample of each curve in the plot view (precisely, each curve whose in legend property was not set to false). You can customize the length of the sample by providing a legend sample length property in pixels to the plot view. The legend height property defines the height of each line of the legend in the cartouche.
legend abscissa
If you set legend kind to 3 then you have to choose the abscissa where the plot view will print the legends on the curves. All legends print at the same absissa. You specify the abscissa by setting the legend abscissa, in user units. Neither legend frame nor legend sample length are considered when legend kind is 3.
set c to QuickCurves({-pi, pi}, {"x*cos(x)", "x*sin(x)"}, 0)
set v to plot view of c
set name of c to "\\theta.cos(\\theta)"
set name of curve 2 of v to "\\theta.sin(\\theta)"
set legend kind of v to 3
set legend abscissa of v to -1
set legend text size of v to 15
draw v
The settings window
The Settings window is a dialog window which lets you edit the properties of the plot views and the properties of their curves.
  • to open the Settings window of a plot view pull down its contextual menu (ctrl-click the object) and select Open settings.
  • choose a category (Window, Plot, Axis, Legend or Curves) in the Display menu section to access more settings.
Copyright ©2008 Paris, Satimage