Skip to content

assign lon on x-axis #2

@MohitDahliya

Description

@MohitDahliya

I used vertcross to get a longitude-pressure cross section of vertical wind.

Set the start and end points at the specific latitude (28.718N)

start_point = CoordPair(lat=28.718, lon=76)
end_point = CoordPair(lat=28.718, lon=78)

w_cross = vertcross(w, z, wrfin=file, start_point=start_point,
end_point=end_point, latlon=True, meta=True)

After that I put height labels on y-axis using the following code:

Set the y-ticks to use height labels.

vert_vals = to_np(w_cross.coords["vertical"])
v_ticks = np.arange(vert_vals.shape[0])
ax.set_yticks(v_ticks[::20])
ax.set_yticklabels(vert_vals[::20], fontsize=13

Now I want to put lon labels on x-axis but the w_cross has coords vertical and xy_loc and xy_loc is a CoordPair of lat and lon values.

How to extract lon out of this coordpair and put it on the x-axis?

Thanks in advance for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions