Vector Plot and Contour Chart

monirg

Well-known Member
Joined
Jan 11, 2005
Messages
629
Does anyone know how to construct a 2D Vector Plot and / or a 2D Contour Chart, in Excel ??
These 2 chart types used to be available in almost all plotting software!! Why not in Excel ?
In a 2D VECTOR Plot: You have the data tabulated as:
(X,Y,V,theta), where V is the value at point (X,Y) and at theta degrees from the X-axis.
In a 2D CONTOUR Chart: You have the data tabulated as:
(X,Y,V), where V is the value at (X,Y). By specifying the desired highest and lowest values of V to be plotted, and the number of desired contour levels to appear, you would get a group of contour curves each at a constant value of V.

:rolleyes: Thanks.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Monir,

What you are describing as a "2D vector plot". Wouldn't that simply be an XY scatter plot with connecting line(s)? Where X1 and Y1 are your starting point and X2 = X1 + V*Cos(Theta) and Y2 = Y2 + V*Sin(Theta)?
I think the tricky part of that problem would be getting the graph to look good (X & Y are truly a grid). Jon Peltier has a page that explains how to make a graph into a square grid.
As for surface charts -- my experience is very limited. Again, I would refer you to Jon P. This time an artical he wrote for TechTrax.

HTH
 
Upvote 0
Quote taken from PM; used with Monir's permission.
monirg said:
Thank you for your prompt response.

1. Excel Vector Plot: It is a special "type" of 2D Charts. Each data point is given as (X,Y,V,theta). V and theta represent the magnitude and direction of a vector to be drawn at point (X,Y).
For example, a data point would be given as (1.5, 2.2, 0.54, 85.32). You plot the point (1.5, 2.2) in the normal XY-Scater chart. Then, you draw a vector of length 0.54 (or suject to a scale factor of your choice) and rotate it 85.32 degrees anticlockwise from the positive X-axis. Repeat the process for all the given 4-value data points, and you would get a really impressive Vector Plot !
Is it still your advice to consult with Jon Peltier?

Monir,

You would need to chart each vector as a new series. Let's take the following data as an example. We have three vectors to plot. We need to calculate the 2nd set of XY coordinates based on v and theta. We put X2Y2 below X1Y1 and use that to create a new XY scatter w/ line chart.
charts - vector graphs.xls
ABCDE
1xyVq
2Vector11.500002.200000.5485.32
31.544062.73820
4Vector22.500001.000001230
51.857210.23396
6Vector32.000002.000002340
73.879391.31596
Sheet1

After we have our chart created we can add vector 2 by selecting B4:C5 and copying to the clipboard. Then click on the graph and from the menu Edit | Paste Special... and tell Excel to paste as a new series.

For something like a vector plot you may want to take the formatting a step further than the default and click on the vector line, then click on the end data point and then click again on the end data point. Then right-click the end data point. Your popup menu should say Format Data Point... (note the singular "Point" not "Points"). Then change the marker to something like a circle size 7 or 8. Then click on the other marker for that line (series) and change its shape to something like a 7 or 8-pt-sized triangle or something to distinguish the end point from the start point.

I was not recommending that you contact Jon directly, but rather follow the link I gave to one of his web pages. The subject of the page is not vector plotting (though it would not surprise me if Jon were to have a page on the subject), but rather the subject of that particular page is how to make the graph's grid "square". Especially if you want your x-axis & y-axis to have the same scale, Jon's page is a great help. If you give it your best effort to incorporate the utility he shares on his web page and you cannot get it to work then post back here, or if you deem it best, you might PM Jon (he is a member of Mr. Excel).

HTH
 
Upvote 0
Greg;

Thank you for your thorough and impressive reply! (re.: 2D Vector Plot).
There are, however, a number of issues / problems:

1. First, I agree with you that the X-axis and Y-axis of the 2D Chart would have to be the same in order to have, for exanple, a wing planform or a circular cylinder plotted realistically on the same 2D Vector chart.

2. You are suggesting that each vector has to be treated as a new series. So, if I have, say, 200 data points (vectors), can Excel (2003) handle that many series in one chart?

3. Most impotantly, the size of each vector has nothing to do with the scale you choose for the X-axis & Y-axis. Let me explain.

3.a Using the same notations (X, Y, V, theta) to describe a given data point, suppose a single data point is tabulated as (1.50, 2.20, 328.40, 119.81).
3.b The XY-Scatter Chart would have, say, value X-axis 0.0 to 2.0, and value Y-axis 0.0 to 2.5. Plot the point (1.50, 2.20).
3.c For demonstration purposes, draw an Arrow (from the Drawing Tool), and place it anywhere (for now) in the chart plot area.
3.d Here is what you need to do (by a macro ??) to have the Arrow represents the vector at that point:
----- the starting point of the Arrow (i.e.; vector) must coincide with this vector reference data point X=1.50 & Y=2.20
----- choose a reasonable scaling factor for the Arrow, say, 400.0
----- select the Arrow -> Format AutoShape -> Size
----- you want the "Height" of the Arrow to be =328.40/400= 0.821,
----- and its "Rotation" to be 119.81 degrees anticlockwise from + ve X-axis
3.e Repeat for all the given N 4-value data points

I've visited Jon's web site, and he has provided few links to try.

Thanks. :rolleyes:
 
Upvote 0
Here's how you create a vector. Creating multiple vectors is best done with code since the process is not trivial. It's fairly simple. Just not trivial.

Create the scatter chart with the desired (X,Y) coordinates.

On the worksheet, from the Drawing toolbar, create a horizontal arrow pointing to the right. Create a straight line of exactly the same length. Position this line so that it 'extends' the arrow (i.e., the tips of the two touch). Format the line the same color as the chart background (default is white). Group the arrow and the line as a single object.

Record the next 6 steps with the macro recorder. They are building blocks in the automation process. Create a copy of the grouped object. Size and rotate it as desired. Copy the object. Select the chart series. Pause and select the specific point of interest. Paste.

Turn off the recorder.

Do the same for each of the points. If the number of points is few, the automation code above can be discarded. Just do all the vectors by hand. Alternatively, generalize the code generated by XL so that you can customize the size and rotation based on the vector length and direction.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top