Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for multibyte character labels #205

Open
manybooks opened this issue May 2, 2018 · 5 comments
Open

support for multibyte character labels #205

manybooks opened this issue May 2, 2018 · 5 comments

Comments

@manybooks
Copy link

Is there any way to use the multibyte characters as labels?
I tried hyp.plot(x, labels=multibyte_characters) but not worked.
( In matplotlib.pyplot, I always use fontproperty )

@jeremymanning
Copy link
Member

Thanks for submitting an issue! Can you paste in the error you're encountering? And could you also provide a full snippet that we could use to replicate the error?

@manybooks
Copy link
Author

I apologize for confusing you.
I didn't get any error. But every multibyte characters are replaced by white square.
(The link below is example of matplotlib but it will help you what I'm saying)
http://cdn-ak.f.st-hatena.com/images/fotolife/s/sucrose/20130610/20130610000617.png

And my code is as follows.

import hypertools as hyp
import numpy as np

X = np.random.rand(3, 10)
labels = ["いち", "に", "さん"] # these are japanese characters
hyp.plot(X, labels=labels)

@jeremymanning
Copy link
Member

Ah, thanks for clarifying. We use matplotlib as our back end renderer, so if the issue is also part of matplotlib we won't be able to address it directly within hypertools. Could you submit an issue to matplotlib as well?

In the mean time, we are also looking into other renderers (plotly and ipyvolume), so I'll leave this issue open until the multibyte character issue is resolved.

@manybooks
Copy link
Author

In matplotlib, I can render multibyte charcters by passing fontproperty like this.

import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties

fp = FontProperties(fname='path\to\Fonts\YuGothic.ttf')
plt.text(1, 1, 'にほんご', fontproperties=fp)

So I want you to provide any way to specify fontproperty of matplotlib working in the backend.

@jeremymanning
Copy link
Member

@manybooks thanks for the additional info. i've added an issue to add functionality to allow passing arguments to matplotlib through hyp.plot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants