Combining gdf plot with data from different dataframe

Hi all,

is that possible to combine gdf plot with data from different dataframe, my code:

import geopandas as gpd
import pandas as pd
import hvplot.pandas
from shapely.geometry import Point
#import shapely

# Create a GeoDataFrame with a Point geometry column
#data = {'geometry': [Point(-74.005974, 40.712776), Point(-73.986259, 40.748817)]}
gdf = gpd.read_file('')

# Extract latitude and longitude into new columns
#gdf['latitude'] = gdf.geometry.y
#gdf['longitude'] = gdf.geometry.x

# Sample DataFrames (replace these with your actual data)
df1_data = {'latitude': [40.712776, 40.748817], 'longitude': [-74.005974, -73.986259], 'value1': [10, 20]}
df1 = pd.DataFrame(df1_data)

df2_data = {'latitude': [40.712776, 40.748817], 'longitude': [-74.005974, -73.986259], 'value2': [30, 40]}
df2 = pd.DataFrame(df2_data)

# Display the GeoDataFrame
a=gdf.hvplot(geo=True, line_color='blue', line_width=1,  frame_width=400, frame_height=400)
b=df1.hvplot(x='longitude',y='latitude', line_color='red', line_width=3,  frame_width=400, frame_height=400)


only a plotted no b bplot. kindly please advise.


They need to be projected to the same CRS.

hi @ahuang11 , thanks for your suggestion. but the x,y coordinate(lat,lon) between gpd and df1 in this example is suppose have same crs because they have same ranges?

You may need to specify geo=True on both.

thanks for your advise. I just realize I put different column name between df1 data with gpd. After I put the same column name between those 2 can overlay each other. thanks