Plotlib 0.4

Overview of plotlib features

This library aims to emulate Matlab graphics features, i.e. macros and property/value pairs. Some already existing Scilab macros already correctly emulate the Matlab ones and were not considered in the Plotlib.

## Recall of the Matlab-like native Scilab macros

title - add a title to a given or current Axes

xlabel - add a label on the X axis to a given or current Axes

ylabel - add a label on the Y axis to a given or current Axes

zlabel - add a label on the Z axis to a given or current Axes

## Plotlib general functions

plotlibmode - plotlib compatibility mode

axis - set/get the axis limits and type

figure - creates/activates a figure

grid - add/toggle a grid on a graph

hold - holds/releases current plot

legend - adds a legend

shg - brings a window on the foreground

subplot - Create axes in tiled positions.

drawnow - Flushed postponed graphics commands.

## Plotlib 2D functions

pcolor - 2D pseudo color patches

plot - generic plot function.

plotyy - generic plot function.

fill - fill 2D polygons

loglog - plot with logarihtmic x andy scale

quiver - vector field plot

semilogx - plot with logarihtmic x scale

semilogy - plot with logarihtmic y scale

tripcolor - 2D pseudo color patches based on a triangulation

triplot - plot 2D mesh based on a triabgulation

## Plotlib 3D functions

fill3 - fill 3D polygons

plot3 - Plot lines and points in 3-D space.

mesh - 3D mesh surface.

surf - 3D colored surface.

surfl - 3D surface with lighting

quiver3 - 3d vector field defined on a surface

trimesh - 3D surface mesh based on a triangulation

trisurf - 3D colored surface based on a triangulation

trisurfl - 3D surface based on a triangulation, with lighting

view - sets the view point

## Plotlib Color management

The plotlib differentiates the colormap used for axes, polyline and other linear entities and the colormap for pesudo-color 2D and surface plots. The actual color of such entities is determined by their CData and CDataMapping properties and by the CLim and CLimMode properties of the parent Axes. When CLimMode is equal to 'auto' the the CLim property changes dynamically as entites are added or removed from the Axes.

caxis - set/get color axis

colormap - Set/get the colormap of currently active figure

colorbar - Adds a colorbar

shading - Change the shading model

whitebg - Set the default color scheme

## Plotlib new graphic objects properties

The new properties of graphical entities are fields of the user_data field and a Plotlib graphic handle is just a Scilab native graphic handle encapsulated in a mlist of type "pltlibH". By using the overloading features of Scilab, these two kinds of handles can be read or changed transparently by using the set and get macros. The native Scilab graphic properties of the encapsulated handle are also transparently read or changed by these two macros.

The default display function %pltlibH_p for plotlib handles just gives the type of the handle. To display and/or get a single property, you can use the get function or the . field operator. Idem for the set operation :

    h=surfl()
    z=get(h,'ZData');
    z=h.ZData;
    set(h,'CData',z);
    h.CData=rand(z);

You can get more than one property value at a time, by using a vector of strings, or get all properties by omitting the property. In both cases, get returns a struct with corresponding fieldnames.

    h=pcolor()
    get(h,['FaceColor','EdgeColor'])
    get(h)

Leaf properties - Leaf properties

Axes properties - Axes properties

Figure properties - Figure properties

## Authors

- Stéphane Mottelet