Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #1424 > unrolled thread
| Started by | Fab <fab4100@gmail.com> |
|---|---|
| First post | 2012-10-23 22:03 +0200 |
| Last post | 2013-04-23 14:07 -0700 |
| Articles | 9 — 4 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
user defined xtics and mxtics Fab <fab4100@gmail.com> - 2012-10-23 22:03 +0200
Re: user defined xtics and mxtics sfeam <sfeam@users.sourceforge.net> - 2012-10-23 15:02 -0700
Re: user defined xtics and mxtics Fab <fab4100@gmail.com> - 2012-10-24 07:15 +0200
Re: user defined xtics and mxtics sfeam <sfeam@users.sourceforge.net> - 2012-10-23 23:05 -0700
Re: user defined xtics and mxtics Fab <fab4100@gmail.com> - 2012-10-24 13:16 +0200
Re: user defined xtics and mxtics Ingo Thies <ingo.thies@gmx.de> - 2012-10-24 22:24 +0200
Re: user defined xtics and mxtics sfeam <sfeam@users.sourceforge.net> - 2012-10-24 17:23 -0700
Re: user defined xtics and mxtics Cristian Camilo Mejia <cc.mejia@gmail.com> - 2013-04-23 14:04 -0700
Re: user defined xtics and mxtics Cristian Camilo Mejia <cc.mejia@gmail.com> - 2013-04-23 14:07 -0700
| From | Fab <fab4100@gmail.com> |
|---|---|
| Date | 2012-10-23 22:03 +0200 |
| Subject | user defined xtics and mxtics |
| Message-ID | <87ehkpez2g.fsf@panzer.v.cablecom.net> |
Dear All I read in the Gnuplot info's, that when I define my own xtics, I can not use mxtics, which makes sense. However, especially in LaTeX terminals, it is sometimes needed to redefine the axis label (actually only the label and not the tics). Is it somehow possible to define xtics and mxtics the usual way but then change only the axis label, leaving the tics as they are? E.g., in Matlab you have two arrays defining the tics, one with the numeric data and the other with the label strings. Thanks! Fab
[toc] | [next] | [standalone]
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Date | 2012-10-23 15:02 -0700 |
| Message-ID | <k6745r$gub$1@dont-email.me> |
| In reply to | #1424 |
Fab wrote:
> Dear All
>
> I read in the Gnuplot info's, that when I define my own xtics, I can not
> use mxtics, which makes sense.
That's not quite right. You can define both tics and mtics manually.
But you cannot define tics and have the program insert mtics automatically
between them.
> However, especially in LaTeX terminals,
> it is sometimes needed to redefine the axis label (actually only the
> label and not the tics). Is it somehow possible to define xtics and
> mxtics the usual way but then change only the axis label, leaving the
> tics as they are?
Certainly.
set xtics ("One" 1, "Two" 2, "Three" 3)
set xlabel "My favorite label"
But maybe you are asking something else?
For LaTeX output you often want to set a LaTeX format for the tic labels:
set xtics format "$%g$"
> E.g., in Matlab you have two arrays defining the
> tics, one with the numeric data and the other with the label strings.
That is also possible, so long as both arrays can be read from the
same file:
plot <my-real-plot>, 'labeldata' using 1:xticlabels(2)
where the file labeldata contains
1 "One"
2 "Two"
3 "Three"
...
[toc] | [prev] | [next] | [standalone]
| From | Fab <fab4100@gmail.com> |
|---|---|
| Date | 2012-10-24 07:15 +0200 |
| Message-ID | <87r4ooh2mf.fsf@lagrange.campus.intern> |
| In reply to | #1425 |
sfeam <sfeam@users.sourceforge.net> writes:
> Fab wrote:
>
>> Dear All
>>
>> I read in the Gnuplot info's, that when I define my own xtics, I can not
>> use mxtics, which makes sense.
>
> That's not quite right. You can define both tics and mtics manually.
> But you cannot define tics and have the program insert mtics automatically
> between them.
>
Indeed, I was not precise here!
>> However, especially in LaTeX terminals,
>> it is sometimes needed to redefine the axis label (actually only the
>> label and not the tics). Is it somehow possible to define xtics and
>> mxtics the usual way but then change only the axis label, leaving the
>> tics as they are?
>
> Certainly.
> set xtics ("One" 1, "Two" 2, "Three" 3)
> set xlabel "My favorite label"
>
> But maybe you are asking something else?
> For LaTeX output you often want to set a LaTeX format for the tic labels:
> set xtics format "$%g$"
>
My problem is the following: I have a plot with log x-axis. When I use
the format specifier for scientific notation, LaTeX will typeset this as
such (with the e-01, etc. notation). However, I would like to have xtic
labels like $10^{-1}$, hence I set them manually. But, for a log plot I
would also like the minor xtics to indicate the scale between the
decades. But I can not use xmtics in this case. Do I also have to
create an array for the minor xtics? I would like to have the xmtics
with half the ticlength of the major xtics. How would you do it?
>> E.g., in Matlab you have two arrays defining the
>> tics, one with the numeric data and the other with the label strings.
>
> That is also possible, so long as both arrays can be read from the
> same file:
>
> plot <my-real-plot>, 'labeldata' using 1:xticlabels(2)
>
> where the file labeldata contains
> 1 "One"
> 2 "Two"
> 3 "Three"
> ...
Thanks for this input!
Regards,
Fab
[toc] | [prev] | [next] | [standalone]
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Date | 2012-10-23 23:05 -0700 |
| Message-ID | <k680el$j00$1@dont-email.me> |
| In reply to | #1426 |
Fab wrote:
> sfeam <sfeam@users.sourceforge.net> writes:
>
>> Fab wrote:
>>
>>> Dear All
>>>
>>> I read in the Gnuplot info's, that when I define my own xtics, I can
>>> not use mxtics, which makes sense.
>>
>> That's not quite right. You can define both tics and mtics manually.
>> But you cannot define tics and have the program insert mtics
>> automatically between them.
>>
> Indeed, I was not precise here!
>
>>> However, especially in LaTeX terminals,
>>> it is sometimes needed to redefine the axis label (actually only the
>>> label and not the tics). Is it somehow possible to define xtics and
>>> mxtics the usual way but then change only the axis label, leaving
>>> the tics as they are?
>>
>> Certainly.
>> set xtics ("One" 1, "Two" 2, "Three" 3)
>> set xlabel "My favorite label"
>>
>> But maybe you are asking something else?
>> For LaTeX output you often want to set a LaTeX format for the tic
>> labels:
>> set xtics format "$%g$"
>>
> My problem is the following: I have a plot with log x-axis. When I
> use the format specifier for scientific notation, LaTeX will typeset
> this as
> such (with the e-01, etc. notation). However, I would like to have
> xtic labels like $10^{-1}$
set format '$ %.2t10^{%T}$'
> , hence I set them manually. But, for a log plot
> I would also like the minor xtics to indicate the scale between the
> decades. But I can not use xmtics in this case. Do I also have to
> create an array for the minor xtics? I would like to have the xmtics
> with half the ticlength of the major xtics. How would you do it?
set tics scale 1.0, 0.5
[toc] | [prev] | [next] | [standalone]
| From | Fab <fab4100@gmail.com> |
|---|---|
| Date | 2012-10-24 13:16 +0200 |
| Message-ID | <87mwzcglxh.fsf@lagrange.campus.intern> |
| In reply to | #1427 |
sfeam <sfeam@users.sourceforge.net> writes:
> Fab wrote:
>
>> sfeam <sfeam@users.sourceforge.net> writes:
>>
>>> Fab wrote:
>>>
>>>> Dear All
>>>>
>>>> I read in the Gnuplot info's, that when I define my own xtics, I can
>>>> not use mxtics, which makes sense.
>>>
>>> That's not quite right. You can define both tics and mtics manually.
>>> But you cannot define tics and have the program insert mtics
>>> automatically between them.
>>>
>> Indeed, I was not precise here!
>>
>>>> However, especially in LaTeX terminals,
>>>> it is sometimes needed to redefine the axis label (actually only the
>>>> label and not the tics). Is it somehow possible to define xtics and
>>>> mxtics the usual way but then change only the axis label, leaving
>>>> the tics as they are?
>>>
>>> Certainly.
>>> set xtics ("One" 1, "Two" 2, "Three" 3)
>>> set xlabel "My favorite label"
>>>
>>> But maybe you are asking something else?
>>> For LaTeX output you often want to set a LaTeX format for the tic
>>> labels:
>>> set xtics format "$%g$"
>>>
>> My problem is the following: I have a plot with log x-axis. When I
>> use the format specifier for scientific notation, LaTeX will typeset
>> this as
>> such (with the e-01, etc. notation). However, I would like to have
>> xtic labels like $10^{-1}$
>
> set format '$ %.2t10^{%T}$'
>
>> , hence I set them manually. But, for a log plot
>> I would also like the minor xtics to indicate the scale between the
>> decades. But I can not use xmtics in this case. Do I also have to
>> create an array for the minor xtics? I would like to have the xmtics
>> with half the ticlength of the major xtics. How would you do it?
>
> set tics scale 1.0, 0.5
>
elegant! Thanks
Best,
Fab
[toc] | [prev] | [next] | [standalone]
| From | Ingo Thies <ingo.thies@gmx.de> |
|---|---|
| Date | 2012-10-24 22:24 +0200 |
| Message-ID | <aer14mFa2tlU1@mid.individual.net> |
| In reply to | #1425 |
sfeam wrote:
> That's not quite right. You can define both tics and mtics manually.
> But you cannot define tics and have the program insert mtics automatically
> between them.
Does gnuplot now really support manually defined tics and mtics?
> Certainly.
> set xtics ("One" 1, "Two" 2, "Three" 3)
So, how do you define the manual mtics here? As far as I remember, this
has not been possible until recently (unless you use arrows for this, of
course).
Best wishes,
Ingo
[toc] | [prev] | [next] | [standalone]
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Date | 2012-10-24 17:23 -0700 |
| Message-ID | <k6a0qf$lj0$1@dont-email.me> |
| In reply to | #1429 |
Ingo Thies wrote:
> sfeam wrote:
>
>> That's not quite right. You can define both tics and mtics manually.
>> But you cannot define tics and have the program insert mtics
>> automatically between them.
>
> Does gnuplot now really support manually defined tics and mtics?
>
So far as I know it has always been possible to define minor tics.
However, no associated text label is drawn for the minor tics.
> So, how do you define the manual mtics here? As far as I remember, this
> has not been possible until recently (unless you use arrows for this, of
> course).
Labeled major tics at 0, 0.5, 1.0, unlabeled minor tics at 0.25 and 0.75:
set xtics ("Zero" 0 0, "Half" 0.5 0, "One" 1.0 0, 0.25 1, 0.75 1)
The form for each tic is ("Label" <position> <level>)
where level 0 is major tic, and 1 is minor tic.
Both the label and the level are optional.
Levels > 1 are currently treated exactly the same as level=1
(label is not printed, minor tic is drawn) but in the future may have
some different treatment.
Ethan
>
> Best wishes,
> Ingo
[toc] | [prev] | [next] | [standalone]
| From | Cristian Camilo Mejia <cc.mejia@gmail.com> |
|---|---|
| Date | 2013-04-23 14:04 -0700 |
| Message-ID | <94530192-c3b7-4743-8d4f-64e97275093f@googlegroups.com> |
| In reply to | #1424 |
On Tuesday, October 23, 2012 5:03:14 PM UTC-3, Fab wrote: > Dear All > > > > I read in the Gnuplot info's, that when I define my own xtics, I can not > > use mxtics, which makes sense. However, especially in LaTeX terminals, > > it is sometimes needed to redefine the axis label (actually only the > > label and not the tics). Is it somehow possible to define xtics and > > mxtics the usual way but then change only the axis label, leaving the > > tics as they are? E.g., in Matlab you have two arrays defining the > > tics, one with the numeric data and the other with the label strings. > > > > Thanks! > > Fab
[toc] | [prev] | [next] | [standalone]
| From | Cristian Camilo Mejia <cc.mejia@gmail.com> |
|---|---|
| Date | 2013-04-23 14:07 -0700 |
| Message-ID | <ffc81335-94d6-4e70-8064-0a790cede0b0@googlegroups.com> |
| In reply to | #1424 |
Dear all,
I can't show the minor tics with the following script; however if I comment the lines for xtics and ytics the minor tics appears without problem.
Thanks in advance for any help,
Crist.
set term postscript eps color enhanced font "Times-Roman" 23
set output "matrix.eps"
set palette defined (\
1 '#0025ad', \
2 '#0042ad', \
3 '#0060ad', \
4 '#007cad', \
5 '#0099ad', \
6 '#00ada4', \
7 '#00ad88', \
8 '#00ad6b', \
9 '#00ad4e', \
10 '#00ad31', \
11 '#00ad14', \
12 '#09ad00' \
)
set pm3d map
#set pm3d interpolate 2,2
##############
set mxtics 4
set mytics 3
set xtics ("8.36" 0,"8.389" 30, "8.42" 60) font "Times-Roman, 23"
set ytics ("1" 0,"0.75" 25,"0.5" 50,"0.25" 75, "0" 100) font "Times-Roman, 23"
set cbtics ("1" -0.0316022150218487,"0.5" -0.0316060110926628,"0" -0.0316098071634769)font "Times-Roman, 23"
#############
set xlabel 'P' offset 0,0 font "Times-Italic,23" left rotate by 0
set ylabel 'X_{cm}' offset 0,0 font "Times-Italic,23" left rotate by 0
splot 'myfile.txt' matrix
#print 'Maximum = ',GPVAL_DATA_Z_MAX
#print 'Minimum = ',GPVAL_DATA_Z_MIN
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web