~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/examples/python/xw07.py

  • Committer: Joachim Erfle
  • Date: 2013-07-24 13:53:41 UTC
  • Revision ID: joachim.erfle@desy.de-20130724135341-1qojpp701zsn009p
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: xw07.py 11680 2011-03-27 17:57:51Z airwin $
 
2
 
 
3
#  Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Alan W. Irwin
 
4
 
 
5
#  Font demo.
 
6
#
 
7
#  This file is part of PLplot.
 
8
#
 
9
#  PLplot is free software; you can redistribute it and/or modify
 
10
#  it under the terms of the GNU Library General Public License as published
 
11
#  by the Free Software Foundation; either version 2 of the License, or
 
12
#  (at your option) any later version.
 
13
#
 
14
#  PLplot is distributed in the hope that it will be useful,
 
15
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
#  GNU Library General Public License for more details.
 
18
#
 
19
#  You should have received a copy of the GNU Library General Public License
 
20
#  along with PLplot; if not, write to the Free Software
 
21
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
22
#
 
23
 
 
24
from plplot_py_demos import *
 
25
 
 
26
# main
 
27
#
 
28
# Displays the entire "plsym" symbol (font) set.
 
29
 
 
30
def main():
 
31
 
 
32
    base = [0, 100, 0, 100, 200, 500, 600, 700, 800, 900, 2000,
 
33
            2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900]
 
34
 
 
35
    plfontld( 0 )
 
36
 
 
37
    for l in range(20):
 
38
        if l == 2:
 
39
            plfontld( 1 )
 
40
 
 
41
        pladv(0)
 
42
 
 
43
        # Set up viewport and window
 
44
 
 
45
        plcol0(2)
 
46
        plvpor(0.15, 0.95, 0.1, 0.9)
 
47
        plwind(0.0, 1.0, 0.0, 1.0)
 
48
 
 
49
        # Draw the grid using plbox
 
50
 
 
51
        plbox("bcg", 0.1, 0, "bcg", 0.1, 0)
 
52
 
 
53
        # Write the digits below the frame
 
54
 
 
55
        plcol0(15)
 
56
        for i in range(10):
 
57
            plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, `i`)
 
58
 
 
59
        k = 0
 
60
        for i in range(10):
 
61
 
 
62
            # Write the digits to the left of the frame
 
63
 
 
64
            text = `base[l] + 10 * i`
 
65
            plmtex("lv", 1.0, (0.95 - 0.1 * i), 1.0, text)
 
66
 
 
67
            for j in range(10):
 
68
                x = [ 0.1 * j + 0.05 ]
 
69
                y = [ 0.95 - 0.1 * i ]
 
70
 
 
71
                # Display the symbols
 
72
 
 
73
                plsym(x, y, base[l] + k)
 
74
                k = k + 1
 
75
        if l < 2 :
 
76
            plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (compact)")
 
77
        else :
 
78
            plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (extended)")
 
79
 
 
80
    # Restore defaults
 
81
    #plcol0(1)
 
82
 
 
83
main()