avatarBenjamin A.

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

3969

Abstract

lors, and no axes by default, streamlining the process of plotting vector data. If needed, you can easily customize the appearance using gspatial_plot, Geopandas, or Matplotlib parameters.</p><div id="7f83"><pre>gsp<span class="hljs-selector-class">.shapeplot</span>(usa, figsize=(<span class="hljs-number">15</span>, <span class="hljs-number">15</span>))</pre></div><figure id="5a4f"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*hgepISp4blKLRyoMFCcqAg.png"><figcaption></figcaption></figure><p id="970d">You also have the option to adjust the parameters according to your needs. For instance, let’s incorporate a title into the visualization:</p><div id="b7f0"><pre>gsp.shapeplot( usa, title=<span class="hljs-string">"USA MAP"</span>, title_kwds={<span class="hljs-string">"fontsize"</span>: 25, <span class="hljs-string">"fontname"</span>: <span class="hljs-string">"sans-serif"</span>, <span class="hljs-string">"fontweight"</span>: 3}, )</pre></div><figure id="4438"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*mIWUUXOP3u1uiZXQs_N2Lg.png"><figcaption></figcaption></figure><p id="1dc8"><b>Here’s the explanation of the shapeplot function’s parameters:</b></p><p id="7d22">• data (GeoDataFrame): GeoDataFrame used as the data source for the map. • title (str): Title displayed on the map. Default is None. • title_kwds (dict): Keyword arguments for configuring title appearance using matplotlib.pyplot.title. Default is an empty dictionary. • figsize (tuple): Dimensions of the figure. Default is (15, 15). • facecolor (str): Background color of the figure. Default is “white”. • edgecolor (str): Color of the map’s edges. Default is “black”. • linewidth (float): Line width for shapes. Default is 0.5. • color (str): Color of the shape. Default is “#F1F3F4”. • annot (bool): Toggle annotations on/off. Default is False. • annot_column (str/GeoDataFrame column): Source column for annotations. Default is None. • annot_align (str): Text alignment for annotations. Default is “center”. • annot_kwds (dict): Keyword arguments for customizing annotations. Default is an empty dictionary. • ax (matplotlib axis): Existing axis for plotting, if needed. Default is None. • axis_on (bool): Toggle axis visibility. Default is False. • **geopandas_plot_kwds: Additional keyword arguments for Geopandas plot customization.</p><p id="5a62">Returns: Matplotlib axis object (ax) representing the map.</p><p id="39a4">This function enables straightforward GeoDataFrame shape plotting with customizable options for appearance and annotations, while allowing flexibility in using existing axes for plotting. The function returns a matplotlib axis object representing the generated map.</p><h1 id="7308">pointplot</h1><p id="e010">Point plot is designed specifically for visualizing point data. A key distinction between point plot and shapeplot lies in the ability to utilize a base vector layer of shapes. This base layer allows points to be plotted on top, enabling a layered representation.</p><div id="62be"><pre>usa_points = usa.representative_point() gsp.pointplot(usa_points, <span class="hljs-keyword">base</span>=usa)</pre></div><figure id="e5d7"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*ZOiYi_T2DL9CU9Kx7-KpGA.png"><figcaption></figcaption></figure><p id="6b86">Alternatively, you have the option to plot the polygons themselves instead of just their boundaries in the base layer.</p><div id="aac0"><pre>gsp.pointplot(usa_points, <span class="hljs-keyword">base</span>=usa, base_boundary=False)</pre></div><figure id="3412"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*_Sz_IGkazfobhvTpV3Y8Ag.png"><figcaption></figcaption></figure><p id="8f2e">Points can be plotted independently, without the need for a base layer.</p><div id="30aa"><pre>gsp<span class="hljs-selector-class">.pointplot</span>(usa_points)</pre></div><figure id="d8ed"><img src="https://cdn

Options

-images-1.readmedium.com/v2/resize:fit:800/1*zFOL9eUsmS-5S67MeufNcQ.png"><figcaption></figcaption></figure><p id="5c42">Matplotlib axis objects offer the ability to merge and combine multiple plots.</p><div id="4753"><pre>ax = gsp.shapeplot(usa, figsize=(<span class="hljs-number">15</span>, <span class="hljs-number">15</span>)) gsp.pointplot(usa_points, ax=ax)</pre></div><figure id="f05f"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*_Sz_IGkazfobhvTpV3Y8Ag.png"><figcaption></figcaption></figure><p id="b9e0">It’s also possible to tailor the appearance of the base layer according to your preferences.</p><div id="3dfa"><pre>gsp.pointplot( usa_points, base=usa, basecolor=<span class="hljs-string">"#7aebff"</span>, base_boundary=<span class="hljs-literal">False</span>, title=<span class="hljs-string">"USA Points"</span>, title_kwds={<span class="hljs-string">"fontsize"</span>: <span class="hljs-number">25</span>, <span class="hljs-string">"fontname"</span>: <span class="hljs-string">"sans-serif"</span>, <span class="hljs-string">"fontweight"</span>: <span class="hljs-number">3</span>}, )</pre></div><figure id="ce5a"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*AiPv5roDBIrvCc92oIvZ4g.png"><figcaption></figcaption></figure><p id="3d19"><b>Here’s the breakdown of the pointplot function’s parameters:</b></p><p id="a875">• data (GeoDataFrame): The GeoDataFrame used for plotting the map. • base (GeoDataFrame): Base GeoDataFrame on top of which the data will be plotted. Defaults to None. • title (str): Title of the map. Defaults to None. • title_kwds (dict): Keyword arguments for configuring the appearance of the title using matplotlib.pyplot.title. Defaults to an empty dictionary. • figsize (tuple): Size of the figure. Defaults to (15, 15). • color (str): Color of the point. Defaults to “#ffb536”. • edgecolor (str): Color of the map’s edges. Defaults to “black”. • basecolor (str): Color of the base data. Defaults to “#F1F3F4”. • baseboundarycolor (str): Boundary color of the base data. Defaults to “black”. • base_boundary (bool): Toggle visibility of base data boundaries. Defaults to True. • boundary_linewidth (float): Linewidth of the base data boundaries. Defaults to 0.5. • linewidth (float): Width of lines for shapes. Defaults to 0.5. • annot (bool): If True, annotations are generated. Defaults to False. • annot_column (str/GeoDataFrame column): If annot is True, column should be passed as the source for annotation. Defaults to None. • annot_align (str): Text alignment for annotations. Defaults to “center”. • annot_kwds (dict): Keyword arguments for annotation customization. Defaults to an empty dictionary. • ax (matplotlib axis): Existing axis for plotting. Defaults to None. • axis_on (bool): Toggle axis visibility. Defaults to False. • facecolor (str): Figure’s face color. Defaults to “white”. • **geopandas_plot_kwds: Additional Geopandas plot keyword arguments.</p><p id="fd44">Returns: Matplotlib axis object (ax).</p><h1 id="44de">Tips for Polished Maps</h1><p id="46bb"><b>Harmonious Color Choices:</b> Experiment with color palettes to create maps that are visually pleasing and easy to understand. Choose colors that enhance the readability of your map.</p><p id="6be4"><b>Precise Annotations:</b> Annotations provide context to your maps. Customize annotation alignment and appearance to guide viewers through your spatial narrative seamlessly.</p><p id="b235"><b>Seamless Matplotlib Integration:</b> Leverage the integration with Matplotlib to fine-tune your maps’ aesthetics, titles, and labels for a polished final product.</p><h1 id="071e">Conclusion</h1><p id="3df6">In this tutorial, we’ve covered the essentials of crafting geospatial maps using the gspatial_plot library. With gspatial_plot, the process of geospatial mapping becomes more manageable and easy. See you in the next tutorial— happy mapping!</p></article></body>

How My Medium Views Dropped Considerably After a 5-Day Trip to Shanghai?

Image by author.

Hello! I have experienced and shared with you the thrill of seeing my articles gain traction and engage with a wide audience, and today I want to share my personal experience of how my Medium views dropped considerably after being away from the platform for just five days. Specifically, I’ll delve into the factors that contributed to this decline and offer some insights on how to prevent such a situation in the future.

1.The Importance of Consistency

Consistency is the key, we all know it at this point, it plays a crucial role in maintaining visibility and engagement on Medium. Regularly publishing fresh content keeps your audience engaged and interested in what you have to say. Unfortunately, my absence during a five-day trip to Shanghai disrupted this consistency, resulting in a decline in views.

2.The Medium Algorithm and Freshness

Medium’s algorithm is designed to promote recently published content, giving priority to articles that have gained traction in the last few days. When I was away from the platform, my articles became buried under the deluge of new content, making them less discoverable to readers. As a result, my views dropped significantly during this period.

3. Leveraging Social Media:

One of my main effective strategies to mitigate the impact of a hiatus is to leverage social media platforms. Sharing my articles on Twitter, LinkedIn, Facebook, or other relevant platforms to help maintain visibility and attract readers to my Medium articles. Unfortunately, I neglected this aspect during my trip, which further contributed to the drop in views.

4.Engaging with the Medium Community

Active engagement within the Medium community is another factor that can significantly impact your article’s visibility and readership. By reading, commenting, and recommending articles written by other authors, you create a reciprocal relationship where other writers are more likely to engage with your content as well. During my absence, this crucial element of community engagement suffered, leading to a decline in views.

5.Learning from the Experience

While my experience of a considerable drop in views was disheartening, it also provided valuable insights for the future. Here are some key takeaways from my experience:

a. Schedule Content in Advance: Plan and schedule your content to be published even when you’re away. This ensures a consistent presence on Medium and helps maintain visibility.

b. Leverage Automation Tools: Utilize automation tools to share your articles on social media platforms automatically. This will save time and ensure your content continues to reach a wider audience.

c. Engage Even When You’re Away: Even if you cannot actively write during your absence, take some time to engage with the Medium community through reading and recommending articles. This fosters a sense of reciprocity and maintains your presence.

Bottom Line

Maintaining consistency and engagement on Medium is vital for sustaining a readership and ensuring your content reaches its full potential. The decline in views I experienced, serves as a reminder of the importance of regular content publication, leveraging social media, and engaging with the Medium community.

Thank you for reading!

If you like the article and would like to support me make sure to:

Join the Medium membership program for only 5$ to continue learning without limits. I’ll receive a small portion of your membership fee if you use the following link, at no extra cost to you.

Writing
Medium
Followers
Self
Tech
Recommended from ReadMedium