Difference between revisions of "BarChart Command"

From GeoGebra Manual
Jump to: navigation, search
m (Text replace - "<div class="box info"> 48px|left This page is part of the official manual for print and pdf. For structural reasons normal users can't edit this page. If you found any errors on this page please contact )
Line 5: Line 5:
 
{{Example|1=<code>BarChart[10, 20, {1, 2, 3, 4, 5} ]</code> gives you a bar chart with five bars of specified height in the interval [10, 20].}}
 
{{Example|1=<code>BarChart[10, 20, {1, 2, 3, 4, 5} ]</code> gives you a bar chart with five bars of specified height in the interval [10, 20].}}
  
; BarChart[Start Value ''a'', End Value ''b'', Expression, Variable ''k'', From Number ''c'', To Number ''d'']: Creates a bar chart over the given interval [''a, b''], that calculates the bars’ heights using the expression whose variable ''k'' varies from number ''c'' to number ''d''.
+
; BarChart[Start Value, End Value , Expression, Variable, From Number, To Number]: Creates a bar chart over the given interval [Start Value, End Value], that calculates the bars’ heights using the expression whose variable ''k'' varies from number ''c'' to number ''d''.
  
 
{{Example| 1=If ''p = 0.1'', ''q = 0.9'', and ''n = 10'' are numbers, then <code>BarChart[ -0.5, n + 0.5, BinomialCoefficient[n,k] * p^k * q^(n-k), k, 0, n ]</code> gives you a bar chart in the interval [''-0.5, n+0.5'']. The heights of the bars depend on the probabilities calculated using the given expression.}}
 
{{Example| 1=If ''p = 0.1'', ''q = 0.9'', and ''n = 10'' are numbers, then <code>BarChart[ -0.5, n + 0.5, BinomialCoefficient[n,k] * p^k * q^(n-k), k, 0, n ]</code> gives you a bar chart in the interval [''-0.5, n+0.5'']. The heights of the bars depend on the probabilities calculated using the given expression.}}

Revision as of 10:37, 15 March 2013



BarChart[Start Value, End Value, List of Heights]
Creates a bar chart over the given interval: the number of bars is determined by the length of the list, whose elements are the heights of the bars.
Example: BarChart[10, 20, {1, 2, 3, 4, 5} ] gives you a bar chart with five bars of specified height in the interval [10, 20].


BarChart[Start Value, End Value , Expression, Variable, From Number, To Number]
Creates a bar chart over the given interval [Start Value, End Value], that calculates the bars’ heights using the expression whose variable k varies from number c to number d.
Example: If p = 0.1, q = 0.9, and n = 10 are numbers, then BarChart[ -0.5, n + 0.5, BinomialCoefficient[n,k] * p^k * q^(n-k), k, 0, n ] gives you a bar chart in the interval [-0.5, n+0.5]. The heights of the bars depend on the probabilities calculated using the given expression.


BarChart[Start Value a, End Value b, Expression, Variable k, From Number c, To Number d, Step Width s]
Creates a bar chart over the given interval [a, b], the bars’ heights are calculated using the given expression in which the variable k varies from number c to number d using step width s.
BarChart[List of Raw Data, Width of Bars]
Creates a bar chart using the given raw data; the bars have the given width.
Example: BarChart[ {1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 5, 5, 5, 5}, 1]
BarChart[List of Data, List of Frequencies]
Creates a bar chart using the list of data with corresponding frequencies.
Example:
  • BarChart[{10, 11, 12, 13, 14}, {5, 8, 12, 0, 1}]
  • BarChart[{5, 6, 7, 8, 9}, {1, 0, 12, 43, 3}]
  • BarChart[{0.3, 0.4, 0.5, 0.6}, {12, 33, 13, 4}]
BarChart[List of Data , List of Frequencies, Width of Bars w]
Creates a bar chart using the list of data and corresponding frequencies; the bars have width w.
Example:
  • BarChart[{10, 11, 12, 13, 14}, {5, 8, 12, 0, 1}, 0.5] leaves gaps between bars.
  • BarChart[{10, 11, 12, 13, 14}, {5, 8, 12, 0, 1}, 0] produces a line graph.
© 2024 International GeoGebra Institute