Viewrendered3 Now Has Simple Plotting Capability

26 views
Skip to first unread message

tbp1...@gmail.com

unread,
Nov 5, 2021, 8:46:46 AM11/5/21
to leo-editor
Version 3.5 has a new capability.  It is included in the latest *devel* branch.  A selected node with rows of data can be displayed as an X-Y graph.  The data can have either one or two columns (any more columns will be ignored).  So a node like this:

Here is some two-column data:

1  1
2  4
3  6

will produce a plot like the attached file.  If there is only one column:

1
4
6

then VR3 will add a serially numbered X column starting from 0.

Optionally, the graph can be labeled and its appearance changed.  For example, you could apply the "xkcd" style, or the "ggplot" style used in the example image file.

This new plotting function is available from a new menu button on the VR3 toolbar named *Other Actions*. This menu also has an item for help with the plotting function, which opens a Help page in the system browser.  Among other things, the Help page shows how to configure the optional style and labels.

The *Reload* function has been moved to this new menu.  The old dedicated *Reload* button would have made the toolbar too wide.

This new capability is very forgiving about the format of the node to be plotted.  Almost any text that has one or more columns of whitespace-separated numbers will plot without any changes, since non-numeric and blank lines are ignored.  This is ideal for quickly typing or pasting some copied text and seeing the shape of the data, all without writing any code or needing to save the data to a file first.

Here is an example, complete with the optional label and styling sections:

1 1
2 2
3 4
# comment
; comment
; Blank lines ignored:

4 16
5 32

[labels]
title = Plot Example
xaxis = Days
yaxis = Values

[style]
# For VR3 "Plot 2D", only one of these 
# will be used. "stylename" has priority
# over "stylefile".
stylename = ggplot
#stylefile = styles.mpl

With this release, images displayed by an @image directive are shown at 100% width (ReStructuredText only).
sample_plot.png

Edward K. Ream

unread,
Nov 5, 2021, 9:35:12 AM11/5/21
to leo-editor
On Fri, Nov 5, 2021 at 7:46 AM tbp1...@gmail.com <tbp1...@gmail.com> wrote:
Version 3.5 has a new capability.  It is included in the latest *devel* branch. 

Many thanks for your continued work on VR3.

Edward
Reply all
Reply to author
Forward
0 new messages