To get the density plot of a function f[x,y]
with a bar legend, I'm using
DensityPlot[f[x,y],{x,0,2 π},{y,0,2 π},PlotLegends -> Automatic]
I'm using LinTicks[]
of SciDraw
to have the axes ticks in units of pi. I would also like to customize the ticks in the bar legend to change in units of pi. There are some questions (29643, 55150) here that are trying to solve this problem, but in order to use BarLegend[]
one needs to know the range of the function being plotted. For the function I'm plotting, the range is not easy to get analytically. Using a somewhat brute-force approach, I can sample f[x,y]
and get the min/max to use with BarLegend[]
, but I'm looking for a more elegant approach to this. How can I solve this problem? Thanks!
Comments
Post a Comment