spacer

News


Arrow plots possible in 3D
22-Jun-2005
Paul Cochrane

After some work on some other stuff I've finally managed to add more functionality to pyvisi! This time one can do ArrowPlots in three dimensions using vtk. The povray renderer module can also be used to generate ArrowPlots, but work is still needed to get it going nicely. It is also possible to use the vtk as well as the gnuplot renderer modules to do 2D ArrowPlots. The new class is called ArrowPlot3D, but may be changed to just ArrowPlot in future, and one can let pyvisi work out which one you want to use.

There have been many other changes made as well, with a little internal reorganisation of examples and a few other things, but this is the main change of interest at present.

An example code has been added to the examples/ directory on the cvs and will be in the next distribution of the package. It is called:

  • arrowPlot3D.py

Ball plots now available
19-Apr-2005
Paul Cochrane

It is now possible to create plots of spheres in space, i.e. BallPlots. This at present is only possible with a vtk xml data file.

An example code has been added to examples/ directory on the cvs and may be in the next distribution of the package. It is called:

  • ballPlotExample.py

Movies from sequences of images
07-Mar-2005
Paul Cochrane

I've changed the internal way that objects are handled so that one can now create sequences of images, and hence movies of functions which change over the course of a simulation. This, however, has made other parts of the interface slightly different, and one must now call setData() just before each render() or save() call, this I think isn't very good and so this syntax requirement will be removed in the future, when I get around to implementing the Renderer object properly. Until then though, one is able to make movies from the data!

Two new examples are in the examples/ directory on the cvs and will be in the next distribution of the package. They are:

  • simplePlotMovieExample.py
  • contourPlotMovieExample.py

ArrowPlots available in gnuplot
07-Mar-2005
Paul Cochrane

I've added a very basic implementation of 2D vector field plots for the gnuplot renderer module. Have a look at the new examples in the pyvisi cvs (soon to be in the distribution):

  • arrowPlotExample.py
  • arrowPlotExample2.py

More plotting types added for gnuplot renderer module
24-Feb-2005
Paul Cochrane

I've now been able to add many more kinds of plotting object to the gnuplot renderer module. Now one can plot 2D contour maps of 3D data (see item from yesterday), one can plot 3D surfaces, 3D surfaces with a 2D projection of the surface contours onto the base of the axes, and 2D and 3D scatter data (good to use when the input data isn't on a grid). Extra examples have been added, namely:

  • surfacePlotExample.py
  • surfaceAndContourPlotExample.py
  • scatterPlotExample.py
  • scatterPlot3DExample.py

Contour plotting works in gnuplot
23-Feb-2005
Paul Cochrane

Since objects can now render themselves, it was possible to implement the different rendering code necessary for contour plots to work in gnuplot. Have a look at the file contourPlotExample.py in the examples directory of the pyvisi cvs to see it in action. It is likely to take a while to get the vtk version going, but it will come in the fullness of time.

Objects render themselves
23-Feb-2005
Paul Cochrane

Objects now render themselves. Therefore, there is no longer a reason to call the render() method of a scene's sub-object directly; this is taken care of when the render() method of the scene is called. The example code has been changed in the cvs, and so look for the updated versions of the examples in the second release of the pre-alpha version of pyvisi.

First release of pre-alpha version of pyvisi
08-Feb-2005
Paul Cochrane

After much cleaning of the code with the help of pylint, and updating READMEs and stuff, I've released the first pre-alpha version of pyvisi. This is a very limited functionality version, but is something for people to see how things will look, and for me to get some kind of feedback from people to how they would like it to look and behave. There are three examples that work at present, these are simplePlotExample.py, singleArrayPlotExample.py, and multiPlotExample.py. These examples show the current functionality possible with pyvisi, and what the gnuplot and vtk equivalent code is.

Download: you can download pyvisi from the sourceforge.net web site by visiting pyvisi download files page

Scenes can now be saved to file
24-Jan-2005
Paul Cochrane

It is now possible to save the scenes that you have rendered! Previously, scenes were displayed to the screen and that was all, however now the Scene.save() method has been implemented in both the gnuplot and vtk renderer modules. The syntax of the save() method will change (in that the format argument will become an object), nevertheless, one is now actually able to save one's work.

