How to add white border around text?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.8k
- Forks
- 254
- Avg merge
- 10h 35m
- Merged PRs (30d)
- 9
Description
Discussed in https://github.com/has2k1/plotnine/discussions/898
Originally posted by aborruso December 7, 2024
Hi,
I would like to add a thin white border to text labels
(
ggplot(geo_df)
+ geom_map(aes(fill="costo_per_km2"), color="black", size=0.1)
+ scale_fill_cmap(cmap_name="YlOrRd")
+ geom_text(
aes("center_lon", "center_lat", label="DEN_REGIONE"), size=8,color="black"
)
+ labs(fill="Costo €/km²")
+ theme(
panel_background=element_rect(fill="white"),
panel_grid=element_blank(),
axis_text=element_blank(),
axis_ticks=element_blank(),
axis_title=element_blank(),
)
)
If I simply clone the text layers, and change the dimensions, then they turn out centered differently
+ geom_text(
aes("center_lon", "center_lat", label="DEN_REGIONE"), size=8,color="white"
)
+ geom_text(
aes("center_lon", "center_lat", label="DEN_REGIONE"), size=6,color="black"
)
Thank you
Create an example in the documentation
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the discussion at github.com/has2k1/plotnine/discussions/898 and review the linked input file to understand the requested text-label effect and the existing plotnine example. Locate the appropriate documentation example area, add a reproducible example, and verify that it demonstrates a white border around text labels without the misalignment shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100