Martin7
Martin7

Reputation: 105

Gnuplot skewed data

I have skewed data and I try to plot contour and color map of my data. The picture below show the data without range constaint. enter image description here

I want to only plot the data in the xrange [0.55:0.95] and the yrange [0:10]. My issue is that I have triangles of color map outside the plot range. See picture below.

enter image description here

My code is the following :

#reset session

FILE = "data_sensibilite_correlation_Tpfr_CH"

set contour
set cntrparam level discrete 0.5, 1, 1.5, 2, 2.5, 3

set xrange [0:10]
set yrange [0.55:0.95]
set cbrange [0:4]
set table $Contour
    splot FILE u 1:2:3
unset table

set style textbox opaque
unset key
set view
#set xrange [0:10]
#set yrange [0.55:0.95]
set cbrange [0:4]
set xlabel "{/Symbol e}_{/Symbol q} [%]"
set ylabel "T_b / T_{w hs}"
set cblabel "{/Symbol e}_{{/Symbol F} hs} [%]"
plot FILE u 1:2:3 w image, \
     $Contour u 1:2 index 1::1 w l lc "red", \
     '' u 1:2:3 index 1::1 every ::0::0 w labels boxed
### end of code

My data are available here : https://filesender.renater.fr/?s=download&token=6eadae73-9f7c-4983-90ca-5406ac8796bb.

I tried to modify my data in order to keep only points in the desired range but the data is, then, no more a grid data and I don't succeed to plot contour in that case.

May someone explain me how to plot the data in the wished range without having triangles outside the range ?

Thank you very much, Martin

Upvotes: 1

Views: 246

Answers (1)

Ethan
Ethan

Reputation: 15093

This answer requires the most recent gnuplot release, version 5.4.1

Instead of plot ... with image, use splot ... with pm3d. Here is a modified script and the corresponding output.

set contour base
set cntrparam level discrete 0.5, 1, 1.5, 2, 2.5, 3
set cntrlabel onecolor interval 40

set xrange [0:10]
set yrange [0.55:0.95]
set cbrange [0:4]

set style textbox opaque
unset key
set view map
set xlabel "{/Symbol e}_{/Symbol q} [%]"
set ylabel "T_b / T_{w hs}"
set cblabel "{/Symbol e}_{{/Symbol F} hs} [%]"

set pm3d noborder

splot FILE u 1:2:3 w pm3d, \
      FILE u 1:2:3 w l lc "red" nosurface, \
      FILE with labels boxed

enter image description here

Upvotes: 1

Related Questions