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

map of bozeman, MT #19

Open
deichdeich opened this issue Jul 20, 2019 · 1 comment
Open

map of bozeman, MT #19

deichdeich opened this issue Jul 20, 2019 · 1 comment

Comments

@deichdeich
Copy link

deichdeich commented Jul 20, 2019

This code is really cool! Here's Bozeman, with love from the MSU physics department:

rm = RidgeMap((-111.373901,45.502497,-110.916595,45.908167))

msu =  (-45.46202, -41.665885) 

msu_coords = ((msu[0] - rm.longs[0])/(rm.longs[1] - rm.longs[0]),(msu[1] - rm.lats[0])/(rm.lats[1] - rm.lats[0]))                                          
                                 
values = rm.get_elevation_data(num_lines=150)

newmap = colors.LinearSegmentedColormap.from_list('trunc({n},{a:.2f},{b:.2f})'.format(n='Blues', a=0.7, b=1), plt.get_cmap('Blues')(np.linspace(0.7, 1, 100))) 

values=rm.preprocess(
    values=values,
    lake_flatness=1,
    water_ntile=5,
    vertical_ratio=180)

ridges = rm.plot_map(values=values,
            label='Bozeman',
            label_y=0.9,
            label_x=0.05,
            label_size=40,
            line_color=newmap,
            kind = 'elevation',
            linewidth=1)

ridges.scatter(msu_coords[0], msu_coords[1], marker='$\heartsuit$',
            color='red',
            s=80,
            zorder=len(values)+10)

plt.show()```
@ColCarroll
Copy link
Owner

I love it! This is also a clever way to add hearts to matplotlib plots! ❤️

I will update the README shortly...

image

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