Scaling xyyy plot

Scaling xyyy plot

I have been able to master the plotting of XY, XYY, XnY plots using the threesin forum workthrough (see reply at http://software.intel.com/en-us/forums/showpost.php?p=34300

However, I do not understand how the transform, position, origin, and size methods and properties work on a specific graph area. The general discussion on transforms is a bit simplistic, I understand the graph window goes from -1,-1 to +1,+1 but that helps little. I have used various plots in AViewer and understand the approximate ideas of origin and size, ie, size things about 15% larger than your largest data so you have some margin to operate for axes, labels etc. I would like to see a better diagram of what the transform does.

I wish to scale my XnY plots so that the maximum Y series fits on the graph. Inheriting transform data from previous y-data doesn't help since you don't know which series is the biggest. I could examine all my data beforehand, decide which is largest and use that as my first series, but that will mess up other features of the plotting. I am sure there is a slick solution out there.

Thanks in advance.

8 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

From your description, it sounds like you have a plot (X vs Y1, X vs Y2, X vs Y3, etc.) like what you see in the Bessel.xml example. In that example the graph object ("Bessel Functions") has an origin (the lower left corner) at (-1.8, -0.5) and extends 15.8 units horizontally and 1.5 units vertically. E.g. the y-axis would run from -0.5 to 1.0. You can see this setting if you right click on the graph, select properties, and go to the "Transform" tab.

The graph has four XY Plots, "BesselJ(1)", "BesselJ(2)", etc. If you right click on one of these and look at the Transform properties, you'll see the "Inherit" check box is checked. This means that the XY Plot will get the transform area from the parent graph. This isconvenient when you'd like all the plots to be scaled the same way. So in general for this type of graph, you'd look at the min & max over all the Y series, use that to set the graph transform (with same extra space for margins), and select inherit for each plot. You can do this in the Viewer (a bit tedious), or through library calls.

Sometimes it's more useful to apply separate transforms for each plot. Say the series Y1 ran from 0.00 to 0.02, while the series Y2 ran from 0.0 to 1,000,000. In this case using the above approach would just get you a flat line for the Y1 plot. So it would be better to uncheck inherit for one of the plots and define it's on transform.

Let me know if that helped answer your question!

John

Thanks for the help! I looked at the bessel sample and was able to program the transform and postion for my plot elements. I have been able to do the X vs Y1,Y2,Y3 task. I am working on X1 vs Y1, X2 vs Y2, etc. and have got that programmedusing theObject Model as well. I did run into a "hard limit" of 100 XY plots in the AViz model. However, I could generate more than 200 data sets.

Some things that could be better explained in the helpconcern transform vs. position. I now understand that transform istruly a lineartransform of scale, and origin, as I suspected. Postion, however, is actually a viewing window definition (I recall all the old manuals for graphics from HP, Tektronix, AutoCad, etc.and it was spelled out a little moreclearly how the workspace was being modeled).

My final challenge is getting labels to behave since I have to plot stress (values like 2500.0) vs strain (values like 1.3e-4) and the transforms are many orders of magnitude different. Calculating a good font height is difficult. It would be nice if fonts were *not* tranformable so that they would always appear with a predictable size.

I will post the code from this project when I am finished(before next week)

Good! I'm glad my explanation helped. If Intel ever revises the AV documentation, they should look at some of the Tektronix manuals forinspiration. :)

I don't recall there was a fixed limit on the number of plots in a graph. Guess no oneanticipated more than a 100 plots.

The label object was badly designed. It should be a little smarter so that it would just do a "best fit" of the text, rather than require a bunch of properties to be set just to get anything to show up.

Looking forward to seeing your project!

John

Finally finished the code for a tabular XY data plot. Specifically this code reads from a text file built by another program. The file used for input is a .csv file that can be read by other software as well. My data is from an earthquake response program that looks at stress and strain at many (hundreds) of depths below the ground surface. The structure of the input file consistes of several lines of header material (character string data, either echoed or ignored, a value for the number of data columns to follow (usually somewhere between 20 and 1000) then the data columns. Column 1 is time, column 2 is stress at top-most location, column 3 is strain at top-most location, column 4 stress at location just below, column 5 strain etc..

The duration of the problem is typically 20-40 seconds which works out to about 50,000 "rows" of data. Aviz doesnt care about data sizes, and the user can increase dimensions of the main data array by changing parameter values. I have included a much-shorter data file for the user to play with.

The environment set-up is identical to the "Three-sine" sample, and this version runs from the command line. Note especially the generation of handles for axes and scaling work done. Scaling labels may have to be adjusted "by hand" in Aviz since one may need scientific notation or other, larger formats.

Enjoy! and send me any questions P.S. there was some difficulty uploading the data folder (about 6 MBytes)

Profray

Fichiers joints: 

Fichier attachéTaille
Télécharger TabularXYPlot.f9018.84 Ko
Télécharger tabulardata.csv8.79 Mo

This is very cool. Thanks for posting the fortran source and csv data; I'm sure there are other AV users who may be able to model their code in the same way.

As long as profligate data attachments don't seem to be a problem, could you post a .h5 file snapshot of your program? (I.e. once the viewer comes up, just do a save As mytabplot.h5) I don't have Visual Fortran, so I'm not able to build from the f90 source.

John

Here are two files. The first shows a plot of 3 stress-strain curves as they first appear after running the code and plotting reaches 5,6,7. They overlap, and I did not set the width right in the vertical and horizontal axes so the labels are not the correct size to handle the numbers. The second plot is after I widened the labels and changed colors on the plot. One reason I dont like changing plot colors is that I still publish in black and white. I have a workaround for adding markers by plotting the same data twice, once as a line, the second time setting the stride variable to, say 50 or 100, then plotting only markers. Of course this doubles the number of plots to do, but its not too bad.
P.S. that would be a nice feature upgrade, like Axum used to do where you could plot a marker every 10 or 20 or 200 data points so you dont have a huge glob of x's on your plot.

Fichiers joints: 

Fichier attachéTaille
Télécharger Mytabplot1.h537.52 Ko
Télécharger Mytabplot2.h537.53 Ko

Here are two files. The first shows a plot of 3 stress-strain curves as they first appear after running the code and plotting reaches 5,6,7. They overlap, and I did not set the width right in the vertical and horizontal axes so the labels are not the correct size to handle the numbers. The second plot is after I widened the labels and changed colors on the plot. One reason I dont like changing plot colors is that I still publish in black and white. I have a workaround for adding markers by plotting the same data twice, once as a line, the second time setting the stride variable to, say 50 or 100, then plotting only markers. Of course this doubles the number of plots to do, but its not too bad.
P.S. that would be a nice feature upgrade, like Axum used to do where you could plot a marker every 10 or 20 or 200 data points so you dont have a huge glob of x's on your plot.

Fichiers joints: 

Fichier attachéTaille
Télécharger Mytabplot1.h537.52 Ko
Télécharger Mytabplot2.h537.53 Ko

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui