![]() Imscatter(x, y, image_path, zoom=0.1, ax=ax)ĭef imscatter(x, y, image, ax=None, zoom=1):Īb = AnnotationBbox(im, (x0, y0), xycoords='data', frameon=False)Īx.update_datalim(np. You can get this scatterplot with Shapely.Here is the code : import matplotlib.pyplot as plt import matplotlib.patches as ptc import numpy as np from shapely.geometry import Point from shapely.ops import cascadedunion n 100 size 0.02 alpha 0.5 def points(): x np.random.uniform(sizen) y np.random.uniform(sizen) return x, y x1, y1 points() x2, y2. Here's an example of the second option: import numpy as npįrom matplotlib.offsetbox import OffsetImage, AnnotationBboxįrom matplotlib.cbook import get_sample_data Using imshow will tie the size of the image to the data coordinates of the plot. How can I remove this dot without redrawing the whole figure g Figure(figsize(5,4), dpi60) b g.addsubplot(111) b.plot(x,y,'bo') creates a blue dot b. The annotation box approach will allow the image to stay at a constant size as you zoom in. The below code creates a scatter plot with a white dot. The first way is the easiest to understand, but the second has a large advantage.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |