0
$\begingroup$

I have generated a graphic using ListDensityPlot in Mathematica, I want to make following three edits to it, but not finding a way. Would be thankful for any advice.

  1. How to rotate the graphic. My graphic is triangular in shape, I want to orient it in a fixed direction. How to make a particular corner to be at top, which can be identified with its Cartesian coordinates (say, by (0, 0)) ?

  2. I want a fixed range to be shown by the false color scale to represent different colors on graphic. I am not able to do so as irrespective of the range I choose for PlotLegends, the scale shows only the range which is available on graphic. For example if the graphic has area having the plotted variable varying between 0 to 5, no matter what range i choose for PlotLegends->, false color scale only shows the colors representing the values 0-5 only. How to change it ?

  3. Instead of leveling the three axes, I want to level the three edges with their coordinates (with no frame). How to achieve it ?

Here is the example for the truncated triangle.

XX1={{0.,0.,2},{0.149508,0.076178,7},{0.153488,0.0498713,7},{0.155716,0.0246631,4},{0.156435,0.,4},{0.302952,0.0984348,7},{0.307539,0.0487095,7},{0.309017,0.,4},{0.444473,0.144418,7},{0.451668,0.0715374,7},{0.453991,0.,4},{0.574342,0.186615,8},{0.584501,0.0925761,7},{0.587786,0.,4},{0.689152,0.223919,8},{0.702713,0.111299,7},{0.707107,0.,4}}; ListContourPlot[XX1,PlotLegends->{0, 1, 2, 3, 4, 5, 6, 7, 8},ColorFunction->"AvocadoColors"] 

Will appreciate any help.

$\endgroup$
4
  • $\begingroup$ Can you provide the code you are using and some visuals explaining the desired result? $\endgroup$ Commented Oct 11, 2019 at 1:49
  • $\begingroup$ I have added a small example in the original post. $\endgroup$ Commented Oct 11, 2019 at 4:16
  • $\begingroup$ Still not clear to me what you are trying to achieve. For 1. and 3. maybe this? ListContourPlot[XX1, PlotLegends -> {0, 1, 2, 3, 4, 5, 6, 7, 8}, ColorFunction -> "AvocadoColors", ScalingFunctions -> {Identity, "Reverse"}, PlotRangePadding -> None] $\endgroup$ Commented Oct 11, 2019 at 4:29
  • $\begingroup$ Thanks. For point 2, the false color scale is having colors for 2-8. What I want is 0-8, even if there is no points in the list corresponding to 0. $\endgroup$ Commented Oct 11, 2019 at 4:45

1 Answer 1

1
$\begingroup$

Update

BarLegend inside plot area.

ListContourPlot[XX1, PlotLegends -> Placed[BarLegend[{"AvocadoColors", {0, 8}}, LegendLayout -> "Row", LegendMarkerSize -> 200], {.28, .06}], ColorFunction -> "AvocadoColors", ScalingFunctions -> {Identity, "Reverse"}, PlotRangePadding -> None] 

enter image description here

For 1.

ScalingFunctions -> {Identity, "Reverse"} 

For 2.

PlotLegends -> BarLegend[{"AvocadoColors", {0, 8}}] 

For 3.

PlotRangePadding -> None ListContourPlot[XX1, PlotLegends -> BarLegend[{"AvocadoColors", {0, 8}}], ColorFunction -> "AvocadoColors", ScalingFunctions -> {Identity, "Reverse"}, PlotRangePadding -> None] 

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks a lot ! Though I have one more question. How to move the Legend Bar on the free area on the left (within the graphic area) with a decrease in size (so that it can fit into the free triangular space). I could find the method to put it at top/bottom/left/right, but not within the graphic. $\endgroup$ Commented Oct 12, 2019 at 11:07
  • $\begingroup$ @user49535 If this answer is acceptable, please consider upvoting and accepting it. If it is not, please explain why. $\endgroup$ Commented Oct 16, 2019 at 13:55

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.