How to Create Multi-Layer Graphs in SciDAVis

A SciDAVis graph window can hold more than one plot. Each plot lives in its own layer, and layers can be arranged side by side, stacked, overlaid on twin axes, or shrunk into an inset zoom box — all inside a single graph window that exports as one figure. The core command is Graph → Add Layer. This guide builds the three most useful arrangements step by step, with honest notes on what SciDAVis synchronizes for you (little) and what you must do by hand.

Version note: written for v2.9.x (SourceForge binaries are 2.8). Layer handling is identical in both.

Background: what a layer is

Think of a graph window as a sheet of paper and each layer as a transparent plot pasted onto it. A new graph starts with one layer. Graph → Add Layer adds another; Graph → Remove Layer deletes the active one (which also deletes its plot). Almost every formatting command — axes, titles, grid, curves — applies to the active layer, the one whose canvas you last clicked. When a step below says “select the layer,” it means: click inside that layer’s plot area first.

Arrangement 1 — Stacked panels sharing an x-axis

The classic multi-panel figure: two or three plots above each other, same x-range (time, wavelength, …), different y-quantities.

  1. Create your first plot normally (select X and Y columns, Plot menu, e.g. Line).
  2. Choose Graph → Add Layer. In the dialog, set up the grid of layers — for two stacked panels, two rows and one column — and confirm. An empty layer appears.
  3. Click the new (empty) layer to activate it, then add its curve: Graph → Add/Remove Curve opens the curve dialog, where you pick the table and the X/Y columns for this layer. (This dialog is also how you add further curves to any layer.)
  4. Match the x-axes: select the top layer, open Format → Scales, and note its X range. Select the bottom layer, open the same dialog, and set the identical X range. Repeat for every layer.
  5. Clean up: give each layer its own Y title, keep the X title only on the bottom layer, and hide redundant tick labels on the upper layers via the same Scales dialog.
Honest limitation: SciDAVis does not link layer axes automatically. If you later zoom or rescale one layer, the others don’t follow — you must re-enter the ranges by hand. For a figure you export once, that’s fine; for interactive exploration, prefer a single plot.

Arrangement 2 — Twin y-axes (two quantities, one x-axis)

  1. Start with a single-layer graph containing the first curve.
  2. Add the second curve to the same layer via Graph → Add/Remove Curve, then attach it to the opposite axes: a curve can be bound to the left or right Y axis (and bottom or top X axis) through the curve/axis settings — the scripting equivalent is setCurveAxes(), which exposes Layer.Left / Layer.Right / Layer.Top / Layer.Bottom.
  3. Enable the right-hand axis and set its range in Format → Scales, choosing a range that fits the second quantity.
  4. Label both axes clearly (Y title left, Y title right) and use the legend to identify which curve belongs to which axis. Twin-axis plots are easy to misread — color-code curve and axis titles to match.

Arrangement 3 — Inset zoom box

A small zoomed view floating over the main plot — the standard “see the peak up close” figure.

  1. Create the main plot in the first layer.
  2. Graph → Add Layer to add a second layer, and add the zoomed curve to it (same data, or a subset).
  3. Shrink and position the second layer: resize the layer’s canvas by dragging its borders (or via the layer geometry settings) and drag it over the main plot where it doesn’t cover important data — a corner is the usual choice.
  4. Make the inset readable: give the inset layer an opaque white background so the main plot doesn’t show through, set its axis ranges to the zoom window in Format → Scales, and keep its tick labels small.
  5. Optionally draw attention with an arrow or rectangle from the main plot region to the inset (Graph menu drawing tools).

Formatting rules that save you headaches

  • Always check which layer is active before changing anything. Nine out of ten “my formatting disappeared” mysteries are edits applied to the wrong layer.
  • Set the window size before fine-tuning. Layer positions are relative to the graph window; resizing the window afterwards shifts everything. Decide the final figure size first (see exporting for publication), then arrange.
  • Fonts and line widths should match across layers — set them per layer, because there is no “apply to all layers” for most style settings.
  • Save the project (.sciprj) before exporting. Multi-layer arrangements are fiddly; you will want to come back and tweak.

The same thing from Python (optional)

Layers are scriptable. The documented API includes g.addLayer(), g.activeLayer(), l.insertCurve(table, column), and title/scale setters like l.setXTitle() and l.setScale() — handy for generating families of identical multi-panel figures. Details in the Python scripting guide.

Next steps

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *