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

Line break not working in color key title #1225

Closed
IgorDouven opened this issue Nov 15, 2018 · 6 comments · Fixed by GiovineItalia/Compose.jl#336
Closed

Line break not working in color key title #1225

IgorDouven opened this issue Nov 15, 2018 · 6 comments · Fixed by GiovineItalia/Compose.jl#336

Comments

@IgorDouven
Copy link

IgorDouven commented Nov 15, 2018

Dear all,

I would like to add a line break in the title of the color key, but \n is not working anymore. Here is a MWE:

using Gadfly

Gadfly.spy(rand(50, 50), Guide.ColorKey(title="Some label"))

If I use title="Some \n label", the title in the plot becomes 'Some'. Is this a known problem? Is there a workaround?

@bjarthur
Copy link
Member

text is not going to work like it did previously until we get pango fixed.

long term though we should work towards getting rid of non-julian dependencies.

in this particular case though, i'm not sure line breaks in SVG have ever worked. your example works for PDF.

see http://giovineitalia.github.io/Compose.jl/latest/tutorial/#Text-1

@IgorDouven
Copy link
Author

Thanks, you're right: PDF works fine. However, I can't use PDF because it makes the background black (even if I explicitly ask for a white background -- is this problem known?, should I open another issue?). My workaround is to export via SVG and then to use cairosvg in the command line to convert to a pdf file.

@Mattriks
Copy link
Member

Mattriks commented Nov 18, 2018

The background opacity issue was resolved on master (#1208). Did you do Theme(background_color="white") or Theme(panel_fill="white") or Theme(panel_opacity=0.0)?

For the history of this issue see: GiovineItalia/Compose.jl#322 (comment)

@IgorDouven
Copy link
Author

Thanks for pointing this out. I did the first. Using the second now and the problem is solved!

@Mattriks
Copy link
Member

Going back to the original issue here, multiline text using escape characters is not supported out-of-the-box for SVG1.x . SVG2 has some text features including inline-size and shape-inside which will auto-wrap text, and these appear to be supported by Inkscape. Needs testing in Compose!

@tlnagy
Copy link
Member

tlnagy commented Nov 26, 2018

AFAIK, multiline text was never supported in Gadfly SVGs, probably because (as @Mattriks points out) it's not supported in the SVG1.x spec. I think we can add preliminary SVG2-esque features if Inkscape supports it and if it gracefully fails on SVG 1.x rendering engines.

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

Successfully merging a pull request may close this issue.

4 participants