Metview's documentation is now on readthedocs!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Overview

In addition to geographic map plots, Metview can also generate XY plots including time series.

The possible ways to provide data for graph plotting are:

The coordinate system is defined by the Cartesian View icon, the visual appearance of the axes by the Axis Plotting icons and the title by the Text Plotting icon. The data points themselves can be modified with the Symbol Plotting (for points) and Graph Plotting (for lines) icons.

XXXX download data

A Simple Graph

Create a new Input Visualiser icon. Set Input Plot Type to XYPoints and type a list of values (forward slash-delimited) for both Input X Values and Input Y Values (they should have the same number of elements).

Visualise the icon to get a basic plot of the data. You can drop a customised Symbol Plotting icon into the Display Window to change the numbers into markers. Also try dropping a Graph Plotting icon to get connecting lines between the points.

If you wish to have a plot where the individual points are coloured according to some value, set Input Values to a list of numbers. Then an appropriate Symbol Plotting icon will colour the markers. Notice that the automatically-generated view fits your data so that the 'edge points' are on the axes.

Customising the view

Now that we have a simple plot, we can make it more professional.

Create a new Cartesian View icon. Ensure that X Automatic and Y Automatic are set to Off, then set X Min, X Max, Y Min and Y Max so that they provide some space around your data points. Visualise the icon and drop your Input Visualiser into the Display Window to see the result.

Customising the axes

Create a new Axis Plotting icon and rename it h_axis. Try modifying it to produce a horizontal axis similar to the one shown. Just drop it into the Display Window to test it.

Now create another one called v_axis and make it the vertical axis:

Axis OrientationVertical

Customise this similarly.

You can bind the axis icons to the view icon by dropping them into the Horizontal Axis and Vertical Axis parameter boxes in the Cartesian View icon editor. Now when you visualise this view icon, it will have your customised axes.

Add a title

We will look in more detail at plot titles, but for now just create a new Text Plotting icon and set Text Line 1 to a suitable title for your plot; drop it into the Display Window to apply it.

Putting it into a macro

Now drop the Cartesian View icon into the editor of a new Macro icon - the Axis icon definitions will be automatically included. Do the same with the other icons and add a plot() command, remembering that the view should be the first argument, followed by a data variable, followed by any visdefs to be applied to it.

 

 

 

  • No labels