Resetting xtics ytics gnuplot - gnuplot

Is there any way to reset or to use the default settings for xtics (or ytics) after I've already used a custom setting?
I need something like that:
set ytics 0.005 nomirror
set y2tics 5 nomirror
plot 'dummy' u 1:2 axes x1y1, dummy2 u 1:2 axes x1y2
##Another plot with "normal" axes
set ytics default (this command doesn't exist but this is what I need)
set y2tics default
plot 'dummy3' u 1:2
So if that command would actually exist, that would solve my problem because what I have now is that the second plot is using, of course, the ytics defined for the previous one. And I don't want to use the reset option because I don't want to define everything again in my script.
Thank you very much!

You could put reset before your second plot. But it will reset everything and might be an overkill for you.
You can also use set ytics auto. It might be better.
Best,

From gnuplot help:
The defaults are border mirror norotate for tics on the x and y axes, and
border nomirror norotate for tics on the x2 and y2 axes.
So, your commands should be:
set ytics border mirror norotate autofreq
set y2tics border nomirror norotate autofreq

Use:
unset ytics
from http://www.gnuplot.info/docs_4.2/node295.html
The tics may be turned off with the unset xtics command

Related

Gnuplot: removing or moving tics at the border of graph with autoscaled tics

I'm trying to add an empty boundary around the data in an autoscaled graph without having tics in the empty boundary or at the border.
$ gnuplot -p -e "set offsets 0,0,0.1,0.1; plot sin(x)"
Desired result
Tics are gone at the y-axis border/in the empty boundary
set offsets 0,0,0.25,0.25
set yrange noextend
plot sin(x)
There is also the possibility to approach this quite differently, which may or may not be appropriate for your case.
set border 2
set ytics rangelimited
set xtics axis
set tics nomirror
set xzeroaxis
set offsets 0.,0.,.25,.25
plot sin(x)
Most likely you are looking for set autoscale noextend, check help noextend. You can give the offset also in graph coordinates to be independent of the actual y-scale, check help offsets.
Script:
### autoscale noextend
reset session
set autoscale noextend
set offsets 0,0, graph 0.1, graph 0.1
plot sin(x)
### end of script
Result:

How to label "xtics" at every second points?

Hi I am plotting a graph with Gnuplot and using below command.
set xrange [0:20]
set xtics 0,0.5
The graph and scale are correct as I wanted. But I would like to label only integer points (e.g. 0,1,2,3,4...,20) but I still want to keep tics at every 0.5 interval.
How can I command for that?
thanks
Minor tics are set with set mxtics:
set xrange [0:20]
set xtics 0,1
set mxtics 2
This plots a single minor tic between two labelled major tics.
If minor and major tics should have the same size use
set xtics scale 1,1

Can Gnuplot put Two y-axis on the left hand side of a plot?

I'm trying to create a plot which has two independent y-axes on the left hand side, i.e. sharing the same x-axis. Is this possible in Gnuplot? I'm aware that it can be done with python for example.
You can just do the plot on gnuplot's standard x1y1 and x1y2 axes, and then add the extra axis with multiplot.
This example here is not perfect, but should give you an idea how to do it. As Christoph said, it's a bit fiddly:
set multiplot
set lmargin at scr 0.2
set bmargin at scr 0.1 # fix bottom margin
set y2range [0:20]
plot x, 2*x axes x1y2 # this is your actual plot
set lmargin at scr 0.1
set yrange [0:20] # set yrange to the same as y2 in the first plot
set border 2 # switch off all borders except the left
unset xtics # switch off the stray xtics
plot -1000 notitle # plot something outside of the y(2)range
unset multi

gnuplot: how to make x y axis without xtics and ytics

I am using gnuplot to draw something.
And by default there will be tics on the axis, but I don't need these tics. How to remove them?
I search some manual about the usage of set xtics, but did not find any clue.
Just issue the command unset xtics and unset ytics to remove tics from both x and y axis.

Limit the number of ytics and keep mytics when using logscale

This question is somewhat similar to Limit the number of ytics while using automatic ytics placement but doesn't get answered in that thread.
I used the following code to generate my graph gnuplot:
set yrange[.125:512]
set logscale y 2
set ytics 2
set mytics 16
set grid mytics ytics
set key off
plot '20131019_square.log' using 2:xticlabels(1) with linespoints linestyle 2
resulting in graph_1. (post it in comment because this is my first post <10 rep)
I find the ytics somewhat dense, so I change set ytics 2 to set ytics 8
resulting in graph_2
In this second graph the spacing is fine, but mytics behaves incorrect (I need logspacing) and the tics numbering I really want to use is (.03125,0.125,.5,2,8,32,128,512) what I can obtain using set ytics to (.03125,0.125,.5,2,8,32,128,512)
resulting in graph_3
Everything is correct in the last one, but I'll lose my minor ytics. (This is normal behavior for gnuplot, but I would like to get the tics of this graph_3.)
Any ideas on how to get graph_3 with mytics?
You can have minor tics only for automatically generated major tics like you get with:
set ytics 0.03125,4
With logscale set, the increment (here 4) is treated as a multiplier for the starting value (here 0.03125).
A full, minimal script would then be
set logscale y 2
set yrange[0.03125:512]
set ytics 0.03125,4
set mytics
set xrange[0:10]
plot x

Resources