Maxima – 233 – descriptive – 10

52170

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.732.

Funzioni e variabili per grafici statistici

barsplot (data1, data2, ..., option_1, option_2, ...)
Plots bars diagrams for discrete statistical variables, both for one or multiple samples.

data can be a list of outcomes representing one sample, or a matrix of m rows and n columns, representing n samples of size m each.

Available options are:

  • box_width (default, 3/4): relative width of rectangles. This value must be in the range [0,1].
  • grouping (default, clustered): indicates how multiple samples are shown. Valid values are: clustered and stacked.
  • groups_gap (default, 1): a positive integer number representing the gap between two consecutive groups of bars.
  • bars_colors (default, []): a list of colors for multiple samples. When there are more samples than specified colors, the extra necessary colors are chosen at random. See color to learn more about them.
  • frequency (default, absolute): indicates the scale of the ordinates. Possible values are: absolute, relative, and percent.
  • ordering (default, orderlessp): possible values are orderlessp or ordergreatp, indicating how statistical outcomes should be ordered on the x-axis.
  • sample_keys (default, []): a list with the strings to be used in the legend. When the list length is other than 0 or the number of samples, an error message is returned.
  • start_at (default, 0): indicates where the plot begins to be plotted on the x-axis.
  • All global draw options, except xtics, which is internally assigned by barsplot. If you want to set your own values for this option or want to build complex scenes, make use of barsplot_description.
  • The following local Chapter draw-pkg options: key, color_draw, fill_color, fill_density and line_width.

There is also a function wxbarsplot for creating embedded histograms in interfaces wxMaxima and iMaxima. barsplot in a multiplot context.

Univariate sample in matrix form. Absolute frequencies.

(%i1) load ("descriptive")$

(%i2) m : read_matrix (file_search ("biomed.data"))$

(%i3) barsplot(col(m,2),title= "Ages", xlabel= "years",
               box_width= 1/2,fill_density = 3/4)$

233-0

Two samples of different sizes, with relative frequencies and user declared colors.

(%i4) l1:makelist(random(10),k,1,50)$

(%i5) l2:makelist(random(10),k,1,100)$

(%i6) barsplot(l1, l2, box_width = 1, fill_density = 1, bars_colors = [black, grey],
               frequency = relative, sample_keys = ["A", "B"])$

233-1

Four non numeric samples of equal size.

(%i7) barsplot(
          makelist([Yes, No, Maybe][random(3)+1],k,1,50),
          makelist([Yes, No, Maybe][random(3)+1],k,1,50),
          makelist([Yes, No, Maybe][random(3)+1],k,1,50),
          makelist([Yes, No, Maybe][random(3)+1],k,1,50),
          title = "Asking for something to four groups",
          ylabel = "# of individuals", groups_gap = 3,
          fill_density = 0.5, ordering = ordergreatp)$

233-2

Stacked bars.

(%i8) barsplot(
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        title = "Asking for something to four groups",
        ylabel = "# of individuals", grouping = stacked,
        fill_density = 0.5, ordering = ordergreatp)$

233-3

For bars diagrams related options, see barsplot of package draw-pkg. See also functions histogram and piechart.

Posta un commento o usa questo indirizzo per il trackback.

Trackback

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d blogger hanno fatto clic su Mi Piace per questo: