7

I tried

 plot [][1:3] 'word-based.txt' using 1:xtic(2) with line    

it draws the required graph but with horizontal direction of x-axis labels which is texts as

shown in picture. How to make its direction vertically so i can be read more easily.

i used windows terminal .fig

Edit:

Data used

2.02            economic
2.04            education
1.94            sports
2.01            culture
2.07            artandmusic
1.93            political
1.94            articles
1.83            press
1.86            novel1
1.86            novel2
1.85            novel3
1.85            shortstories
1.76            literature
1.60            history
1.81            bookcollection1
1.77            bookcollection2
khaled
  • 1,435

1 Answers1

13

You need to use

set xtics rotate

You can also

set xtics rotate by <angle>

Code

#!/usr/bin/env gnuplot

set terminal pngcairo
set output 'test.png'

set xtics rotate # crucial line

plot [][1:3] '-' using 1:xtic(2) with line   
2.02 economic
2.04 education
1.94 sports
2.01 culture
2.07 artandmusic
1.93 political
1.94 articles
1.83 press
1.86 novel1
1.86 novel2
1.85 novel3
1.85 shortstories
1.76 literature
1.60 history
1.81 bookcollection1
1.77 bookcollection2

Output

enter image description here

Henri Menke
  • 109,596