Back to index

salome-paravis  6.5.0
A0.py
Go to the documentation of this file.
00001 # Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 #
00003 # This library is free software; you can redistribute it and/or
00004 # modify it under the terms of the GNU Lesser General Public
00005 # License as published by the Free Software Foundation; either
00006 # version 2.1 of the License.
00007 #
00008 # This library is distributed in the hope that it will be useful,
00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 # Lesser General Public License for more details.
00012 #
00013 # You should have received a copy of the GNU Lesser General Public
00014 # License along with this library; if not, write to the Free Software
00015 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 #
00017 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 #
00019 
00020 # This case corresponds to: /visu/2D_viewer/A0 case
00021 
00022 import paravistest
00023 
00024 from pvsimple import CreateXYPlotView, Delete
00025 
00026 # Create view
00027 aXYPlot = CreateXYPlotView()
00028 # Delete view
00029 Delete(aXYPlot)
00030 # Create view again
00031 aXYPlot = CreateXYPlotView()
00032 
00033 # Set title
00034 print "Default chart title    ...", aXYPlot.ChartTitle
00035 aXYPlot.ChartTitle = '   '
00036 aXYPlot.ChartTitle = 'title of XY plot'
00037 print "Chart title for xyplot ...", aXYPlot.ChartTitle
00038 
00039 # Show left and bottom axis
00040 aXYPlot.ShowAxis = [1, 1, 0, 0]
00041 
00042 # Show grids
00043 aXYPlot.ShowAxisGrid = [1, 1, 0, 0]
00044 
00045 # Set axis range for left and bottom axis
00046 aXYPlot.AxisBehavior = [1, 1, 0, 0]
00047 
00048 aMinX = 0
00049 aMaxX = 100
00050 aMinY = 0
00051 aMaxY = 10
00052 aXYPlot.AxisRange = [aMinX, aMaxX, aMinY, aMaxY, 0.0, 1.0, 0.0, 1.0]
00053 
00054 # Set horizontal scaling for left and bottom axis
00055 print "Default logarithmic scaling  ...", aXYPlot.AxisLogScale
00056 # Set logarithmic scaling
00057 aXYPlot.AxisLogScale = [1, 1, 0, 0]
00058 print "Logarithmic scaling          ...", aXYPlot.AxisLogScale
00059 # Set linear scaling
00060 aXYPlot.AxisLogScale = [0, 0, 0, 0]
00061 print "Linear scaling               ...", aXYPlot.AxisLogScale
00062 
00063 # Axis titles
00064 print "Default title of the left axis    ...", aXYPlot.AxisTitle[0]
00065 aXYPlot.AxisTitle[0] = '    '
00066 aXYPlot.AxisTitle[0] ="Xtitle of XY plot"
00067 print "Title of the left axis            ...", aXYPlot.AxisTitle[0]
00068 print "Default title of the bottom axis  ...", aXYPlot.AxisTitle[1]
00069 aXYPlot.AxisTitle[1] = '    '
00070 aXYPlot.AxisTitle[1] = "Ytitle of XY plot"
00071 print "Title of the bottom axis          ...", aXYPlot.AxisTitle[1]
00072 
00073 # Show/hide legend
00074 aXYPlot.ShowLegend = 1
00075 aXYPlot.ShowLegend = 0