Skip to main content
1-Visitor
August 25, 2011
Question

How can I Adjust graph grid paramaters using a calculation.

  • August 25, 2011
  • 11 replies
  • 4864 views

I created several calculation sheet where I have to constantly adjust the graph grid settings to make the document presentable. I would like to calculate those settings automatically. Is this possible?

11 replies

12-Amethyst
August 25, 2011

Sevastien,

The limits on a graph do not have to be numbers, they can be set using variables, or equations. So can the markers.

Sometimes I will create a vector of the values of a function using range variables and then use the max and min functions to get the limits (plus a little). This can be written as a program and then the function just placed in the limit placeholders on the graph.

Sometimes I will actually plot the vector of values rather than let Mathcad select the number of points, then I can increase accuracy or decrease to save time, depending on what I need.

The grid lines cannot be programmed. You can draw your own gridlines, but its a little more work.

If you want to do more than this, perhaps you could post an example of your calculations.

Wayne

1-Visitor
August 25, 2011

Good suggestion, I could draw the line myself. But then that will show in the legend... not very clean in the end product I hope there is a better way.

12-Amethyst
August 25, 2011

I thought I posted this, but I guess not.

Attached is a file from Richard Jackson, from a discussion about plotting a grid or a structure on a graph.

This will result in only one trace in the Legend. That will give you a place to note the increment, so it might work to your advantage.

23-Emerald I
August 25, 2011

Sebastien Billaut wrote:

I created several calculation sheet where I have to constantly adjust the graph grid settings to make the document presentable. I would like to calculate those settings automatically. Is this possible?

Up to a point.

The attached graph will rescale the ordinate and abcissa when the plot values change. You can also program and recalculate the markers. Grid spacings is a "bridge too far!"

1-Visitor
August 25, 2011

Thanks for your answer, but yes I am talking about the number of grid lines. I am already using variables to adjust everything else markers and boundaries....

I was wondering if this graph setting could be access through programming.

1-Visitor
August 26, 2011

Thanks for your answer, but yes I am talking about the number of grid lines. I am already using variables to adjust everything else markers and boundaries....

I was wondering if this graph setting could be access through programming.

It can't be done with programming. To be honest I believe it would take too much effort to get it working and don't know if it can actually be done.

Mike

24-Ruby IV
August 26, 2011

Hello!

See also the topic "Plotting a Grid or a Structure on a Graph": http://communities.ptc.com/message/164979