Commit 36d81ce95eb11689ffd27fbcde43f8047de9b383
1 parent
c1dc7841
made CMC linear in minimalist mode
Showing
1 changed file
with
5 additions
and
3 deletions
openbr/core/plot.cpp
| ... | ... | @@ -467,6 +467,8 @@ bool Plot(const QStringList &files, const br::File &destination, bool show) |
| 467 | 467 | { |
| 468 | 468 | qDebug("Plotting %d file(s) to %s", files.size(), qPrintable(destination)); |
| 469 | 469 | |
| 470 | + const bool minimalist = destination.getBool("minimalist"); | |
| 471 | + | |
| 470 | 472 | RPlot p(files, destination); |
| 471 | 473 | |
| 472 | 474 | p.file.write(qPrintable(QString("qplot(X, 1-Y, data=DET%1").arg((p.major.smooth || p.minor.smooth) ? ", geom=\"smooth\", method=loess, level=0.99" : ", geom=\"line\"") + |
| ... | ... | @@ -496,11 +498,11 @@ bool Plot(const QStringList &files, const br::File &destination, bool show) |
| 496 | 498 | QString("\nggsave(\"%1\")\n\n").arg(p.subfile("SD")))); |
| 497 | 499 | |
| 498 | 500 | p.file.write(qPrintable(QString("ggplot(CMC, aes(x=X, y=Y%1%2)) + xlab(\"Rank\") + ylab(\"Retrieval Rate\")").arg(p.major.size > 1 ? QString(" ,colour=factor(%1)").arg(p.major.header) : QString(), p.minor.size > 1 ? QString(", linetype=factor(%1)").arg(p.minor.header) : QString()) + |
| 499 | - ((p.major.smooth || p.minor.smooth) ? (destination.getBool("minimalist") ? " + stat_summary(geom=\"line\", fun.y=mean)" : " + stat_summary(geom=\"line\", fun.y=min, aes(linetype=\"Min/Max\")) + stat_summary(geom=\"line\", fun.y=max, aes(linetype=\"Min/Max\")) + stat_summary(geom=\"line\", fun.y=mean, aes(linetype=\"Mean\")) + scale_linetype_manual(\"Legend\", values=c(\"Mean\"=1, \"Min/Max\"=2))") : " + geom_line()") + | |
| 500 | - QString(" + theme_minimal() + scale_x_log10(labels=c(1,5,10,50,100), breaks=c(1,5,10,50,100)) + annotation_logticks(sides=\"b\")") + | |
| 501 | + ((p.major.smooth || p.minor.smooth) ? (minimalist ? " + stat_summary(geom=\"line\", fun.y=mean)" : " + stat_summary(geom=\"line\", fun.y=min, aes(linetype=\"Min/Max\")) + stat_summary(geom=\"line\", fun.y=max, aes(linetype=\"Min/Max\")) + stat_summary(geom=\"line\", fun.y=mean, aes(linetype=\"Mean\")) + scale_linetype_manual(\"Legend\", values=c(\"Mean\"=1, \"Min/Max\"=2))") : " + geom_line()") + | |
| 502 | + (minimalist ? "" : "+ scale_x_log10(labels=c(1,5,10,50,100), breaks=c(1,5,10,50,100)) + annotation_logticks(sides=\"b\")") + | |
| 501 | 503 | (p.major.size > 1 ? getScale("colour", p.major.header, p.major.size) : QString()) + |
| 502 | 504 | (p.minor.size > 1 ? QString(" + scale_linetype_discrete(\"%1\")").arg(p.minor.header) : QString()) + |
| 503 | - QString(" + scale_y_continuous(labels=percent)") + | |
| 505 | + QString(" + theme_minimal() + scale_y_continuous(labels=percent)") + | |
| 504 | 506 | QString("\nggsave(\"%1\")\n\n").arg(p.subfile("CMC")))); |
| 505 | 507 | |
| 506 | 508 | p.file.write(qPrintable(QString("qplot(factor(%1)%2, data=BC, %3").arg(p.major.smooth ? (p.minor.header.isEmpty() ? "Algorithm" : p.minor.header) : p.major.header, (p.major.smooth || p.minor.smooth) ? ", Y" : "", (p.major.smooth || p.minor.smooth) ? "geom=\"boxplot\"" : "geom=\"bar\", position=\"dodge\", weight=Y") + | ... | ... |