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$
  • $\begingroup$ Can you provide the code you are using and some visuals explaining the desired result? $\endgroup$ – Rohit Namjoshi Oct 11 at 1:49
  • $\begingroup$ I have added a small example in the original post. $\endgroup$ – user49535 Oct 11 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$ – Rohit Namjoshi Oct 11 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$ – user49535 Oct 11 at 4:45
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$
  • $\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$ – user49535 Oct 12 at 11:07
  • $\begingroup$ @user49535 If this answer is acceptable, please consider upvoting and accepting it. If it is not, please explain why. $\endgroup$ – Rohit Namjoshi Oct 16 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.