From: Thomas S. <t.s...@fz...> - 2009-11-16 08:12:34
|
redefine xtics with empty labels for the 2nd plot ... set multiplot ## First plot from bottom------------------------------------ set size SX,SY set origin OX,OY set xtics ("M5.0" 1.00000, "M6.0" 2.00000, "M7.0" 3.0, "M8.0" 4.0, "M9.0" 5.0) set xlabel "Spectral Type" plot sin(x) ## Second plot from bottom------------------------------------ set origin OX,PY+OY unset xlabel set xtics ("" 1.00000, "" 2.00000, "" 3.0, "" 4.0, "" 5.0) plot cos(x) ... Trillianx wrote: > > Hello Thomas, > > Thanks for your script. It worked wonderfully. The final thing I need is > to change the xtics to alphabets. For this beside xtics in the" first plot > from bottom", I type the following: > > set xtics ("M5.0" 1.00000, "M6.0" 2.00000, "M7.0" 3.0, "M8.0" 4.0, "M9.0" > 5.0) > > However when I do that the formatting changes again as you can see from > the screenshot. The set x2tics works well but not the xtics. Why is that? > And how can you rectify it? Here is the code again: > > > reset > #set terminal postscript eps monochrome "Times-Roman" 10 > #set output "data.eps" > #set size 1.4,1.4 > ##----Setting small tics > set mytics > set mxtics > unset key > > ##--Setting y-range for all plots > #set yrange[0.5:7] > set xrange[0:6] > > ## Setting ylabels for all plots > set ylabel "EW (A)" > > ##Defining variables > SX = 0.5; SY = 0.2 > OX = 0.05; OY = 0.05 > NX = 1; NY = 3 > #set ytics 0.0,2,7 > set xtics 0.0,1,6 > ## define and then unset x2tics for later use > set x2tics 0.0,1,6 > unset x2tics > PY = 0.198 > > ##Setting margins > set bmargin OX; set tmargin OX; set lmargin OY; set rmargin OY > set size SX*NX+OX*1.5, SY*NY+OY*1.8 > > ## reserve some space for x- and y-labels by shifting > ## the plots a little bit > OX=1.7*OX > OY=1.5*OY > > set multiplot > ## First plot from bottom------------------------------------ > set size SX,SY > set origin OX,OY > set xtics > set xtics ("M5.0" 1.00000, "M6.0" 2.00000, "M7.0" 3.0, "M8.0" 4.0, "M9.0" > 5.0) > set ytics 0.0,2,7 > set yrange[0.5:7] > set xlabel "Spectral Type" > plot "order65.dat" > > ## Second plot from bottom------------------------------------ > set origin OX,PY+OY > unset xlabel > set yrange[0.5:10] > set ytics 0.0,2,10 > set xtics format "" > plot "order65_2.dat" > > ## Third plot from bottom------------------------------------- > set origin OX,PY*2 + OY > set yrange[0:6] > set ytics 0.0,2,6 > plot "order61.dat" > > ## Fourth plot from bottom------------------------------------ > set origin OX,PY*3 + OY > ## switch x2tics on > set x2tics ("M5.0" 1.00000, "M6.0" 2.00000, "M7.0" 3.0, "M8.0" 4.0, "M9.0" > 5.0) > set yrange[0.5:5] > set ytics 0.0,2,5 > plot "order61_2.dat" > unset multiplot > > > http://old.nabble.com/file/p26363853/screen-capture.jpg > > > Thomas Sefzick wrote: >> >> have a look at this script: >> >> reset >> >> ##----Setting small tics >> set mytics >> set mxtics >> unset key >> >> ##--Setting y-range for all plots >> set yrange[0:1] >> >> ## Setting ylabels for all plots >> set ylabel "EW (A)" >> >> ##Defining variables >> SX = 0.9; SY = 0.2 >> OX = 0.05; OY = 0.05 >> NX = 1; NY = 3 >> set ytics -0.6,0.2,0.8 >> set xtics -10.0,2,10 >> ## define and then unset x2tics for later use >> set x2tics -10.0,2,10 >> unset x2tics >> PY = 0.198 >> >> ##Setting margins >> set bmargin OX; set tmargin OX; set lmargin OY; set rmargin OY >> set size SX*NX+OX*1.5, SY*NY+OY*1.8 >> >> ## reserve some space for x- and y-labels by shifting >> ## the plots a little bit >> OX=1.7*OX >> OY=1.5*OY >> >> set multiplot >> ## First plot from bottom------------------------------------ >> set size SX,SY >> set origin OX,OY >> set xtics >> set xlabel "Spectral Type" >> plot sin(x) >> >> ## Second plot from bottom------------------------------------ >> set origin OX,PY+OY >> unset xlabel >> set xtics format "" >> plot cos(x) >> >> ## Third plot from bottom------------------------------------- >> set origin OX,PY*2 + OY >> plot tan(x) >> >> ## Fourth plot from bottom------------------------------------ >> set origin OX,PY*3 + OY >> ## switch x2tics on >> set x2tics >> plot sin(x)*exp(x) >> unset multiplot >> >> >> Trillianx wrote: >>> >>> Sorry, in my previous post I am able to get solutions for question (1) >>> and (2). However I cannot find an answer to Question (3). Thus please >>> ONLY address question (3). Which is: >>> >>> 3. I would like to have the xtics to appear for all plots but the >>> numbers ONLY for the bottom plot. How do I make it happen? >>> >>> Thanks! >>> >>> Trillian. >>> >>> >>> Trillianx wrote: >>>> >>>> I have been using the multiplot function in gnuplot to recreate the >>>> plot from my first post. I am using gnuplot 4-2.5, However I have few >>>> problems ( Please scroll down to see the attached plot. >>>> >>>> 1. The ylabel does not work for all plots. Where should I position the >>>> ylabel? >>>> 2. I would like to have the xlabel ONLY for the bottom plot. Where do I >>>> place the xlabel? Positioning as you can see in the code does not work. >>>> 3. I would like to have the xtics to appear for all plots but the >>>> numbers ONLY for the bottom plot. How do I make it happen? >>>> >>>> ##----Setting small tics >>>> set mytics >>>> set mxtics >>>> unset key >>>> >>>> ##--Setting y-range for all plots >>>> set yrange[0:1] >>>> >>>> ## Setting ylabels for all plots >>>> set ylabel "EW (A)" >>>> >>>> ##Defining variables >>>> SX = 0.9; SY = 0.2 >>>> OX = 0.05; OY = 0.05 >>>> NX = 1; NY = 3 >>>> set ytic -0.6,0.2,0.8 >>>> set xtic -10.0,2,10 >>>> PY = 0.198 >>>> >>>> ##Setting margins >>>> set bmargin OX; set tmargin OX; set lmargin OY; set rmargin OY >>>> set size SX*NX+OX*1.5, SY*NY+OY*1.8 >>>> >>>> set multiplot >>>> ## First plot from bottom------------------------------------ >>>> set size SX,SY >>>> set origin OX,OY >>>> set xtics >>>> set xlabel "Spectral Type" >>>> plot sin(x) >>>> >>>> ## Second plot from bottom------------------------------------ >>>> set origin OX,PY+OY >>>> unset xlabel >>>> unset xtics >>>> plot cos(x) >>>> >>>> ## Third plot from bottom------------------------------------- >>>> set origin OX,PY*2 + OY >>>> plot tan(x) >>>> >>>> ## Fourth plot from bottom------------------------------------ >>>> set origin OX,PY*3 + OY >>>> plot sin(x)*exp(x) >>>> unset multiplot >>>> >>>> Thank you so much!! >>>> >>>> Rohit >>>> >>>> http://old.nabble.com/file/p26351939/screen-capture-1.jpg >>>> >>>> Trillianx wrote: >>>>> >>>>> I am not sure how to describe this but I would like to create plots >>>>> that look like those in the attached figure. How do you create these? >>>>> Please note that this is just on plot with many subplots. >>>>> >>>>> I know the basics of GNUPLOT but I am not sure how to put the plots >>>>> together as shown in the attached figure. So please just tell me how >>>>> to stack them one top of the other. >>>>> >>>>> Thank you so much !! >>>>> http://old.nabble.com/file/p26230858/screen-capture-1.jpg >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > -- View this message in context: http://old.nabble.com/Getting-more-plots-on-one%21-tp26230858p26368147.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |