Get Help

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Re: Normalizing x,y axis of a Contour Plot

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-23-2013
10:05 PM

05-23-2013
10:05 PM

Normalizing x,y axis of a Contour Plot

Hello Experts,

I have a request that hopefully is not difficult. I have a matrix One

When I plot One the x and y axis is defined by the indices of the Matrix One

I need the X and Y axis to be normalized from 0 to 1 and from -1 to 1

Can you help?

Thanks

Russ

10 REPLIES 10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-23-2013
11:27 PM

05-23-2013
11:27 PM

Re: Normalizing x,y axis of a Contour Plot

One additional comment.... I need the Matrix "One(x,y)" to be Normalized such that "One(m,n) such that m and n range from 0 to 1 and -1 to 1.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-23-2013
11:53 PM

05-23-2013
11:53 PM

Re: Normalizing x,y axis of a Contour Plot

if you want it to normalize, how do you want the point between [0,1] and [-1,1] looks like? is it a contiuous contour or you just want a discret point (1) in every corner and zero everywhere? Do you want it to change linearly? exponentially? or some other way? You need to be more specific.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-24-2013
12:54 AM

05-24-2013
12:54 AM

Re: Normalizing x,y axis of a Contour Plot

Hi Henry,

Thanks for helping...

Rather than having a Matrix whose x and y coordinates are defined by its indices, I need the Matrix to have x and y coordinates defined by the mapping from 0 to 1 and -1 to 1.

This is an exercise in the creation of a fractal. I need to have to spatial distribution to be mapped to -1 to 1 See the bottom of the attached.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-24-2013
05:08 AM

05-24-2013
05:08 AM

Re: Normalizing x,y axis of a Contour Plot

Would the two approches in the attached file help?

The first is to use with a 3D contour plot. As a mtrix can't have non integer indices I created a function f(Q,x,y) which uses the table as a lookup.

The second is for use in a normal 2D plot. A matrix is generated where the first colum represent the normalized x-, and the second the normalized y-values of all those elements in the original matrix with a value of 1.

Another approach would be to create a matrix which represents a bitmap, as was shown in this forum some times with different fractals. This approach would be extremely useful for colorful fractals like a mandelbrot, as you would have more control over color mapping, etc.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-24-2013
10:14 AM

05-24-2013
10:14 AM

Re: Normalizing x,y axis of a Contour Plot

The 3D plot is using the row and column indices because you haven't given it any x and y values. You need to create a matrix of x values and a matrix of y values. Put the x, y, and z values in a nested matrix, and drop that into the plot. see the attached.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-24-2013
11:44 AM

05-24-2013
11:44 AM

Re: Normalizing x,y axis of a Contour Plot

Thank you Richard. That's is what I did not know how to do. Sure appreciate your help. Thank you also to the other contributors.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-25-2013
08:01 PM

05-25-2013
08:01 PM

Re: Normalizing x,y axis of a Contour Plot

Richard,

I have a follow-on question. I need to reference points in the transformed space. I see that when I "flatten" the nested arrays that you created in "QQQ" the results is complicated. I need to be able to specify for example QQQ(x,y) such that a plot of QQQ(0,0) yields a point in the center of the fractal. Does this make sense?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-25-2013
11:40 PM

05-25-2013
11:40 PM

Re: Normalizing x,y axis of a Contour Plot

I have played with this a bit more. I was able to get a function that plot QP(x,y) but its a line not a point. Hmmm.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-26-2013
04:11 AM

05-26-2013
04:11 AM

Re: Normalizing x,y axis of a Contour Plot

Try the attached.

Plot2 is formatted as Scatterplot/DataPoints. That way you are able now to rotate, tilt, twist and zoom your plot using the mouse or the format menu, so be careful not to do so. Standard values are 0 for Rotate and 90 for Tilt and Twist.

PS: You may consider formatting Plot1 as scaterplot, too and play around with pointsize and colormap. See attached.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-26-2013
09:37 AM

05-26-2013
09:37 AM

Re: Normalizing x,y axis of a Contour Plot

It's not as complicated as it looks at first glance.The first matrix is the x coordinates, so all the columns are identical. The second matrix is the y coordinates, so all the rows are identical. If you look at either matrix on it's own as a surface, it's an inclinded plane. That's why you get all those stripes when you plot it as a contour plot.