Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Square graph in excel?

Status
Not open for further replies.

Tomfh

Structural
Feb 27, 2005
3,572
Hi,

Is there any way to force excel to draw the X and Y axes at the same scale?
 
Replies continue below

Recommended for you

thread770-141275

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Open a macro
Insert the following:
Selection.Width = 450
Selection.Height = 450

Select the chart
run the macro

TTFN



 
I assumed the original poster wanted a 1:1 aspect ratio. Can you clarify. I don't think IRStuff's code will accomplish this.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
The default plot area is not square on the display. The code basically stretches the plot area to be square on the display. The actual values to be used will depend on your display resolution.

TTFN



 
But a square plot is not the same as a 1:1 aspect ratio between X and Y plot units.

For example if I plot y=x it would be 45 degree from horizontal with 1:1 aspect ratio.

But if X axis is 0-10 and Y axis is 0-100, then a plot of Y=X will be about 10 degrees from horizontal.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Right-click on the axes, select "format axis" and set the scales to the same value.

------------------------------------------
"...students of traffic are beginning to realize the false economy of mechanically controlled traffic, and hand work by trained officers will again prevail."

Wm. Phelps Eno, ca. 1928
 
It looks like you'd need to use IRstuff's macro as well for that to work. Any other ideas?

------------------------------------------
"...students of traffic are beginning to realize the false economy of mechanically controlled traffic, and hand work by trained officers will again prevail."

Wm. Phelps Eno, ca. 1928
 
thread770-141275

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Manually you can quite obviously control whatever you want by manually resizing the chart area with the mouse and adjusting the graph axes. One problem – every time you change the data beyond the bounds you will again have to manually adjust the graph axis.

There was a vba solution I posted in the linked thread 3 Dec 05 which met my needs very well (one execuation of the macro auto-scales and sets 1:1). It was based on another posters information prior to that in the thread. Subsequent modification was made but I don’t know what it did.

Also at the end of the thread, Yakpol had a suggestion for creating a phantom series that when autoscaled would accomplish the same thing. I never tried it.


=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor