7

I'm reading data from a csv file in help of gnuplot. Most of the lines have 8 columns, some of them 9. Whenever there are 9 columns, I'd like to draw a vertical line (think of marking that position). Can I achieve that with gnuplot?

2
  • 2
    OK, I found a hack: Taking 0 as default value, and if there are 9 columns, use a higher value and draw that line. But is there a better solution, since the additional drawing ruins the scale of the graph... Commented Dec 21, 2010 at 14:05
  • Bruce_Warrior's answer seems to answer your question in the title. However, your explanation in the text confuses me completely and I don't understand how Born2Smile's answer's your question. What is your x-value and what is your y-value which you want to plot? Please always show some example data and graph if possible. Commented Sep 9, 2022 at 7:30

2 Answers 2

34

You could use (and suppose that my point in x-axes is 0.35, and I want for entire y-axes ):

set arrow from 0.35,graph(0,0) to 0.35,graph(1,1) nohead 

Or, if you want show this in a specific y range{ymin,ymax}

set arrow from 0.35,ymin to 0.35,ymax nohead 

If you want to customize more you can use:

set style arrow {idx:index} default set style arrow {idx:index} [ nohead | head | backhead | heads ] [ size {flt:length} [,{flt:angle}] [,{flt:backangle}] ] [ filled | empty | nofilled ] [ front | back ] [ [ linetype | lt {idx:type} ] [ linewidth | lw {int:width} ] | [ linestyle | ls {idx:style} ] ] 

For more information inside gnuplot run:

help arrow 
Sign up to request clarification or add additional context in comments.

1 Comment

Any way to auto-get ymax/ymin?
-11

simply fix the scale by setting the yrange:

set yrange [##:##]

where ## is a place holder for some number :)

Cheers,
B2S

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.