Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Whenever you have a plot window open which displays any map or graph, you are able to export the plot into other file formats. You can either select the export button in the menu (looks like a disk)

Image Modified   , by selecting File > Export  Image Modified or by using the Ctrl+s keyboard shortcut.

 

You will get a dialogue as shown below

Image Modified

 

Image Modified

Tasks

  1. From an open display window, try to save your plot as a PDF.
  2. Now try to save your plot as a SVG without and with fixed dimensions.
    1. Open both files in Firefox and see how the plots behave when you resize the browser window.
    2. Open one of the SVGs in inkscape and edit the images (for example add some text) and save it as a PDF.

...

So it is enough to check this string and to code accordingly, either using if/else conditions or the case/of condition test. To introduce the new functionality replace the existing unconditional call to setoutput() by the following lines of code :

...

One important piece of functionality that we have omitted is the ability to save our derived data. Add some code to handle the Save run mode by saving the derived data in a file. There are three things you will have to do:

  • at the end of the run mode checks, instead of

else fail ( ... )

...

  • we should not fail if the mode is “save”:

else if (mode <> "save")

 then

    then fail ( ... )

...

  • we must again check the run mode, and if it is Save then write the data to a file; otherwise plot the data.

Pages

Some graphical formats, such as PostScript and PDF, allow multiple pages within the documents. Other formats, such as PNG, which will contain a single page at the time and therefore contain a number in their name to indicate which page number they contain. You can trigger a new page in Metview Macro with the function

...