Difference between revisions of "Template:Dot graph/doc"
imported>BrandonXLF (BrandonXLF moved page Template:Dot graph/doc to Template:Graph:Dot/doc: Unified) |
imported>BrandonXLF (←Removed redirect to Template:Graph:Dot/doc) |
||
| Line 1: | Line 1: | ||
| − | + | {{lua|Module:Dot graph|Module:Yesno|Module:Location map/multi|Module:Location map}} | |
| + | {{clear}} | ||
| + | ==Explanation== | ||
| + | This template is used to produce a [[Dot graph]]/Dot plot/[[Scatter plot]].<br/> | ||
| + | There are '''two''' ways of using this template ('''Usage A''' is more for scatter plots whereas '''Usage B''' is for [[Dot graph]]/Dot plots): | ||
| + | *'''Usage A''' ('''|''x''|''y''...'''): It takes a x input (0-100) then a y input (0-100) and so on <nowiki>{{Graph:Dot|x|y|x|y|x|y|x|y|...}}</nowiki> | ||
| + | *'''Usage B''' ('''|cols=|dots=|''y...'''''): It takes cols = ''number of columns (x)'' and dots = ''number of dots per columns'' <nowiki>{{Graph:Dot|cols=#|dots=#|y|y|y|y|y|...}}</nowiki> | ||
| + | :*'''Example''': <nowiki>{{Graph:Dot|0|10|0|90|33|20|33|80|66|40|66|60}}</nowiki> ≈ <nowiki>{{Graph:Dot|cols=3|rows=2|10|90|20|80|40|60}}</nowiki> | ||
| + | :*'''Note''': cols + rows should equal the number of values that follow | ||
| + | :*'''Note''': Usage B almost always has more precision then Usage B | ||
| + | :*'''Note''': x inputs are from 0-100 and y inputs are from 0-100 | ||
| + | This template also takes a variety of other parameters: | ||
| + | * '''|color-''#=''''' The template can take a color input for each do that is color-''dot number'' (The default color is red) (overrides '''color-even''' and '''color-odd''') | ||
| + | * '''|align=''' The alignment of the chart (default right) | ||
| + | * '''|color=''' The background color (default none/transparent) | ||
| + | * '''|border=''' Whether of not to show the border (default yes) | ||
| + | * '''|yx=''' Take y then x instead of x then y (default no) | ||
| + | * '''|color-even=''' Sets every other dot to a specific color (default red) | ||
| + | * '''|color-odd=''' Sets every odd dot to a specific color (default blue) | ||
| + | * '''|square=''' Makes the chart/plot a square (default no) | ||
| − | {{ | + | ==Examples== |
| + | <code><nowiki>{{Graph:Dot|align=left|10|20|10|60|50|40|50|60|90|10|90|20}}</nowiki></code> | ||
| + | {{Graph:Dot|align=left|10|20|10|60|50|40|50|60|90|10|90|20}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|align=left|0|100|100|0|0|0|100|100}}</nowiki></code> | ||
| + | {{Graph:Dot|align=left|0|100|100|0|0|0|100|100}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|yx=yes|align=left|10|20|10|60|50|40|50|60|90|10|90|20}}</nowiki></code> | ||
| + | {{Graph:Dot|yx=yes|align=left|10|20|10|60|50|40|50|60|90|10|90|20}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|align=left|cols=3|dots=2|90|10|80|20|70|30}}</nowiki></code> | ||
| + | {{Graph:Dot|align=left|cols=3|dots=2|90|10|80|20|70|30}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|square=yes|align=left|cols=3|dots=2|90|10|80|20|70|30}}</nowiki></code> | ||
| + | {{Graph:Dot|square=yes|align=left|cols=3|dots=2|90|10|80|20|70|30}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|align=right|40|10|60|10|40|20|60|20|40|30|60|30|color-1=blue|color-3=blue|color-5=blue}}</nowiki></code> | ||
| + | {{Graph:Dot|align=right|10|20|10|60|50|40|50|60|90|10|90|20|color-1=blue|color-3=blue|color-5=blue}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|align=left|40|10|60|10|40|20|60|20|40|30|60|30|color-even=blue}}</nowiki></code> | ||
| + | {{Graph:Dot|align=left|10|20|10|60|50|40|50|60|90|10|90|20|color-even=blue}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|align=center|40|10|60|10|40|20|60|20|40|30|60|30|color-odd=blue}}</nowiki></code> | ||
| + | {{Graph:Dot|align=center|10|20|10|60|50|40|50|60|90|10|90|20|color-odd=blue}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|border=no|align=left|10|20|10|60|50|40|50|60|90|10|90|20|color-1=blue|color-3=blue|color-5=blue}}</nowiki></code> | ||
| + | {{Graph:Dot|border=no|align=left|10|20|10|60|50|40|50|60|90|10|90|20|color-1=blue|color-3=blue|color-5=blue}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|color=green|align=left|10|20|10|60|50|40|50|60|90|10|90|20|color-1=blue|color-3=blue|color-5=blue}}</nowiki></code> | ||
| + | {{Graph:Dot|color=green|align=left|10|20|10|60|50|40|50|60|90|10|90|20|color-1=blue|color-3=blue|color-5=blue}} | ||
| + | {{clear}} | ||
| + | |||
| + | ==Error messages== | ||
| + | <code><nowiki>{{Graph:Dot|color=green|align=left|10|20|10|60|50|40|50|60|90|10|90}}</nowiki></code> | ||
| + | {{Graph:Dot|color=green|align=left|10|20|10|60|50|40|50|60|90|10|90}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|yx=yes|color=green|align=left|10|20|10|60|50|40|50|60|90|10|90}}</nowiki></code> | ||
| + | {{Graph:Dot|color=green|yx=yes|align=left|10|20|10|60|50|40|50|60|90|10|90}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|align=left|cols=3|90|10|80|20|70|30}}</nowiki></code> | ||
| + | {{Graph:Dot|align=left|dots=2|90|10|80|20|70|30}} | ||
| + | {{clear}} | ||
| + | ---- | ||
| + | <code><nowiki>{{Graph:Dot|align=left|dots=2|90|10|80|20|70|30}}</nowiki></code> | ||
| + | {{Graph:Dot|align=left|cols=3|90|10|80|20|70|30}} | ||
| + | {{clear}} | ||
| + | |||
| + | <includeonly><!--Categories etc here-->[[Category:Graph, chart and plot templates]]</includeonly> | ||
Revision as of 06:37, 23 September 2018
| This template uses Lua: |
Explanation
This template is used to produce a Dot graph/Dot plot/Scatter plot.
There are two ways of using this template (Usage A is more for scatter plots whereas Usage B is for Dot graph/Dot plots):
- Usage A (|x|y...): It takes a x input (0-100) then a y input (0-100) and so on {{Graph:Dot|x|y|x|y|x|y|x|y|...}}
- Usage B (|cols=|dots=|y...): It takes cols = number of columns (x) and dots = number of dots per columns {{Graph:Dot|cols=#|dots=#|y|y|y|y|y|...}}
- Example: {{Graph:Dot|0|10|0|90|33|20|33|80|66|40|66|60}} ≈ {{Graph:Dot|cols=3|rows=2|10|90|20|80|40|60}}
- Note: cols + rows should equal the number of values that follow
- Note: Usage B almost always has more precision then Usage B
- Note: x inputs are from 0-100 and y inputs are from 0-100
This template also takes a variety of other parameters:
- |color-#= The template can take a color input for each do that is color-dot number (The default color is red) (overrides color-even and color-odd)
- |align= The alignment of the chart (default right)
- |color= The background color (default none/transparent)
- |border= Whether of not to show the border (default yes)
- |yx= Take y then x instead of x then y (default no)
- |color-even= Sets every other dot to a specific color (default red)
- |color-odd= Sets every odd dot to a specific color (default blue)
- |square= Makes the chart/plot a square (default no)
Examples
{{Graph:Dot|align=left|10|20|10|60|50|40|50|60|90|10|90|20}}
Script error: No such module "Dot chart".
{{Graph:Dot|align=left|0|100|100|0|0|0|100|100}}
Script error: No such module "Dot chart".
{{Graph:Dot|yx=yes|align=left|10|20|10|60|50|40|50|60|90|10|90|20}}
Script error: No such module "Dot chart".
{{Graph:Dot|align=left|cols=3|dots=2|90|10|80|20|70|30}}
Script error: No such module "Dot chart".
{{Graph:Dot|square=yes|align=left|cols=3|dots=2|90|10|80|20|70|30}}
Script error: No such module "Dot chart".
{{Graph:Dot|align=right|40|10|60|10|40|20|60|20|40|30|60|30|color-1=blue|color-3=blue|color-5=blue}}
Script error: No such module "Dot chart".
{{Graph:Dot|align=left|40|10|60|10|40|20|60|20|40|30|60|30|color-even=blue}}
Script error: No such module "Dot chart".
{{Graph:Dot|align=center|40|10|60|10|40|20|60|20|40|30|60|30|color-odd=blue}}
Script error: No such module "Dot chart".
{{Graph:Dot|border=no|align=left|10|20|10|60|50|40|50|60|90|10|90|20|color-1=blue|color-3=blue|color-5=blue}}
Script error: No such module "Dot chart".
{{Graph:Dot|color=green|align=left|10|20|10|60|50|40|50|60|90|10|90|20|color-1=blue|color-3=blue|color-5=blue}}
Script error: No such module "Dot chart".
Error messages
{{Graph:Dot|color=green|align=left|10|20|10|60|50|40|50|60|90|10|90}}
Script error: No such module "Dot chart".
{{Graph:Dot|yx=yes|color=green|align=left|10|20|10|60|50|40|50|60|90|10|90}}
Script error: No such module "Dot chart".
{{Graph:Dot|align=left|cols=3|90|10|80|20|70|30}}
Script error: No such module "Dot chart".
{{Graph:Dot|align=left|dots=2|90|10|80|20|70|30}}
Script error: No such module "Dot chart".