# Error with use WSC on fig.add\_subplot(111,projection=Pj)

**URL:** <https://community.openastronomy.org/t/error-with-use-wsc-on-fig-add-subplot-111-projection-pj/741>\
**Category:** Development\
**Tags:** astropy\
**Created:** [September 8, 2023, 8:09pm UTC](https://community.openastronomy.org/t/error-with-use-wsc-on-fig-add-subplot-111-projection-pj/741 "2023-09-08T20:09:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergio](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sergio](https://community.openastronomy.org/u/Sergio)\
**Post date:** [September 8, 2023, 8:09pm UTC](https://community.openastronomy.org/t/error-with-use-wsc-on-fig-add-subplot-111-projection-pj/741/1 "2023-09-08T20:09:17Z")

</div>

My code was working fine until a few days ago when I updated Astropy.

My code works correctly until this part:  
pvdiagram = fits.open(‘my\_PVslice11.fits’)

Pj = WCS(pvdiagram[0].header)

fig=plt.figure(figsize=(8,7))

but, I when use

ax=fig.add\_subplot(111,projection=Pj)

the code mark error

---

<div class="post-metadata">

**Author:** ![astrofrog](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/astrofrog/32/64_2.png) [@astrofrog](https://community.openastronomy.org/u/astrofrog)\
**Post date:** [September 21, 2023, 10:01am UTC](https://community.openastronomy.org/t/error-with-use-wsc-on-fig-add-subplot-111-projection-pj/741/2 "2023-09-21T10:01:01Z")

</div>

Could you post the full error you are getting? Could you also provide the output of ‘print(Pj)’? Thanks!
