Salome HOME
Add frequency info in mode mode.
[modules/paravis.git] / test / VisuPrs / 2D_viewer / A0.py
1 # Copyright (C) 2010-2013  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 # This case corresponds to: /visu/2D_viewer/A0 case
21
22 import paravistest
23
24 from pvsimple import CreateXYPlotView, Delete
25
26 # Create view
27 aXYPlot = CreateXYPlotView()
28 # Delete view
29 Delete(aXYPlot)
30 # Create view again
31 aXYPlot = CreateXYPlotView()
32
33 # Set title
34 print "Default chart title    ...", aXYPlot.ChartTitle
35 aXYPlot.ChartTitle = '   '
36 aXYPlot.ChartTitle = 'title of XY plot'
37 print "Chart title for xyplot ...", aXYPlot.ChartTitle
38
39 error = 0
40 try:
41     aXYPlot.ShowAxis = [1, 1, 0, 0]
42 except:
43     print "Error: ShowAxis property is not avaliable for XYPlotView"
44     error = error + 1
45
46 aXYPlot.AxisUseCustomRange = [1, 1, 0, 0]
47
48 # Show grids
49 aXYPlot.ShowAxisGrid = [1, 1, 0, 0]
50
51 aMinX = 0
52 aMaxX = 100
53 aMinY = 0
54 aMaxY = 10
55 aXYPlot.BottomAxisRange = [aMinX, aMaxX]
56 aXYPlot.LeftAxisRange = [aMinY, aMaxY]
57
58 # Set horizontal scaling for left and bottom axis
59 print "Default logarithmic scaling  ...", aXYPlot.AxisLogScale
60 # Set logarithmic scaling
61 aXYPlot.AxisLogScale = [1, 1, 0, 0]
62 print "Logarithmic scaling          ...", aXYPlot.AxisLogScale
63 # Set linear scaling
64 aXYPlot.AxisLogScale = [0, 0, 0, 0]
65 print "Linear scaling               ...", aXYPlot.AxisLogScale
66
67 # Axis titles
68 print "Default title of the left axis    ...", aXYPlot.AxisTitle[0]
69 aXYPlot.AxisTitle[0] = '    '
70 aXYPlot.AxisTitle[0] ="Xtitle of XY plot"
71 print "Title of the left axis            ...", aXYPlot.AxisTitle[0]
72 print "Default title of the bottom axis  ...", aXYPlot.AxisTitle[1]
73 aXYPlot.AxisTitle[1] = '    '
74 aXYPlot.AxisTitle[1] = "Ytitle of XY plot"
75 print "Title of the bottom axis          ...", aXYPlot.AxisTitle[1]
76
77 # Show/hide legend
78 aXYPlot.ShowLegend = 1
79 aXYPlot.ShowLegend = 0
80
81 if error > 0:
82     raise RuntimeError, "There is(are) some error(s) was(were) found... For more info see ERRORs above..."