Изображение не содержит точку разброса - PullRequest
0 голосов
/ 27 мая 2019

HY, используя следующий код, я хочу напечатать точку на карте

from gps import *
import matplotlib.pyplot as plt
import time, inspect, os

logPath = "C:\Users\Etantonio\PycharmProjects\MapShow\LOGS"
actualMapFilePath = logPath + "\Map_GPS.png"
actualFigureMapFilePath = logPath + "\FIGURE_Map_GPS.png"

# adjust these values based on your location and map, lat and long are in decimal degrees
TRX = -12.6453  # top right longitude
TRY = 46.871  # top right latitude
BLX = -12.6347  # bottom left longitude
BLY = 46.8638  # bottom left latitude

# Create Image File
pos_y = 46.865321667
pos_x = -12.640213333

# Load the mapp
im = plt.imread('map.png')
plt.imshow(im, extent=[BLX, TRX, BLY, TRY], zorder=1)

# add a point over the map
plt.scatter(x=[pos_x], y=[pos_y], s=5, c='r', zorder=2)

# OK, the point is showed on the map, perfect quality
plt.show()

# NOT OK, in the resulting file it is showed only the map not the point
plt.imsave(actualMapFilePath, im)

# OK, the point is showed on the map, but bad quality
plt.savefig(actualFigureMapFilePath, dpi=150, bbox_inches='tight', cmap="hot")

Я не могу понять, почему точка не отображается на карте

plt.imsave(actualMapFilePath, im)

Спасибо, Антонио

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...