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

Because of the problem described in BarLegend can't make spaced contours when contours number>11BarLegend can't make spaced contours when contours number>11, I decided to brew my homemade spaced-contours-barlegend. After some trials I get something like this(combined with Row[{plapla, code-below}]):

ContourPlot[y, {x, 0, .2}, {y, 0, 1}, ColorFunctionScaling -> False, 
ColorFunction -> (Blend[{Purple, Blue, Green, Orange, Red, 
  Red}, #] &), Contours -> 17, PlotRangePadding -> 0, 
Frame -> True, Axes -> False, 
FrameTicks -> {{None, {#, 180*# + 60, {0, 0.6}} & /@ 
 Range[0, 1, 2/18]}, {None, None}}, 
FrameTicksStyle -> Directive[Thick, 20], 
FrameStyle -> Directive[Thick], AspectRatio -> 16, ImageSize -> 80]

which produce:

enter image description here

It looks OK at a glance, but I noticed that there is slightly disalignment between the contours and the frame ticks. Why is this happening? How can I avoid it?

Because of the problem described in BarLegend can't make spaced contours when contours number>11, I decided to brew my homemade spaced-contours-barlegend. After some trials I get something like this(combined with Row[{plapla, code-below}]):

ContourPlot[y, {x, 0, .2}, {y, 0, 1}, ColorFunctionScaling -> False, 
ColorFunction -> (Blend[{Purple, Blue, Green, Orange, Red, 
  Red}, #] &), Contours -> 17, PlotRangePadding -> 0, 
Frame -> True, Axes -> False, 
FrameTicks -> {{None, {#, 180*# + 60, {0, 0.6}} & /@ 
 Range[0, 1, 2/18]}, {None, None}}, 
FrameTicksStyle -> Directive[Thick, 20], 
FrameStyle -> Directive[Thick], AspectRatio -> 16, ImageSize -> 80]

which produce:

enter image description here

It looks OK at a glance, but I noticed that there is slightly disalignment between the contours and the frame ticks. Why is this happening? How can I avoid it?

Because of the problem described in BarLegend can't make spaced contours when contours number>11, I decided to brew my homemade spaced-contours-barlegend. After some trials I get something like this(combined with Row[{plapla, code-below}]):

ContourPlot[y, {x, 0, .2}, {y, 0, 1}, ColorFunctionScaling -> False, 
ColorFunction -> (Blend[{Purple, Blue, Green, Orange, Red, 
  Red}, #] &), Contours -> 17, PlotRangePadding -> 0, 
Frame -> True, Axes -> False, 
FrameTicks -> {{None, {#, 180*# + 60, {0, 0.6}} & /@ 
 Range[0, 1, 2/18]}, {None, None}}, 
FrameTicksStyle -> Directive[Thick, 20], 
FrameStyle -> Directive[Thick], AspectRatio -> 16, ImageSize -> 80]

which produce:

enter image description here

It looks OK at a glance, but I noticed that there is slightly disalignment between the contours and the frame ticks. Why is this happening? How can I avoid it?

Made English more idiomatic
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

contours Contours aren't aligned with frameticksframe ticks in ContourPlot-homemade Barlegend

due toBecause of the problem described in BarLegend can't make spaced contours when contours number>11  ,I I decided to brew my homemade spaced-contours-barlegend. After some trials I get something like this(combined with Row[{plapla,codebelow code-below}]):

ContourPlot[y, {x, 0, .2}, {y, 0, 1}, ColorFunctionScaling -> False, 
ColorFunction -> (Blend[{Purple, Blue, Green, Orange, Red, 
  Red}, #] &), Contours -> 17, PlotRangePadding -> 0, 
Frame -> True, Axes -> False, 
FrameTicks -> {{None, {#, 180*# + 60, {0, 0.6}} & /@ 
 Range[0, 1, 2/18]}, {None, None}}, 
FrameTicksStyle -> Directive[Thick, 20], 
FrameStyle -> Directive[Thick], AspectRatio -> 16, ImageSize -> 80]

which produce:

enter image description here

itIt looks OK at a glance, but I noticed that there is slightly disalignment between Contoursthe contours and FrameTicksthe frame ticks. Why is this happen and how tohappening? How can I avoid it?

contours aren't aligned with frameticks in ContourPlot-homemade Barlegend

due to the problem BarLegend can't make spaced contours when contours number>11  ,I decided to brew my homemade spaced-contours-barlegend. After some trials I get something like this(combined with Row[{plapla,codebelow}]):

ContourPlot[y, {x, 0, .2}, {y, 0, 1}, ColorFunctionScaling -> False, 
ColorFunction -> (Blend[{Purple, Blue, Green, Orange, Red, 
  Red}, #] &), Contours -> 17, PlotRangePadding -> 0, 
Frame -> True, Axes -> False, 
FrameTicks -> {{None, {#, 180*# + 60, {0, 0.6}} & /@ 
 Range[0, 1, 2/18]}, {None, None}}, 
FrameTicksStyle -> Directive[Thick, 20], 
FrameStyle -> Directive[Thick], AspectRatio -> 16, ImageSize -> 80]

which produce:

enter image description here

it looks OK but I noticed that there is slightly disalignment between Contours and FrameTicks. Why this happen and how to avoid it?

Contours aren't aligned with frame ticks in ContourPlot

Because of the problem described in BarLegend can't make spaced contours when contours number>11, I decided to brew my homemade spaced-contours-barlegend. After some trials I get something like this(combined with Row[{plapla, code-below}]):

ContourPlot[y, {x, 0, .2}, {y, 0, 1}, ColorFunctionScaling -> False, 
ColorFunction -> (Blend[{Purple, Blue, Green, Orange, Red, 
  Red}, #] &), Contours -> 17, PlotRangePadding -> 0, 
Frame -> True, Axes -> False, 
FrameTicks -> {{None, {#, 180*# + 60, {0, 0.6}} & /@ 
 Range[0, 1, 2/18]}, {None, None}}, 
FrameTicksStyle -> Directive[Thick, 20], 
FrameStyle -> Directive[Thick], AspectRatio -> 16, ImageSize -> 80]

which produce:

enter image description here

It looks OK at a glance, but I noticed that there is slightly disalignment between the contours and the frame ticks. Why is this happening? How can I avoid it?

Source Link
Harry
  • 2.7k
  • 15
  • 28

contours aren't aligned with frameticks in ContourPlot-homemade Barlegend

due to the problem BarLegend can't make spaced contours when contours number>11 ,I decided to brew my homemade spaced-contours-barlegend. After some trials I get something like this(combined with Row[{plapla,codebelow}]):

ContourPlot[y, {x, 0, .2}, {y, 0, 1}, ColorFunctionScaling -> False, 
ColorFunction -> (Blend[{Purple, Blue, Green, Orange, Red, 
  Red}, #] &), Contours -> 17, PlotRangePadding -> 0, 
Frame -> True, Axes -> False, 
FrameTicks -> {{None, {#, 180*# + 60, {0, 0.6}} & /@ 
 Range[0, 1, 2/18]}, {None, None}}, 
FrameTicksStyle -> Directive[Thick, 20], 
FrameStyle -> Directive[Thick], AspectRatio -> 16, ImageSize -> 80]

which produce:

enter image description here

it looks OK but I noticed that there is slightly disalignment between Contours and FrameTicks. Why this happen and how to avoid it?