Salome HOME
Merge branch 'V7_dev'
[modules/paravis.git] / test / VisuPrs / 2D_viewer / A0.py
1 # Copyright (C) 2010-2016  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, or (at your option) any later version.
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 from paravistest import *
23 from presentations import *
24 from pvsimple import *
25
26 # Create view
27 aXYPlot = CreateXYPlotView()
28 Render(aXYPlot)
29
30 # Set title
31 print "Default chart title  ...", aXYPlot.ChartTitle
32 aXYPlot.ChartTitle = 'title of XY plot'
33 print "New chart title      ...", aXYPlot.ChartTitle
34
35 # Apply custom axes range
36 aXYPlot.LeftAxisUseCustomRange = 1
37 aXYPlot.BottomAxisUseCustomRange = 1
38
39 # Show grids
40 aXYPlot.ShowLeftAxisGrid = 1
41 aXYPlot.ShowBottomAxisGrid = 1
42
43 aMinX = 0
44 aMaxX = 100
45 aMinY = 0
46 aMaxY = 10
47 aXYPlot.LeftAxisRangeMinimum = aMinY
48 aXYPlot.LeftAxisRangeMaximum = aMaxY
49 aXYPlot.BottomAxisRangeMinimum = aMinX
50 aXYPlot.BottomAxisRangeMaximum = aMaxX
51
52 # Set horizontal scaling for left and bottom axis
53 print "Default logarithmic scaling ... left = %s, bottom = %s" % ( aXYPlot.LeftAxisLogScale, aXYPlot.BottomAxisLogScale )
54 # Set logarithmic scaling
55 aXYPlot.LeftAxisLogScale = 1
56 aXYPlot.BottomAxisLogScale = 1
57 print "Set logarithmic scaling     ... left = %s, bottom = %s" % ( aXYPlot.LeftAxisLogScale, aXYPlot.BottomAxisLogScale )
58 # Set linear scaling
59 aXYPlot.LeftAxisLogScale = 0
60 aXYPlot.BottomAxisLogScale = 0
61 print "Set linear scaling          ... left = %s, bottom = %s" % ( aXYPlot.LeftAxisLogScale, aXYPlot.BottomAxisLogScale )
62
63 # Axis titles
64 print "Default title of the left axis    ...", aXYPlot.LeftAxisTitle
65 aXYPlot.LeftAxisTitle = "Ytitle of XY plot"
66 print "New title of the left axis        ...", aXYPlot.LeftAxisTitle
67 print "Default title of the bottom axis  ...", aXYPlot.BottomAxisTitle
68 aXYPlot.BottomAxisTitle = "Xtitle of XY plot"
69 print "New title of the bottom axis      ...", aXYPlot.BottomAxisTitle
70
71 # Show/hide legend
72 aXYPlot.ShowLegend = 1
73 aXYPlot.ShowLegend = 0