There are few important operations you should know when working with the HPlot canvas frame:
To change the global title (which is set with the setGTitle() method), navigate the mouse to the location of the global title (the very top of the frame) , and click on the right mouse button. You will see a new pop-up menu. You can increase or decrease the divider location, make the divider invisible, change fonts and colors.
Exactly in the same way, you can edit the left, right and the bottom margins of the main frame. Just navigate to the boarder and use the mouse pop-up menu.
You can access all attributes of the margins using the method:
>>> c1.panel()
This method returns the GHPanel class (an extention of the swing JPanel) which keeps attributes of all 4 margins. Here are several operations you can do with the global margins:
# set size of the global margins (in pixels) >>> c1.setMarginSizeLeft(50) >>> c1.setMarginSizeRight(20) >>> c1.setMarginSizeBottom(50) >>> c1.setMarginSizeTop(50) # get the margin size >>> a=c1.getMarginSizeLeft() >>> a=c1.getMarginSizeRight() >>> a=c1.getMarginSizeBottom() >>> a=c1.getMarginSizeTop() # set text of the global margins >>> c1.setTextBottom("This is X") >>> c1.setTextLeft("This is Y") >>> c1.setTextTop("This is X") # the same as setGTitle() >>> c1.setTextBottom("This is Y") # set global margin background >>> c1.setMarginBackground(Color color) # returns JPanel of the global margins >>> c1.getMarginPanelLeft() >>> c1.getMarginPanelRight() >>> c1.getMarginPanelTop() >>> c1.getMarginPanelBottom()
Look at jHplot API for more details.
One can save HPlot figures in external files using the "File" menu. Of course, plots can be restored using the same menu. This works for most of the plotted objects, like HLabel, Primitives and graphics attributes.
This is about the file format: The output files have the extension "*.jhp" and contain an XML file which keeps all attributes of the HPlot canvas and the data files necessary to recreate the figures. You can look inside of this file just by unziping it using the Linux/Unix prompt:
>>> unzip <file>.jhp
This will create a directory <file> with <file>.xml and several data files. The general form of the names of the data files are: "plotXY-dataZ.d", where X, Y are positions of the plot in HPlot canvas and Z indicates the dataset number.
It should be noted that all data files are just the outputs from the P1D object (see Sect. :autorefsection13). Therefore, you can easily read such files using methods of the P1D class. This is useful in case if the automatic procedure from the "File" menu fails, and the user want just re-plot the data using different macros.
All graphs on the same HPlot canvas can be removed by using a several methods. If you want to clean a graph from a loaded object (histogram, function etc.), use the method ``cleanData()''. An example in the file ``macros/example/histo_stream.py'' shows how to update a plot with new data every 0.5 sec.. Note: in this case only a current plot will be updated, i.e. a plot given by the ``cd'' method. If you want to remove all objects from all plots on the same HPlot canvas, use ``cleanAllData()''.
It is also useful in many cases to remove all user settings for a specific graph, as well as to remove input objects. In this case use the ``clean()'' method. This will clean the current graph from the data and from user settings. The method ``cleanAll()'' will clean all the graphs on the same canvas.