Plotting interface and wrapper for several julia plotting packages
Questions tagged [plots.jl]
205 questions
7
votes
2 answers
Accessing backend specific functionality with Julia Plots
Plots is simple and powerful but sometimes I would like to have a little bit more control over individual elements of the plot to fine-tune its appearance.
Is it possible to update the plot object of the backend directly?
E.g., for the default…

tim
- 2,076
- 8
- 14
7
votes
3 answers
How do you color (x,y) scatter plots according to values in z using Plots.jl?
Using the Plots.jl package in Julia, I am able to use various backends to make a scatter plot based on two vectors x and y
k = 100
x = rand(k)
y = rand(k)
scatter(x, y)
I am unable to find information about how to color them according to some…

pkofod
- 764
- 7
- 18
6
votes
1 answer
Have two (or more) node label sets in Julia GraphPlot maybe using Compose?
Here is a minimal working code from Julia Discourse:
using LightGraphs
using GraphPlot
using Colors
g = graphfamous("karate")
membership = [1,1,1,1,1,1,1,1,2,1,1,1,1,1,2,2,1,1,2,1,2,1,2,1,1,1,1,2,1,1,2,1,1,1]
nodelabels = 1:34
nodecolor =…

JKHA
- 1,800
- 11
- 28
6
votes
2 answers
Why am i getting "Unsatisfiable requirements detected for package HTTP" error when trying to add the Plots package in Julia?
I'm using Julia v1.5.2 and using this code to add the Plots package
import Pkg
Pkg.add("Plots")
And I'm getting an error message that is given below.
I've tried reinstalling Julia and also tried the other stable version (v1.0), but I'm still…

ray_lv
- 99
- 5
6
votes
3 answers
Increase space between subplots in Plots.jl
How can I increase the space between subplots in Plots.jl?
Minimal non-working example:
julia> using Plots; pyplot()
Plots.PyPlotBackend()
julia> data = [rand(100), rand(100)];
histogram(data, layout=2, title=["Dataset A" "Dataset B"],…

gTcV
- 2,446
- 1
- 15
- 32
5
votes
0 answers
How to have a legend for colored edges in Julia plots?
Here is a minimal working code from Julia Discourse:
using LightGraphs
using GraphPlot
using Colors
g = graphfamous("karate")
membership = [1,1,1,1,1,1,1,1,2,1,1,1,1,1,2,2,1,1,2,1,2,1,2,1,1,1,1,2,1,1,2,1,1,1]
nodecolor = [colorant"lightgrey",…

JKHA
- 1,800
- 11
- 28
5
votes
2 answers
Plot DataFrames in Julia using Plots
In Julia, is there a way to plot a dataframe similarly to df.plot() in Python's Pandas?
More specifically, I am using Plots, plotlyjs() and the DataFrames package.

Joris Limonier
- 681
- 1
- 10
- 27
5
votes
1 answer
How to set number of minor tick marks for only one but not both the axes?
Consider the following code:
using Plots
gr()
x = 1:10
y = rand(10)
plot(x, y)
xaxis!(minorticks=10)
which produces the following plot:
There are 10 minor tick marks on both x- and y-axis. I like to set the number of minor tick marks on only the…

cbsteh
- 809
- 6
- 19
5
votes
2 answers
How to set title fontsize in Plots.jl
Is there a simple way to change the fontsize of only (i.e., everything else should remain unchanged) the title in Plots.jl?

Pietro
- 415
- 6
- 16
5
votes
3 answers
How to set the default attributes of Plots?
In Julia plotting with Plots, I know how to set the various attributes when using plot() (Attributes).
I want to know how to set the default attributes, so that I don't need to set them every time.
For instance, I want to change the font-family to…

Leftriver
- 77
- 1
- 8
5
votes
1 answer
Increase spacing/padding between legend labels in Plots.jl
I am using Plots.jl with the GR backend to produce some plots in JuliaLang. I have noticed that when using LaTeXStrings.jl to produce Latex strings in the legend labels that the labels are close together. To illustrate what I'm referring to, I've…

crispyninja
- 135
- 7
5
votes
1 answer
Log axis appearance in julia/Plots
Here is a plot generated by julia's Plots library, using the xaxis=:log attribute:
The plot has evenly spaced tick marks, with labels like 10^0.25. This might be useful sometimes, but I find it a bit confusing for this plot, because most people…

N. Virgo
- 7,970
- 11
- 44
- 65
5
votes
2 answers
Using plot within a script in julia
I've been prototyping some julia code in a Jupyter notebook, but it's outgrown the notebook format and I want to put it in a script in order to organise it properly. However, I can't work out how to get Plots to work in a script, and can't find any…

N. Virgo
- 7,970
- 11
- 44
- 65
5
votes
1 answer
Display multiple plots with Plots.jl
I currently have two vectors, x and y which I plot separately as in
using Plots
pyplot() # chooses pyplot background
x = rand(100); y = rand(100)
plt1 = plot(x)
display(plt1)
plt2 = plot(y)
display(plt2)
I have also tried the gui() and gui(plt1)…

JBar
- 145
- 3
- 6
5
votes
2 answers
Plots.jl adding a trendline, plus changing the x-axis
I want to do a simple plot using Plots.jl.
I calculated a rate for each month over a couple of years. The problem that I am facing now is that I want to add a trendline to this plot. I did not find how this is done in Julia or Plots, if this is…

DoubleBass
- 107
- 1
- 7