How do I remove the standard series label in gnuplot [duplicate] - gnuplot

Essentially, the problem that I am experiencing is that the legend overlaps the gnuplot graph that I am trying to plot as illustrated in the following diagram.
Following is the command that I am using to plot the data.
> set log y
> plot "datafile1.txt" using 2:4 with lines,
"datafile1.txt" using 2:6 with lines,
"datafile2.txt" using 2:4 with lines,
"datafile2.txt" using 2:6 with lines
Following is a portion of the data file 1 I am using to plot the data.
Dimension: 259 Timing: 36111 seconds, 9 seconds
Dimension: 260 Timing: 37860 seconds, 9 seconds
Dimension: 261 Timing: 39477 seconds, 6 seconds
Dimension: 262 Timing: 41215 seconds, 5 seconds
Dimension: 263 Timing: 41827 seconds, 5 seconds
Dimension: 264 Timing: 42738 seconds, 11 seconds
Dimension: 265 Timing: 42972 seconds, 14 seconds
Dimension: 266 Timing: 44138 seconds, 10 seconds
Dimension: 267 Timing: 45210 seconds, 11 seconds
Dimension: 268 Timing: 46508 seconds, 9 seconds
Dimension: 269 Timing: 51120 seconds, 15 seconds
Dimension: 270 Timing: 49352 seconds, 6 seconds
Dimension: 271 Timing: 50456 seconds, 9 seconds
Dimension: 272 Timing: 52379 seconds, 16 seconds
Dimension: 273 Timing: 52354 seconds, 16 seconds
Following is a portion of the data file 2 I am using to plot the data.
Dimension: 269 Timing: 32507 seconds, 2 seconds
Dimension: 270 Timing: 33064 seconds, 4 seconds
Dimension: 271 Timing: 33590 seconds, 6 seconds
Dimension: 272 Timing: 33703 seconds, 3 seconds
Dimension: 273 Timing: 34616 seconds, 3 seconds
Dimension: 274 Timing: 36113 seconds, 4 seconds
Dimension: 275 Timing: 36477 seconds, 4 seconds
Dimension: 276 Timing: 37000 seconds, 2 seconds
Dimension: 277 Timing: 37872 seconds, 3 seconds
Dimension: 278 Timing: 42290 seconds, 6 seconds
Dimension: 279 Timing: 39862 seconds, 7 seconds
Dimension: 280 Timing: 40184 seconds, 7 seconds
Dimension: 281 Timing: 41229 seconds, 4 seconds
Dimension: 282 Timing: 43221 seconds, 3 seconds
Dimension: 283 Timing: 42706 seconds, 7 seconds
Any help or advice on how to overcome this would be appreciated.

If you want to turn it off altogether:
gnuplot> set nokey
If you want to move the legend, you can do this with
gnuplot> set key left top
to move it to the top left. If you want to give the lines more meaningful names in the legend, use the title keyword when generating the plot:
gnuplot> plot "datafile1.txt" using 2:4 with lines title "data",
....

You could move the legend outside the plotting area, then they definitely wouldn't overlap:
gnuplot> set key outside
See here for many more options regarding the placement of the legend or key:
http://gnuplot.sourceforge.net/docs_4.2/node192.html

You can control location of the key by providing a set of coordinates:
set key at 25., 5000.
These values correspond to the data coordinate system. Alternatively, you can specify graph coordinates:
set key at graph 0.1, 0.9
(close to top-left position).

With the gnuplot version 5.2 and maybe later, you can use
set key at x, y
where x and y are the values for the x-axis and y-axis respectively

Related

Excel diagram with time value or number on category ax

