<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAffineTransform/scaleX(by:yBy:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAffineTransform(im)scaleXBy:yBy:"
  },
  "title" : "scaleX(by:yBy:)"
}
-->

# scaleX(by:yBy:)

Applies scaling factors to each axis of the receiver’s transformation matrix.

```
func scaleX(by scaleX: Double, yBy scaleY: Double)
```

## Parameters

`scaleX`

The scaling factor to apply to the x axis.

`scaleY`

The scaling factor to apply to the y axis.

## Discussion

After invoking this method, applying the receiver’s matrix modifies the unit length on the x axis by a factor of `scaleX` and the y axis by a factor of `scaleY`, in addition to performing all previous transformations. A value of 1.0 for either axis scales the content on that axis to the same size.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)