Krzysztof Antoniak
Krzysztof Antoniak

Reputation: 451

Make X and Y axis use same scale

I'm creating in Excel 2007 2D chart to illustrate throwing an object in gravity on different planets. Everything works fine, but I would like to have axis with the same scale, because now chart doesn't match reality.

Values on axis are taken from the data in the sheet. Any ideas how to do it?

Upvotes: 1

Views: 35202

Answers (3)

elechris
elechris

Reputation: 420

  1. manually resize the dimensions of the axis, this will create "c:manualLayout" inside the chart xml file, it doesn't matter how you will resize it, but it helps to get it close to what you want.
  2. save and close .xlsx file
  3. unzip .xlsx file
  4. go inside folder where all the files were unzipped to
  5. open \xl\charts\chart1.xml (if you have more sheets and charts this may be a different one for you)
  6. Search for something like:

<c:manualLayout><c:layoutTarget val="inner"/><c:yMode val="edge"/><c:x val="0.12319887275998495"/><c:y val="0.13061713318514773"/><c:w val="0.69965527777777792"/><c:h val="0.70712960251649337"/></c:manualLayout>

  1. edit x,y,w and h (if values are close you just have to round them, in my case I set them to 12,12,0.7 and 0,7)
  2. save and close
  3. go inside folder where all the files were unzipped to, select all files and zip this to a new file (you might want a different file name as the original)
  4. rename the extension of this file from .zip to .xlsx

You can now open the new .xlsx file in excel. You can verify if it is square by taking a screenshot of part of the grid and checking it in paint (copy, set selection to transparent, rotate, check if it fits over itself). In my case it was slightly off but this could have been due to rendering limitations since I also noticed some aliasing.

Tested in Microsoft® Excel® for Microsoft 365 MSO (version 2311 Build 16.0.17029.20108) 32 bits

Upvotes: 1

Randy
Randy

Reputation: 1146

Right click on the vertical axis numbers, (like the 8) and click "Format Axis". Under "Axis Options", change maximum from "Auto" to "Fixed", and input 25.

I did this using Excel 2010, but I believe the process is the same (or similar) in 2007.

Upvotes: 1

J&#252;ri Ruut
J&#252;ri Ruut

Reputation: 2530

It's possible to drag the plot either from the edge of the gray area or from the edge of the plot. If you drag the grey area to the right, the 25 meter distance mark also moves to the right. Or if you want to compress the scale with height: drag the plot down from the upper edge. As the other axis remains the same, the scale should be 1:1 in a certain moment. I'd even use a ruler to make sure :-)

If one wants to get more space above or beside the plot: right-click on y- or x-axis (may be quite tricky to get it right), Format Axis, tab Scale, set Maximum as desired and repeat dragging.

Upvotes: 0

Related Questions