Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

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 (2964329643, 5515055150) 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!

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!

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!

added 4 characters in body; edited tags
Source Link
Karsten7
  • 27.7k
  • 5
  • 76
  • 138

To get the density plot of a function f[x,y]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]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!

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!

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!

deleted 8 characters in body
Source Link
Edmund
  • 44k
  • 3
  • 55
  • 152

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 \[Pi]π},{y,0,2 \[Pi]π},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!

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 \[Pi]},{y,0,2 \[Pi]},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!

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!

Source Link
egwene sedai
  • 2.4k
  • 17
  • 24
Loading