I need to make a diagram which shows the lines of different ceramic firing schedules. I want them to be plotted in one diagram and they need to be plotted in time-relative ax. It needs to show the different durations in a right way. I don't seem to be able to achieve this.
What I have is the following:
First table:
Pendelen
Temp. per uur
Stooktemp.
Stooktijd 4
Stooktijd Cum.4
95
120
1:15:47
1,26
205
537
2:02:03
3,30
80
620
1:02:15
4,33
150
1075
3:02:00
7,37
50
1196
2:25:12
9,79
10
1196
0:10:00
9,95
Total
9:57:17
Second table:
Pendelen
Temp. per uur
Stooktemp.
Stooktijd 5
Stooktijd Cum.5
140
540
3:51:26
3,86
65
650
1:41:32
5,55
140
1095
3:10:43
8,73
50
1222
2:32:24
11,27
Total
11:16:05
The lines to be shown in a diagram should represent the 'stooktijd cum.' for both programs 4 and 5 (which is a cumulation of the time needed to fire up the kiln from it's previous temp. in the schedule). One should be able to see in the diagram that program 5 takes more time to reach it's endtemp.
What I achieved is nothing more than a diagram with two lines, but only plotted in the 'stooktijd cum.4' points from program 4. The image shows a screenshot of this diagram.
But as you can see, this doesn't look like program 5 takes more time to reach it's end. I would like it to show something like this:
Create this table :
p4
p5
0
10
3.86
540
5.55
650
8.73
1095
11.27
1222
0
0
1.26
120
3.3
537
4.33
620
7.37
1075
9.79
1196
9.95
1196
Select all > F11 > Design > Chg Chart type > scatter with straight line and marker
Here's my tryout :
Please share if it works/not. ( :

How to calculate confidence intervals for crude survival rates?

Let's assume that we have a survfit object as follows.
fit = survfit(Surv(data$time_12m, data$status_12m) ~ data$group)
fit
Call: survfit(formula = Surv(data$time_12m, data$status_12m) ~ data$group)
n events median 0.95LCL 0.95UCL
data$group=HF 10000 3534 NA NA NA
data$group=IGT 70 20 NA NA NA
fit object does not show CI-s. How to calculate confidence intervals for the survival rates? Which R packages and code should be used?
The print result of survfit gives confidnce intervals by group for median survivla time. I'm guessing the NA's for the estimates of median times is occurring because your groups are not having enough events to actually get to a median survival. You should show the output of plot(fit) to see whether my guess is correct.
You might try to plot the KM curves, noting that the plot.survfit function does have a confidence interval option constructed around proportions:
plot(fit, conf.int=0.95, col=1:2)
Please read ?summary.survfit. It is the class of generic summary functions which are typically used by package authors to deliver the parameter estimates and confidence intervals. There you will see that it is not "rates" which are summarized by summary.survfit, but rather estimates of survival proportion. These proportions can either be medians (in which case the estimate is on the time scale) or they can be estimates at particular times (and in that instance the estimates are of proportions.)
If you actually do want rates then use a functions designed for that sort of model, perhaps using ?survreg. Compare what you get from using survreg versus survfit on the supplied dataset ovarian:
> reg.fit <- survreg( Surv(futime, fustat)~rx, data=ovarian)
> summary(reg.fit)
Call:
survreg(formula = Surv(futime, fustat) ~ rx, data = ovarian)
Value Std. Error z p
(Intercept) 6.265 0.778 8.05 8.3e-16
rx 0.559 0.529 1.06 0.29
Log(scale) -0.121 0.251 -0.48 0.63
Scale= 0.886
Weibull distribution
Loglik(model)= -97.4 Loglik(intercept only)= -98
Chisq= 1.18 on 1 degrees of freedom, p= 0.28
Number of Newton-Raphson Iterations: 5
n= 26
#-------------
> fit <- survfit( Surv(futime, fustat)~rx, data=ovarian)
> summary(fit)
Call: survfit(formula = Surv(futime, fustat) ~ rx, data = ovarian)
rx=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
59 13 1 0.923 0.0739 0.789 1.000
115 12 1 0.846 0.1001 0.671 1.000
156 11 1 0.769 0.1169 0.571 1.000
268 10 1 0.692 0.1280 0.482 0.995
329 9 1 0.615 0.1349 0.400 0.946
431 8 1 0.538 0.1383 0.326 0.891
638 5 1 0.431 0.1467 0.221 0.840
rx=2
time n.risk n.event survival std.err lower 95% CI upper 95% CI
353 13 1 0.923 0.0739 0.789 1.000
365 12 1 0.846 0.1001 0.671 1.000
464 9 1 0.752 0.1256 0.542 1.000
475 8 1 0.658 0.1407 0.433 1.000
563 7 1 0.564 0.1488 0.336 0.946
Might have been easier if I had used "exponential" instead of "weibull" as the distribution type. Exponential fits have a single parameter that is estimated and are more easily back-transformed to give estimates of rates.
Note: I answered an earlier question about survfit, although the request was for survival times rather than for rates. Extract survival probabilities in Survfit by groups

How to add uncertainty to tics in gnuplot?

I'm trying to plot some experimental data using gnuplot and I need to include data uncertainty in tics' labels. I've figured out that I can manually change every label to "200.0" from "200", but I'm almost sure that there is an easier method. I do hope for your help. :)
Your question is a bit unclear. I understand it like this
$data <<EOD
120 20 250 30
160 20 190 40
200 30 300 23
280 15 260 15
340 25 190 40
EOD
plot $data us 1:3:4:xtic(sprintf("%.1f +/- %.1f", $1, $2)) w err pt 7
See help xticlabel (in contrast to xtics).

Missing Date xticks on chart for matplotlib on Python 3. Bug?

I am following this section, I realize this code was made using Python 2 but they have xticks showing on the 'Start Date' axis and I do not. My chart only shows Start Date and no dates are provided. I have attempted to convert the object to datetime but that shows the dates and breaks the graph below it and the line is missing:
Graph
# Set as_index=False to keep the 0,1,2,... index. Then we'll take the mean of the polls on that day.
poll_df = poll_df.groupby(['Start Date'],as_index=False).mean()
# Let's go ahead and see what this looks like
poll_df.head()
Start Date Number of Observations Obama Romney Undecided Difference
0 2009-03-13 1403 44 44 12 0.00
1 2009-04-17 686 50 39 11 0.11
2 2009-05-14 1000 53 35 12 0.18
3 2009-06-12 638 48 40 12 0.08
4 2009-07-15 577 49 40 11 0.09
Great! Now plotting the Difference versus time should be straight forward.
# Plotting the difference in polls between Obama and Romney
fig = poll_df.plot('Start Date','Difference',figsize=(12,4),marker='o',linestyle='-',color='purple')
Notebook is here

Screen resolution 1024px or 960px? [duplicate]

This question already has answers here:
Why width 960px?
(7 answers)
Closed 8 years ago.
Back in the day we use to design website with resolution:
1024px(width) by 768px(height)
but to avoid getting scrollbar from appearing from both sides we use a slightly smaller resolution, may be:
1000px(width) by 620px(height)---rectify me if I'm wrong on this one
but my main concern is how did 960 grid system comes to place? I know it is good for laying out contents accordingly within the 960px grid, but if so why not just use 1000px instead? Since it is mostly use size during that time?
The reasoning is like this:
1024 x 768 was a common resolution at which designs were aimed.
Subtract 24px for the scroll bar - 1000px;
960px leaves additional breathing room and importantly - has many more factors (division) than 1000px. 960 is therefore the ideal choice for a grid system.
Here are the factors:
960
1 2 3 4 5 6 8 10 12 15 16 20 24 30 32 40 48 60 64
80 96 120 160 192 240 320 480 960
1000
1 2 4 5 8 10 20 25 40 50 100 125 200 250 500 1000
Credit to the answers on this post: Why width 960px?

Resources