1 # Copyright (C) 2010-2016 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # This case corresponds to: /visu/2D_viewer/A0 case
22 from paravistest import *
23 from presentations import *
24 from pvsimple import *
27 aXYPlot = CreateXYPlotView()
31 print("Default chart title ...", aXYPlot.ChartTitle)
32 aXYPlot.ChartTitle = 'title of XY plot'
33 print("New chart title ...", aXYPlot.ChartTitle)
35 # Apply custom axes range
36 aXYPlot.LeftAxisUseCustomRange = 1
37 aXYPlot.BottomAxisUseCustomRange = 1
40 aXYPlot.ShowLeftAxisGrid = 1
41 aXYPlot.ShowBottomAxisGrid = 1
47 aXYPlot.LeftAxisRangeMinimum = aMinY
48 aXYPlot.LeftAxisRangeMaximum = aMaxY
49 aXYPlot.BottomAxisRangeMinimum = aMinX
50 aXYPlot.BottomAxisRangeMaximum = aMaxX
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 ))
59 aXYPlot.LeftAxisLogScale = 0
60 aXYPlot.BottomAxisLogScale = 0
61 print("Set linear scaling ... left = %s, bottom = %s" % ( aXYPlot.LeftAxisLogScale, aXYPlot.BottomAxisLogScale ))
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)
72 aXYPlot.ShowLegend = 1
73 aXYPlot.ShowLegend = 0