single point not plotted

single point not plotted

If there is only 1 point then it is not plotted. I guess this is because the default is to drawa line between two points, and you can't if there is only 1 point. But if we are only plotting points then we should be able to plot just one.

See attached project for a demonstration.

13 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

I am a user of AV, not a product support person from Intel.

Typicaly you would have a list of points to plot. So the hack I would use would be to draw a line plot with a transparent line. Then set the plot marker properties to display markers of the type you want on the line at the plot points. Generallyyou can think of a list of points as having a head-end and a tail-end. When one point is present it is present as both the head and the tail of the plot list. So the fact that a one point plot requires a description of a head point and a tail point (at the same location) should not be of much concern.

Jim Dempsey

Thanks for the tip Jim. Everyone is certainly welcome to toss in any ideas they might have.

The xyplot code expects to see at least two data points. If there is just one point supplied, the routine returns without drawing anything. I suppose I could change to code to draw a single point, but I don't know if this is a bigissue in practical use or not. Phil, is this a problem for your app, or were you just curious why one point didn't display anything?

If you want to display 1-n points, another approach would be to use the AvPolyList plot with PolyType set to AV_POINT_LIST.

There are 2places where I have come accross this as an issue...

1. I have several XY plots in on a form. I wanted to put a single big dot on each plot that represented a common pointto make it easytosee how the plots are orientated with each other. I got around this by making the 1 point data series actually have two points, but both the same. This was not such an issue.

2. I have combo boxes that filters the data to display only points that fulfill certain criteria. It does this by recreating the arrays and then replotting the graph. If only 1 record fulfills the criteria then it won't be displayed. This is more of an issue.

I would say that for completeness it would be nice if a few extra lines of code can be added to deal with thescenario of only 1 point.

On a related note, is there a way of setting the visibility ofpoints, based on an array flag.

eg if I have an x-y plot of height v weight, and the user wants to dynamically look at specific age ranges, can I set a binary array value that determines if each point should be seen and pass this in to the plot as a visibility value for each point?

Yes, you can use an additional array that can serve as a visibility test.

Take a look at the attached project. I use a second dataset that contains the just the values 0 and 1. These are mapped to two colors via a palette. In the example I have one palette color as green and the other as semi-transparent green, but you could have the second color be 0, in which case those points wouldn't be displayed at all.

Thanks - thats just what I wanted.

I can't underestimate how valuble these little code snippet examples are. As a previous poster mentioned, I was also on the verge of giving up when just faced with the documentation.

For any readers who don't use VB, you can open up the .frm files in notepad to read the underlying code - and it should be readily obvious which objects and methods are being used. I've also started adding the exe in the zip file so anyone without vb can see what the example is trying to demonstrate.

Phil

I agree code samples are very important. With enough samples, very often you'll find something that is close to what you need and then it's just a matter of modifying it a bit.

The file: Array Visualizer/samples/samples.htm provides a brief description of all the samples on the kit.I thinkAV object model users willfind that theVBScript/JavaScript samples are useful even if that is not their target language. JavaScript is very close syntactically to C++ or Java, and VBScript to VB.The script samples do not needand developer tools to be installed, just type "cscript" and the script file name on the command prompt to run. And you can edit the files using notepad or any other editor.

One other additional source of sample code are the data files that include page objects. For example if you open Array Visualizer/samples/data/HDF5/astrojet.h5, you can right-click on the "astrojet" page object in the tree pane, select "Edit" and see/modify the code for that page.

jl,

You mention the astrojet.h5 is a page object. Very interesting. Maybe you can comment on what I would like to use this for and perhaps you have a suggestion on how to do it.

In the standard front end for Array Viewer you can click on the view paneofa 3D graph and rotate it. And you can zoom the display window (shift-Mouse move, or twurl wheel on mouse). An additional function that would be nice to have controlled by the mouseis Pan. It would seem like the page object could impliment Pan (assuming mouse pan isn't cleverly hidden in the documentation).

I've kludged in pan with a dialog box that is run in a seperate thread launched by the application. It works in a jerky manner. If implimented as part of AV then pan should be no more jerky than rotate. Rotate is usualy smooth intil you get a large number of plots or things with surfaces on them (quadmesh).

Jim Dempsey

Actually the file "astrojet.h5" contains a page object named "astrojet". Open the file in the Viewer and click on the icon named "astrojet" to see it.

A page object is just a text string consisting of HTML that gets saved with the file. What's interesting about it is that page object can contain AV ActiveX controls and script code that can interact with the AV object model.

For example in astrojet, when you drag on the sliders a script function gets called that updates the Section properties of the dataset "dset", and moves the position of one of the image plots. Result is that you get a "slicer/dicer" applet that is actually emeded in the data file. Too see the HTML code, just right click on "astrojet" and select "Edit" form the context menu.

Another example is adriatic.h5 which contains some time series pages.

Functionality like use the mouse to rotate the graph is built into the AvGraph control and does require any script code to drive it. I don't have Pan working yet, but that is on my to-do list.

BTW, I've made some recent changes to the QuadMesh rendering code to support multi-pass rendering for large datasets. Basically what you'll see is a fast inital update without full detail, and then a slower background update which will display all the data values of the QuadMesh. It should be in the next IVF udpate.

How can I access the avGraphControl.

At one time, long, long ago... I had problems with AV crashing. So I forced it to crashwhile I had the debugger running and when I chose to debug the application the avGraphControl code appeared in the debugger. Since then I forgot how to crash AV to get at the code. Doesn't matter much unless I can also edit and save the updates. I saw the mouse rotate code in there.

With dual core processors becoming available will the AV (viewer) be written to take advantage of multiple threads?

AV currently uses multiple threads for background tasks. For example if you open the file craterlake.h5 in the Viewer and rotate the 3d graph, you'll notice that the first update is a sub-sampled view of the data. You'll then see "Working..." in the status bar while a background thread is computing a full res view.

In the future we are hoping modify the AV library tomake more effective use of multiple CPUs. Some components (AvFilter) are fairly easy to parallelize, and others are harder (e.g. the rendering components).

I've updated the XYPlot code to draw one-point datasets. This fix should be in the next update.

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!