Charts and drawings in LaTeX: pgfplots and TikZ
Charts and drawings work in Scissor LaTeX: it draws pgfplots and TikZ pictures itself, for a large common subset, so a tikzpicture typesets in the browser like any other part of the document.
How charts work here
A TeX installation runs the pgfplots and TikZ packages, which are large programs written in TeX. Scissor LaTeX has no TeX inside, so its typesetter reads the picture code itself and draws the lines, marks, axes and labels directly. Most everyday plots and diagrams come out as you would expect. An option it does not know yet is skipped, and the Problems tab names it, so the rest of the picture still appears.
Start with pgfplots basics for plots, or Drawings with TikZ for diagrams. The package pages list every supported feature: pgfplots and TikZ.
Pages in this section
- pgfplots basics: plots in LaTeX with examplesLoad
pgfplots, open atikzpicturewith anaxisinside, and add each data series with\addplot, either as a list of coordinates or as a formula. - Line plots with pgfplotsAdd one
\addplotper line inside anaxis; style each with options such asred,dashed,thickormark=square*, or let the cycle list choose a style for you. - Scatter plots with pgfplotsAdd
only marksto an\addplotin a pgfplotsaxis, so the points are drawn without lines; choose the shape withmark=and read the points from coordinates or a table. - Bar charts with pgfplotsAdd
ybar(vertical bars) orxbar(horizontal bars) to a pgfplotsaxis, name the categories withsymbolic x coords, and give each series as an\addplotwith coordinates. - Error bars with pgfplotsAdd
error bars/.cd, y dir=both, y explicitto the\addplotoptions and write each error after its point as+- (0, error), or read the errors from a table column withy error=. - Logarithmic axes with pgfplotsReplace
axiswithsemilogyaxis(log y),semilogxaxis(log x) orloglogaxis(both), or setymode=logorxmode=logon a normalaxis. - Several plots in a grid with groupplotsLoad the
groupplotslibrary, open agroupplotenvironment withgroup style={group size=2 by 1}, and start each plot with\nextgroupplot. - Contours, heat maps and colour mapsUse
\addplot3in an axis withview={0}{90}:surformatrix plotfor a heat map,contour filledfor filled contours, and addcolorbarand acolormapfor the scale. - Plotting data from a CSV fileAdd the file to your project and write
\addplot table[x=col1, y=col2, col sep=comma] {file.csv};inside a pgfplotsaxis. - Drawings with TikZInside a
tikzpicture, write path commands such as\draw (0,0) -- (2,1);,\draw (1,1) circle (0.5);or\fill[blue] (0,0) rectangle (1,1);, each ending with a semicolon. - TikZ nodes, arrows and diagramsPlace each box with
\node[draw] (name) {text};, position the next ones with the positioning library (right=of name), and connect them with\draw[->] (a) -- (b);.