1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
<html><h1>unicode</h1><img src="unicode.png"><p>
<a href="unicode.svgz">View this example in SVG</a><p>
<a href="gall.using.html">How to download and try this example</a><br>
<pre><b>Usage: pl -png unicode.htm -font Cyberbit
or
pl -svgz unicode.htm -font "Bitstream Cyberbit"
This example demonstrates rendering of Chinese characters.
The Chinese characters are UTF-8 encoded herein (I got the translations
from babelfish and don't know Chinese, so hopefully they are
not complete nonsense).
Requirements:
- Bitstream Cyberbit (freely downloadable) or some other unicode font
- To create PNG or JPEG, you need to build ploticus with FreeType2 support
- For SVG, your browser (or viewer app) needs access to the unicode font
See also <a href="../doc/fonts.html">the fonts man page</a>
<hr></b>
//index-headings: unicode font, xml_encoding, clustered bars, categories
// this is used only when producing SVG..
#proc settings
xml_encoding: utf-8
// specify the data.. field 1 is english, field 2 is utf-8 unicode, fields 3 - 5 are values
#proc getdata
data:
chicken 鸡 478 204 184
beef 牛肉 537 258 202
pork 猪肉 274 189 148
lamb 羊羔 147 176 108
// set up the plotting area
#proc areadef
// "Quantities shipped per region"
title: 数量运送了每区域
titledetails: align=C size=15
rectangle: 1 1 4 2.5
xcategories: datafield=2
yrange: 0 800
xaxis.stubs: usecategories
yaxis.stubs: inc 100
// "kilograms"
yaxis.label: 公斤
yaxis.labeldistance: 0.4
// do the red bars..
#proc bars
locfield: 2
lenfield: 3
barwidth: 0.1
cluster: 1 / 2
color: red
// "Northeast" (?)
legendlabel: 东北
// do the blue bars..
#proc bars
locfield: 2
lenfield: 4
barwidth: 0.1
cluster: 2 / 2
color: blue
// "West"
legendlabel: 西部
// render the legend using labels specified above..
#proc legend
location: max-0.2 max-0.2
// add a disclaimer :>
#proc annotate
location: min 0.5
textdetails: size=8 align=L
// "I am sorry if these Chinese translations do not make sense.. they were done by a computer!"
text:
我抱歉如果这些中国翻译没有道理。
他们由计算机做了!
|