cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Noob plotting

gshockxcc
7-Bedrock

Noob plotting

I'm very new to Mathcad, but getting the hang of it.  I admit, plotting eludes me.  I'm trying to plot one column of data against another in an X-Y plot.  I just came across this post that explains you can't do this.

https://community.ptc.com/t5/Mathcad/Needs-help-with-Plotting/m-p/273538#M106881

 

If I understand correctly, I can't plot a vector over a range.  Good.  I don't want to.  I already have two vectors (at least I think so), but when I try to plot them, I only get the first and last data point.

 

Seems like the Chart function works well.  I have really tried to use the PTC Help, and I have found it really lacking for the beginner.  Any suggestions on other resources?

 

Many of my datasets and use cases are simply a range of X and Y data.  I may have multiples of each, x1 vs y1, x2 vs y2, etc, all plotted on the same X-Y plot.  My goal is to plot several curves, each with their own X-Y pairs.  

 

Do I need to reformat the vector to make it easier to plot?

 

Thanks in advance.

 

 

ACCEPTED SOLUTION

Accepted Solutions

Hi,

Prime calculates from left to right and from top to bottom.

This means the top of a graph should be lower than the definitions of what plot is plotting.

All you need do is move things around a little so items are defined to the left or above the items use.

 

You will need to reestablish link with Excel Data

Cheers

Terry

View solution in original post

3 REPLIES 3

Hi,

Prime calculates from left to right and from top to bottom.

This means the top of a graph should be lower than the definitions of what plot is plotting.

All you need do is move things around a little so items are defined to the left or above the items use.

 

You will need to reestablish link with Excel Data

Cheers

Terry

Werner_E
25-Diamond I
(To:gshockxcc)

Prime reads and evaluates top down and left to right. You defined the range i to the right and below the plots upper left corner and so i is unknown to the plot. Actually I am surprised that Prime isn't throwing an error (it should) but rather displays two points.

Just move the range definition for i above the plot region (the parentheses are not needed) and the plot should work as expected.
Note that you can edit the first, second and last scale value on each axis and actually you should do so as Prime is very bad in choosing reasonable scale values automatically. Using the range i:=1..10 you just plot 10 points of your vectors, starting from the second(!) one. Not sure if you really intended to do so. By default Prime numbers elements of vectors and matrices starting with 0 (unless you change that via the menu or by changing the variable ORIGIN).

Werner_E_0-1672809869291.png

 

To plot the whole vector y over x you don't need any range to index the vectors. Simply put the vector names in the plot placeholders:

Werner_E_1-1672809927071.png

Of course you may also show both traces in the same plot

Werner_E_2-1672810067155.png

 

 

 

Excellent.  Thanks.  This is what I'm looking to do.  Much appreciated.

Announcements

Top Tags