LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-01-2020, 01:03 PM   #1
gregors
Member
 
Registered: Mar 2018
Posts: 177

Rep: Reputation: Disabled
[gnuplot] Ugly labels


Hi there!

Since this question has been left unanswered for a few weeks now (in de.comp.software.graphic) I'm hoping to find someone here who can tell me what I could do to have some nicer labels on the x-axis in http://test.szaktilla.de/plot.pdf

I would like to have those long dates either rotated ~30° CCW or shortened.

Do you know how to achieve that?

TIA

Gregor

The script I'm using so far:
Code:
#!/usr/bin/gnuplot

FN = "/home/gszaktilla/.stromlog/log.txt"

set terminal postscript
set output "/tmp/plot.ps"

set xlabel "Datum"
set title FN

set timefmt "%d.%m.%y"
set xdata time

set grid

set ylabel "Zaehlerstand [kWh]"
plot FN using 1:2 notitle with lines lt 1;

set ylabel "Monatl. Verbrauch [kWh]"
set yrange [0:200]
plot FN using 1:3 notitle with lines lt 1;

#eof
And the raw data:
Code:
01.04.18, 3555, 27, 27
01.05.18, 3570, 15, 42
01.06.18, 3585, 15, 57
01.07.18, 3622, 37, 94
01.08.18, 3667, 56, 150
01.09.18, 3697, 58, 208
01.10.18, 3725, 28, 236
01.11.18, 3760, 35, 271
01.12.18, 3797, 37, 308
01.01.19, 3841, 44, 352
01.02.19, 3891, 50, 402
01.03.19, 3942, 51, 453
01.04.19, 3982, 40, 493
01.05.19, 4016, 34, 527
01.06.19, 4055, 39, 566
01.07.19, 4110, 55, 621
01.08.19, 4160, 50, 671
02.09.19, 4188, 28, 699
05.11.19, 4269, 81, 780
02.12.19, 4303, 34, 814
04.01.20, 4358, 55, 869
01.02.20, 4402, 44, 913
01.03.20, 4447, 45, 958

Last edited by gregors; 03-01-2020 at 01:06 PM.
 
Old 03-01-2020, 03:16 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
I have a graph I generate hourly of spam blocking statistics. A line graph with a tic for each hour.
The .dem file contains
Code:
set xtics nomirror rotate 1
set xtics ("1600" -22, "1700" -21, "1800" -20, "1900" -19, "2000" -18, "2100" -17, "2200" -16, "2300" -15, "2400" -14, "0100" -13, "0200" -12, "0300" -11, "0400" -10, "0500" -9, "0600" -8, "0700" -7, "0800" -6, "0900" -5, "1000" -4, "1100
" -3, "1200" -2, "1300" -1, "1400" 0, "1500" 1, "1600" 2, "1700" 3, "1800" 4, "1900" 5, "2000" 6, "2100" 7, "2200" 8, "2300" 9, "2400" 10, "0100" 11, "0200" 12, "0300" 13, "0400" 14, "0500" 15, "0600" 16, "0700" 17, "0800" 18, "0900" 19, 
"1000" 20, "1100" 21, "1200" 22, "1300" 23, "1400" 24, "1500" 25, "1600" 26, "1700" 27, "1800" 28, "1900" 29, "2000" 30, "2100" 31, "2200" 32, "2300" 33, "2400" 34, "0100" 35, "0200" 36, "0300" 37, "0400" 38, "0500" 39, "0600" 40, "0700" 
41, "0800" 42, "0900" 43, "1000" 44, "1100" 45, "1200" 46, "1300" 47)
and those time are rotated 90 degrees.

Wrote that a long time ago. Don't recall where the documentation is, but I'd probably start at gnuplot.info to find the answer to your question.

Had to peek: On page 178 here is the syntax for set tics, including that for rotation.

Enjoy!

Last edited by scasey; 03-01-2020 at 03:22 PM.
 
1 members found this post helpful.
Old 03-01-2020, 03:24 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Google, gnuplot vertical x labels
... The first hit is https://tex.stackexchange.com/questi...ly-for-gnuplot

And second hit https://timmurphy.org/2015/10/27/rot...els-in-gnuplot
-
Attached Files
File Type: txt xtics-demo-1.txt (382 Bytes, 12 views)
File Type: txt xtics-demo-2.txt (394 Bytes, 7 views)
File Type: txt xplot1.ps.txt (36.4 KB, 7 views)
File Type: txt xplot2.ps.txt (36.3 KB, 9 views)
 
1 members found this post helpful.
Old 03-01-2020, 03:36 PM   #4
gregors
Member
 
Registered: Mar 2018
Posts: 177

Original Poster
Rep: Reputation: Disabled
Great! Thank you!

Gregor
 
  


Reply

Tags
gnuplot vertical x labels



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] making a gnuplot 3d graph or gnuplot fence plot Rinndalir Programming 3 10-23-2015 01:10 PM
[SOLVED] gnuplot basic graph problem - noob to gnuplot sudowtf Linux - General 2 04-02-2015 11:00 AM
Ugly, Ugly OS selection screen still in Kubuntu and Ubuntu rusty2 Linux - Software 7 12-05-2010 04:05 PM
1. how to set labels bottom margin? 2. how to set all labels to be right to left typi dfgfdgdf General 0 03-20-2007 09:43 AM
Open Office fonts look ugly (and print ugly too) TheOneAndOnlySM Linux - Software 6 10-17-2003 07:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration