Template:GraphAnn

From National Gallery Research Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This widget allows you to convert a simple uploaded list of comma separated values into a graph using the Widget:GraphAnn.

Template Example

Prepare your data in a simple text file as follows:

Xtitle, Ytitle
380, 21.340902
382, 33.233604
384, 21.972370
386, 24.424133
388, 24.515604
390, 25.614174
392, 22.461115
394, 27.229023
396, 24.665756
398, 26.529636
400, 26.045645
402, 28.149729
....

Prepare your annotations in a simple text file as follows:

  • [data series no, y-value, short text, long text, short text display width]


[
[1, 14.952, 'Sub', 'Methyl suberate', 50],
[1, 16.204, 'A', 'Methyl azalate', 50],
[1, 20.241, 'P', 'Methyl palmitate', 50],
[1, 22.157, 'S', 'Methyl stearate', 50],
....
]
  • Save your data text file with an appropriate name: mydata.txt
  • Save your annotation text file with an appropriate name: mydata_annotations.txt
  • Upload both files to the wiki using, Special:Upload
  • You can now add a simple graph of data included in your file to any page using the following:
 {{Template:GraphAnn|
  {{filepath:mydata.txt}}|
  graphName|
  width|
  height|
  title|
  xtitle|
  ytitle|
  {{filepath:mydata_annotations.txt}}}}

As an example the files File:M1382s4 rep GCMS 140211.txt and File:M1382s4 rep GCMS 140211 Annotations.txt have already been uploaded and the graph can be produced using:

 {{Template:GraphAnn|
  data={{filepath:M1382s4_rep_GCMS_140211.txt}}|
  div=graph1|
  wid=400px|
  hei=300px|
  title=Example Graph|
  xtitle=Wavenumber|
  ytitle=Intensity|
  ann={{filepath:M1382s4_rep_GCMS_140211_Annotations.txt}}
 }}


{{#widget:GraphAnn|data=https://research.ng-london.org.uk/wiki/images/wiki/0/0c/M1382s4_rep_GCMS_140211.txt%7Cdiv=graph1%7Cwid=800px%7C hei=500px| title=Example Graph| xtitle=Wavenumber| ytitle=Intensity| ann=https://research.ng-london.org.uk/wiki/images/wiki/6/6d/M1382s4_rep_GCMS_140211_Annotations.txt}}