Home > Mobile >  Trouble plotting inequalities and controlling linetype and color/pattern of fill
Trouble plotting inequalities and controlling linetype and color/pattern of fill

Time:11-30

As part of a larger project in which VBA creates worksheets using excel data and a word template I am learning gnuplot which VBA will also control.

I am trying to plot 2 functions in the same graph and shade a side. I would like for the function lines to be black or be able to specify. I would also like to specify whether the line is solid or dashed. I have sent a picture of the desired result produced through another program which is not open source so I can't control it. And I sent my best code yet. I am gratefu for any help.

I have searched the web and gnuplot documentation but nothing addresses this. `

reset session
set grid ls 100 lc black
set grid x,y back
set style fill transparent solid 0.1
set xzeroaxis linetype 3 linewidth 2.5
set yzeroaxis linetype 3 linewidth 2.5
set xrange [-10:10]
set yrange [-10:10]

f(x) = -2*x 7
g(x) = (0.6)*x-2

plot f(x) w filledcurves x1 lc "white", \
     f(x) w filledcurves x2 lc "green", \
     f(x) w l, \
     g(x) w filledcurves x1 lc "yellow", \
     g(x) w filledcurves x2 lc "white", \
            g(x) w l

Desired result

enter image description here

Result

enter image description here

I tried the code sent above and made a lot of progress but still lacking the control over color and fill

enter image description here

enter image description here

Addition: (pattern overlay)

Unfortunately, fill patterns in gnuplot are enter image description here

  • Related