Plotting interface and wrapper for several julia plotting packages
Questions tagged [plots.jl]
205 questions
0
votes
0 answers
Why does my julia plot pane show nothing in VS Code?
I both using Julia 1.6 and Julia 1.9. both can't plot anything, or sometimes give a shift shrinkle plots.
Any ideas?
0
votes
0 answers
How to eliminate the horizontal line when a range is set for a histogram in Julia Plots
I am using Julia plots to construct a histogram. A pseudo code is given:
data = some data
b_range = range(0, 1, length=10)
histogram!(data, bins=b_range, normalize=:probability)
But I have a horizontal line above the x-axis. How can I eliminate…

PokeLu
- 767
- 8
- 17
0
votes
1 answer
julia Plots.jl: plot matrix with grouped rows
I have a set of data where
x: N×M Matrix{Float64}
y: N×M Matrix{Float64}
z: N-element Vector{String}
Where z is associated with the Nth row of the matrix. I am attempting to plot the data and group it by the z, but I'm not sure of the best way to go…

Andrew
- 1
- 1
0
votes
0 answers
How to contour Gridcells in Julia?
I want to plot some areas on a world map and contour them because some of them are overlapping each other.
First attempt:
contour plot
function scale4plot(A,f=100)
resize(A,f) = [A[i,j] for i=1 .+(0:f*size(A,1)-1).÷f,j=1 .+(0:f*size(A,2)-1).÷f]
…

vcv
- 11
- 2
0
votes
2 answers
Plot with double (or triple) x ticks labels on Julia like Excel Pivot Chart
I want to plot something with doulble x ticks labels one for the item name and other for the purchase month
Month
Item
Price
Feb
Tomatoe
15
Feb
Cockies
10
Feb
Juice
20
Feb
Orange
13
Mar
Cake
11
Mar
Potato
30
Mar
Juice
13
I…
0
votes
1 answer
Stack plots generated in a loop
I am running an if loop and want to stack the resulting plots in a grid. This is my sample code, which generates two random variables and plots a third one under two conditions:
import numpy as np
import matplotlib.pyplot as plt
# Set seed for…

Weierstraß Ramirez
- 251
- 2
- 14
0
votes
1 answer
Using append! in a for loop
I have a histogram and I want to plot some text on it, which is coming from a dictionary.
Once I have made the histogram using
using Plots
histogram(data)
I can put in text by using the command
annotate!(xpos, ypos, text("mytext", :red, :right,…

tyler
- 11
- 1
0
votes
0 answers
Julia Plots xtick and ytick font halign and valign
I am trying to understand the behavior of certain keyword arguments in the default GR backend for the Julia Plots package. Here is a screen shot that explains what is going on:
I have looked at the documentation for the Plots.jl package and I can't…

ITA
- 3,200
- 3
- 18
- 32
0
votes
1 answer
How to change precision of dates in x-axis Plots julia?
Suppose I have the following data and its plot:
using DataFrames
using StatsPlots
using Plots
using Dates
dates = Date(2021, 1, 1):Day(1):Date(2023, 3, 28)
n = length(dates)
df = DataFrame(
date=dates,
col1=rand(n),
col2=rand(n)
)
@df df…

Shayan
- 5,165
- 4
- 16
- 45
0
votes
1 answer
Extracting and re-using subplots in Julia
How can I extract and reuse/combine subplots in Julia? Consider:
pp = plot(0:0.01:2, [sin.(0:0.01:2), cos.(0:0.01:2)], layout=(1,2));
gg = plot(0:0.01:2, [sin.(0:0.01:2).^2, cos.(0:0.01:2).^2], layout=(1,2));
Both pp and gg report length 2 and…

ITA
- 3,200
- 3
- 18
- 32
0
votes
1 answer
How to make specific portion of lines in a plot thicker without changing colors?
I'm dealing with a dataframe of size (579x31), and I want to plot all columns except the :date column and modify the plot to change the line width of the last 30 data points in the plot.
using DataFrames
using Plots
using StatsPlots
# `selection`…

Shayan
- 5,165
- 4
- 16
- 45
0
votes
1 answer
BoxPlots with log scale in Julia
I am using Plots.
When I use the log scale for the x-axis, the plot does not seem to be nice.
The width of the box is not arranged.
Do you have any idea to overcome this?
boxplot([10 100 1000], [randn(10).+10 randn(10).+20 randn(10).+30],…

Sakurai.JJ
- 553
- 3
- 10
0
votes
2 answers
How to interpret xticks when plotting time series in Julia with Plots.jl and TimeSeries.jl
I have the following code:
using Plots
using TimeSeries
apple_ta = readtimearray("apple.csv")
p = plot(apple_ta[:Open])
Plots.xticks(p)
1-element Vector{Tuple{Vector{Float64}, Vector{String}}}:
([735599.0, 736330.0, 737060.0, 737791.0],…

Bex T.
- 1,062
- 1
- 12
- 28
0
votes
1 answer
Julia datetime, format without seconds
How do I remove the seconds from showing up in the plot below? (The date format change seems to not alter the plot at all!)
using DataFrames, Dates, Plots
gr(linewidth=3, markersize=4, titlefont=18, legendfont=12, guidefont=18, tickfont=14,…

hegdep
- 596
- 1
- 6
- 16
0
votes
1 answer
Line plot in Julia shows a weird line... is this a bug?
I am trying to plot two series (each has 2,000 points) using Plots.plot function in Julia 1.7.3.
When drawing the line plot, Julia displays a weird line that goes from an end of the line to the other across the plane as above. There is a strange…

Young
- 25
- 4