Makie streamplot uniform log gridsize

I don’t think there’s a way to control the sampling space right now, but we should add that.

One thing you could do is evaluate the function in log-transformed space, as you already said, though your solution will be coarser the further left you go. Visually this shouldn’t be a problem, though, and there are ways to make this nicer in Makie without having to manage tick labels :slight_smile:

fig = Figure();
ax = Axis(fig[1, 1], xscale = log10)
# Some system of differential equation to plot
function mySystem(x)
	return Point2f((x[1] - 1)^2*x[2], x[2]*x[1])
end

function mySystemLogX(x)
	return Point2f(log10((x[1] - 1)^2*x[2]), x[2]*x[1])
end
	
# Add streamplot
plt = streamplot!(
	ax, 
	mySystemLogX,
	log10.((1, 10)), 
	(1, 10),
	gridsize = (20, 10),
	maxsteps = 10,
	stepsize = 0.01,
)

# Set the plot's nonlinear transform to `identity`, 
# since you've already transformed the data yourself
plt.transformation.transform_func[] = identity

# Show plot
fig

1 Like