The gnuplot renderer module can handle png and postscript output at present. With gnuplot 4.0 more output formats will be available.

The vtk renderer module can handle png, postscript, jpeg, bmp, pnm, and tiff formats.

Multiple curves on 2D plots are now possible
24-Jan-2005
Paul Cochrane

Pyvisi now supports plotting multiple datasets when graphing 2D curves. To plot more than one curve on a given LinePlot, one uses the syntax: plot.setData(x, y1, y2, y3, ...). The first element in the argument list is assumed to the x data to plot the subsequent arrays against, except in the case that there is only one array in the argument list, in which case the x data is autogenerated as the indices (starting from 1 (maybe this should be zero??)) of the argument data array.

To have a look at multiple curves in action, have a look at multiCurvePlotExample.py in the examples/ directory of the pyvisi distribution.

Simple 2D contour plotting not far away
24-Jan-2005
Paul Cochrane

Implementing simple contour plotting with just the gnuplot renderer module has shown a couple of major holes that need plugging. The main problem at present is that gnuplot requires a call to the splot command to plot contours and surfaces, but a call to the plot command to plot simple 2D graphs. Unfortunately, the call to plot the relevant graph is handled by the render() method within the Scene object, and consequently is just the plot command, which means that this is the wrong place for the object-specific rendering commands, and that the Scene.render() method should call the render() methods of the objects within the scene to do all of the rendering hard work. This may take a while to implement, but things will be more flexible in the future as a result.

One of the other major problems that will need to be seen to is the sharing of data objects with the module actually doing the rendering and the pyvisi code actually being run by the user. There are many elements to work on here. Essentially, we need to put the Renderer object into a separate python process or thread, and then open a pipe to the process and pass commands and objects through to it. This will sort of solve two problems simultaneously as we need a separate thread/process for the Renderer object anyway, and this may be the best way to share data objects around. At present, I have implemented a really dodgy way of passing the data around which isn't scalable, but it managed to get the simple 2D plotting to go. Again, this may take a while...

Simple 2D plotting works!
18-Jan-2005
Paul Cochrane

Simple 2D plotting works in both vtk *and* gnuplot!! This certainly felt like a major achievement, as it wasn't easy to get vtk to do 2D x-y plots. To get a feeling for what I've done check out plotExample.py in the examples directory of the pyvisi distribution.

Please note that this is very basic. At present one can only plot one set of data, and the way the data is transferred to the renderer module in the backend is very simplistic and not amenable to scaling to large datasets. Nevertheless, this example shows how pyvisi can be used in the future. It is also only possible to pass to the plotting routines two 1D arrays of data, one for the x-axis and one for the y-axis. Also, there isn't any implementation yet for changing colour on the axes, or the plot lines, however there is limited functionality available for choosing different kinds of linestyles. I'm also not completely happy with the syntax at the user-level of the interface, and this has to change. Specifically, the .add() method of the scene object to add an object to the scene. Surely this should be sorted out when one instantiates the object and passes the scene object as an argument. The other method that needs to disappear from user-space is the .render() method of the individual objects. Users should only have to render the scene. The problem here is to finish off some stuff that vtk needs before doing the final render (such as the AddActor() methods); this can be done a better way. One problem with the way I'm doing it at present is that re-rendering *doesn't* need the pre-render step. But re-rendering is a different kettle of fish, and there are many other things to work on before we get to there.

Note that to use the vtk renderer module, you must have vtk installed, and have configured vtk for python (so that the python vtk wrappers are available). To use the gnuplot renderer module, you must have gnuplot (version greater than or equal to 3.7) installed, and Gnuplot.py (the gnuplot python wrapper).

Even with all of these caveats, have a look at the example code, and tell me if you like the syntax (or not), if you have any comments or suggestions as to what I could do extra or what I could do differently, or even if you were able to get the plotExample.py example to go!


Valid XHTML 1.0! Valid CSS!

Last updated: Monday 27 August 2007
comments to: webmaster