-1

Hi I am trying to plot a figure like this:

The right side

The line is not importand, it could be a sine curve or anything like that

thanks!

lkssmr
  • 7
  • 1
  • 1
    Welcome to SO! Please do some research and provide some (not necessarily working) code (see also https://stackoverflow.com/help/how-to-ask). – Eldrad Nov 05 '21 at 17:06

2 Answers2

2

The gnuplot keyword is rangelimited

 set xtics nomirror rangelimited
 set ytics nomirror rangelimited
 set border 3       # only left + bottom
 set offset 5,5,5,5 # this much space between axes and data on all sides
 plot 'hull.dat' with points notitle

enter image description here

Ethan
  • 13,715
  • 2
  • 12
  • 21
0

I don't know if there were a feature like that. What you can do is to manually define the x and y tics, remove them from the top and right side, remove the axis all 4 sides, and then draw where you need them.

Here is an example that plots a range from x^2, and showing only the relevant axis range.

f(x) = x>2 ? ( x<4 ? x**2 : 1/0) : 1/0
set xrange [0:5]
set yrange [0:20]
set ytics 4,2,16 nomirror
set xtics 2,1,4 nomirror
unset border
set arrow from 2,0 to 4,0 nohead
set arrow from 0,4 to 0,16 nohead
p f(x)

It looks like:

A figure that shows the requested feature.

The idea was from here: http://www.phyast.pitt.edu/~zov1/

DanielTuzes
  • 2,494
  • 24
  • 40