Plots.jl: Modify frame thickness

How do I modify the linewidth of the frame (frame = :box) of a Plots.jl plot?

I’m using the PyPlot backend. Currently my plot looks like this:

Clearly, the frame is too thick.

2 Likes

Any news on this? I have the same problem but using pgfplotsx backend.
@carstenbauer, did you solve it ?

bump?

I haven’t seen anything controlling frame thickness in Plots.jl myself (Not even when I peeked at the GR & PyPlot backend code to add features to the InspectDR backend).

Workaround 1

Depending on the backend, you can probably change the DPI resolution of your entire plot until you get the desired frame thicknes. Then, you can probably tweak every other setting in Plots.jl (line thickness, font size, …) to get the desired effect.

You can look at this issue if you want leads on how to change these settings:
Plotting for publications. · Issue #897 · JuliaPlots/Plots.jl · GitHub

Disadvantages

  • Not all backends treat DPI the same way.
  • Seems like a roundabout way of doing something simple.

Workaround 2

Another useful workaround that is applicable whenever Plots.jl doesn’t quite do what you want is to use your backend’s API directly to do the final tweaks:

p=plot([1,2,3]; title="Test")
pbkend = display(p) #Display to get ref to backend object.

#Change frame thickness here using "pbkend" HERE

Disadvantages

  • Need backend-specific code to perform the final tweaks.

I suggest opening an issue

In this case, it seems reasonable to open an issue for a feature request.
Issues · JuliaPlots/Plots.jl · GitHub

There appear to be at least 3 individuals that want it.

1 Like