Comments (6)
Ah ok, I'll leave this open but not something I'll get to fixing immediately, it needs a proper solution for scaling the fontsize to fit within the shapes, which isn't something matplotlib gives out the box as far as I know.
from distinctipy.
Hi @abubelinha , I've released a new version (v1.3.1
) that should both fix the bug with using it for fewer than 9 colours (hopefully), but also adds a fontsize
argument so you can change it manually. Let me know if it works!
from distinctipy.
Thanks a lot.
I tried a normal pip installation upgrade but it didn't change my version.
I guess I must install from repository, correct?
(I am not very used to that so I'll check my notes on how I did it in the past)
from distinctipy.
OK, I could upgrade it to 1.3.1 this way (just for my record):
pip install --upgrade https://github.com/alan-turing-institute/distinctipy/archive/master.zip
It works great now, except that default-size text goes beyond top when selecting just one color (nothing really important):
Still haven't tried fontsize
argument but I'll do.
Thanks a lot for your quick answer!!
from distinctipy.
@abubelinha I think that should be fixed now too if you upgrade again (to 1.3.3), if not I'll re-open the issue as something to look into again in the future because I never really found a good solution for getting the sizing etc. right, it's pretty hacky. Thanks for posting the issue!
from distinctipy.
Thanks a lot. It works OK for my simple tests.
I find issues again with default font size when increasing the number of subplots: i.e. combining color_swatch(1)
, color_swatch(2)
... color_swatch(n)
in the same plot.
That's probably not a good idea and I am not really needed to do that (also, passing fontsize=8
solves the problem).
I just want to let you know.
import distinctipy, matplotlib.pyplot as plt
maxcolors = 9
fig, axes = plt.subplots(maxcolors, 1, figsize=(6, 6))
for i in range(0,maxcolors):
colors = distinctipy.get_colors(i+1)
print(colors,"\n",textcolors)
distinctipy.color_swatch(colors, show_text=True, ax=axes[i], title="colors={}".format(i+1),
text_threshold=0.5
# , fontsize=8
)
plt.show()
maxcolors = 5
maxcolors = 9
from distinctipy.
Related Issues (20)
- Update docs for new API
- Check and improve docstrings HOT 1
- Automate code quality checks
- Tighten up API
- Accompanying paper HOT 1
- Add algorithm description to docs
- Add pre-commit config
- Conda package?
- Improve tests and coverage
- Optionally always generate same color pallete HOT 2
- [Feature request] Add class `Color` HOT 4
- MANUALLY RE-ORDER COLORS FROM CREATED DISTINCT COLORS HOT 2
- Including test suite in pypi tarball HOT 1
- Ordering the colors generated HOT 4
- Use W3C guidelines for text colour choice HOT 1
- Python 3.7 is broken in 1.3.x HOT 1
- Improve font colour selection HOT 1
- Add tests
- Generate documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distinctipy.