第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Python:如何在地圖上的特定點繪制散點圖?

Python:如何在地圖上的特定點繪制散點圖?

慕田峪7331174 2022-08-16 18:42:21
我正在研究有關(guān)地球磁場的地面觀測數(shù)據(jù)。我在Jupyter Notebook的Python中工作。每個天文臺都有一個數(shù)據(jù)系列,繪制如下圖:plt.scatter法典:# Function that plots the time series and the data series from a .mat data file # (in the dB-direction based on the out-variable), that is associated with the observatory code (based on the sta-variable)# It also takes an optional argument 'showdatapoints' so its possible to show data points mainly for debuggingdef plotdata_stations(filename, sta, out, start, stop, *args):# Makes the function use one of the three columns (and thus directions of field) in the data series based on inputif out == 'radial':    dat = 0elif out == 'theta':    dat = 1elif out == 'phi':    dat = 2# If the user inputs something else than one of these three, it returns an error and a hint to resolve the errorelse:    print('\nError: Component ' + "'" + out + "'" + ' not recognized...')    print('\nHint: Try using ' + "'" + 'radial' + "', " + "'" + 'theta' + "' or " + "'" + 'phi' + "'.")# Try to load file in case the file does not existtry:    nam = DataLoad(filename, 'obs_all')# If the file does not exist, it returns an error and a hint to resolve the errorexcept:    print('\nError: File ' + "'" + filename + "'" + ' not recognized...')     print('\nHint: Try putting your file in the same folder as this script.')# If the observatory code is not in the data file, it returns an error and a hint to resolve the errorif sta not in nam and sta != 'all':    print('\nError: Observatory Code ' + "'" + sta + "'" + ' not recognized...')        print('\nHint: Try using an Observatory Code from the Observatory Locations map.')
查看完整描述

1 回答

?
瀟湘沐

TA貢獻1816條經(jīng)驗 獲得超6個贊

我用數(shù)學(xué)的方式做了,就像這樣:


# Scaling data down to point of obs

###########################################

scax = 3

scay = 4

ntim=np.subtract(ntim,2000)

ntim=np.multiply(ntim,scax)

ndat=np.divide(ndat,scay)

###########################################


# Plots data from obs at the location of obs

# Plot at locations by adding coordinates of obs and subtracting the mean of each axis of data set

plt.scatter(ntim-np.mean(ntim)+phi, ndat-np.mean(ndat)+the, color='blue', marker='.')

plt.scatter(phi, the, color='red', marker='.')

但是,如果有人知道一種更“科學(xué)”的方法,我會歡迎您的回復(fù)。


查看完整回答
反對 回復(fù) 2022-08-16
  • 1 回答
  • 0 關(guān)注
  • 139 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號