Blog: Difference between revisions

From GretlWiki
Jump to navigation Jump to search
(Add tsplots)
m (Fixed formatting)
Line 11: Line 11:
First, using some other plotting commands, redirect the output to a string buffer inside a strings array. Then execute the gridplot command on that array. Example:  
First, using some other plotting commands, redirect the output to a string buffer inside a strings array. Then execute the gridplot command on that array. Example:  


<code>open australia</code>
<pre>
 
open australia
<code>strings temparr = array(2)</code>
strings temparr = array(2)
 
qqplot IAU --outbuf=temparr[1]
<code>qqplot IAU --outbuf=temparr[1]</code>
kdplot E --outbuf=temparr[2]
 
gridplot temparr --output=display
<code>kdplot E --outbuf=temparr[2]</code>
</pre>
 
<code>gridplot temparr --output=display</code>


Secondly, use the companion command ''gpbuild'' in a block format, and then define the individual parts:
Secondly, use the companion command ''gpbuild'' in a block format, and then define the individual parts:


<code>open data4-10</code>
<pre>
 
open data4-10
<code>gpbuild MyPlots</code>
gpbuild MyPlots
 
    gnuplot ENROLL CATHOL
<code> gnuplot ENROLL CATHOL</code>
    gnuplot ENROLL INCOME
 
    gnuplot ENROLL COLLEGE
<code> gnuplot ENROLL INCOME</code>
end gpbuild
 
gridplot MyPlots --output=display
<code> gnuplot ENROLL COLLEGE</code>
</pre>
 
<code>end gpbuild</code>
 
<code>gridplot MyPlots --output=display</code>


==== ''tsplots'' (virtual) command ====
==== ''tsplots'' (virtual) command ====
You can now use the new ''tsplots'' command to create several joint time-series plots easily. Example:
You can now use the new ''tsplots'' command to create several joint time-series plots easily. Example:


<code>open denmark</code>
<pre>
 
open denmark
<code>tsplots LRM LRY --output=display</code>
tsplots LRM LRY --output=display
</pre>


This has actually "always" been possible with the ''scatters'' command --and was duly documented-- but it was somewhat counterintuitive to use a command for scatter plots to draw time-series lines.
This has actually "always" been possible with the ''scatters'' command --and was duly documented-- but it was somewhat counterintuitive to use a command for scatter plots to draw time-series lines.

Revision as of 18:39, 31 October 2023

New features, fixed bugs, and software news are shown here

A good concise list is provided in the official changelog, here the aim is to be more explicit and sometimes give some examples. Before the respective new gretl version is released, the examples will only work in snapshots that are recent enough, or with self-compiled bleeding-edge versions.

New in what will be gretl 2023c

(this is just a selection, not exhaustive)

gridplot command

This new native command makes it possible to arrange several subplots in a grid (rectangular) layout. As such it will pretty much replace the contributed function package multiplot. There are basically two ways of using it:

First, using some other plotting commands, redirect the output to a string buffer inside a strings array. Then execute the gridplot command on that array. Example:

open australia
strings temparr = array(2)
qqplot IAU --outbuf=temparr[1]
kdplot E --outbuf=temparr[2]
gridplot temparr --output=display

Secondly, use the companion command gpbuild in a block format, and then define the individual parts:

open data4-10
gpbuild MyPlots
    gnuplot ENROLL CATHOL
    gnuplot ENROLL INCOME
    gnuplot ENROLL COLLEGE
end gpbuild
gridplot MyPlots --output=display

tsplots (virtual) command

You can now use the new tsplots command to create several joint time-series plots easily. Example:

open denmark
tsplots LRM LRY --output=display

This has actually "always" been possible with the scatters command --and was duly documented-- but it was somewhat counterintuitive to use a command for scatter plots to draw time-series lines.