Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pixel position of grid #219

Closed
Eddysearcher opened this issue Nov 3, 2023 · 4 comments
Closed

pixel position of grid #219

Eddysearcher opened this issue Nov 3, 2023 · 4 comments

Comments

@Eddysearcher
Copy link

Bug report

Bug summary

Hello dear author, I encountered this issue while running the code.

Code for reproduction

# Paste your code here
#from datetime import datetime

from matplotlib import pyplot as plt
from numpy import arange

from py_eddy_tracker import data
from py_eddy_tracker.dataset.grid import RegularGridDataset
def start_axes(title):
    fig = plt.figure(figsize=(13, 5))
    ax = fig.add_axes([0.03, 0.03, 0.90, 0.94])
    ax.set_xlim(-6, 36.5), ax.set_ylim(30, 46)
    ax.set_aspect("equal")
    ax.set_title(title, weight="bold")
    return ax


def update_axes(ax, mappable=None):
    ax.grid()
    if mappable:
        plt.colorbar(mappable, cax=ax.figure.add_axes([0.94, 0.05, 0.01, 0.9]))
g = RegularGridDataset(
    data.get_demo_path(r"E:\data\pet_eddy\data\dt_med_allsat_phy_l4_20160515_20190101.nc"),
    "longitude",
    "latitude",)

ax = start_axes("ADT (m)")
m = g.display(ax, "adt", vmin=-0.15, vmax=0.15, cmap="RdBu_r")
update_axes(ax, m)

ax = start_axes("ADT closed contours (only 1 / 4 levels)")
g.contours.display(ax, step=4)
update_axes(ax)

#

Actual outcome

image


**Expected outcome**

<!--A description of the expected outcome from the code snippet-->
@Eddysearcher
Copy link
Author

Error: We assume pixel position of grid is centered for E:\data\pet_eddy\data\dt_med_allsat_phy_l4_20160515_20190101.nc

@AntSimi
Copy link
Owner

AntSimi commented Nov 4, 2023

If you use matplotlib 3.8 or newer try previous version, right now pyeddytracker doesn't work with matplotlib >=3.8.

@AntSimi
Copy link
Owner

AntSimi commented Nov 4, 2023

Link to #216

@Eddysearcher
Copy link
Author

I sincerely appreciate your invaluable assistance. Your support means a lot to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants