This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mainPanel( | |
plotOutput(“plot”) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output$plot <-renderPlot( | |
generate_plot(input$column) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import libraries | |
library(shiny) | |
# possibly read in some data to be used below | |
# define the UI | |
ui <- fluidPage( | |
# app title | |
headerPanel("My Title"), | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gdf1 = gpd.GeoDataFrame(df, geometry = gpd.points_from_xy(df['LONGITUDE'], df['LATITUDE'])) | |
gdf1.iloc[0:100].plot(ax = ax, color = 'blue', markersize = 1.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
f, ax = matplotlib.pyplot.subplots() | |
minDate = np.datetime64('2011-01-01') | |
maxDate = np.datetime64('2019-01-01') | |
bins = np.arange(minDate, maxDate, np.timedelta64(1, 'M'), dtype = 'datetime64[M]') | |
ax.hist(df['CREATION DATE'], bins = bins, orientation = 'horizontal') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmap = matplotlib.colormaps['Reds'] | |
norm = matplotlib.colors.Normalize(vmin = min(gdf['Total Potholes']), vmax = max(gdf['Total Potholes'])) | |
co = cmap(norm(gdf['Total Potholes'])) | |
ap = norm((gdf['Total Potholes'])).clip(0,1) | |
gdf.plot(ax = ax, color = co, alpha = ap) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rasterio rasterio | |
import matplotlib | |
f,ax = matplotlib.pyplot.subplots() | |
rasterio.plot.show(chicago.read(), ax = ax, transform = chicago.transform) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df['CREATION DATE'] = pd.to_datetime(df['CREATION DATE']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if point.within(poly): | |
# do something |
NewerOlder