0

When I create a graph in an iJulia notebook, the font in the axis labels and legend is extremely small and I can't seem to make it bigger. I am running Julia 1.0.0 in a Jupyter notebook (jupyter: 1.0.0-py36_7) on Linux (Ubuntu). For example, the following code:

using Plots
x = 1:10; y = rand(10); 
plot(x,y, size=[500,300])

Results in this image:

graph with very small font

I even tried uninstalling and reinstalling Jupyter. Any help would be greatly appreciated.

[Edited] In response to Bill's suggestion, I added: Plots.scalefontsizes(2.5)

This resulted in more space for the characters, but not larger characters. The result is here:

Plot with scalefontsizes(2.5)

1 Answers1

1

Try:

Plots.scalefontsizes(2.5)  # 2.5X

and adjust as needed.

Bill
  • 5,600
  • 15
  • 27
  • Thanks for the suggestion.I tried this. And what appears to happen is that the space for the characters is increased, but the characters themselves are not larger. – user3165546 Oct 05 '18 at 11:25
  • I added a picture to my original post to show the result. – user3165546 Oct 05 '18 at 11:32
  • Hmm, it always worked here. Perhaps, try changing fonts: Plots.font("Helvetica", 18) with the name of a font you know scales in another application? – Bill Oct 06 '18 at 03:25
  • Maybe change backends (with plotly() or pyplot() with adding Plotly and or PyPlot? – Bill Oct 07 '18 at 20:38
  • with the Qt backends, this problem on some Linux seems fixed sometimes with export QT_AUTO_SCREEN_SCALE_FACTOR=0 ; add before running julia – Bill Oct 08 '18 at 08:08
  • I put the export QT_AUTO_SCREEN_SCALE_FACTOR=0 line in my .profile. Before invoking IJulia.notebook(), I used ENV[QT_AUTO_SCREEN_SCALE_FACTOR] to ensure that the variable was set. I also tested this value from within the Jupyter notebook. So, the variable is set, as suggested, but the graph is the same as before, with tiny characters. – user3165546 Oct 09 '18 at 01:32
  • I went back to your earlier suggestion that I try different backends. I tried GR and plotly and still got the small characters. But when I used pyplot(), the characters took on the correct size. Both gr() and plotly() are still serving up the tiny characters, but pyplot() looks normal. Thanks for your suggestion. Do you know why these backends would behave so differently? – user3165546 Oct 09 '18 at 02:05
  • Probably it is what fonts are installed that those backends can use. I don't know why they are not available in your Linux version though. – Bill Oct 09 '18 at 03:32