added example image for JKQTPCoordinateAxisStyle::tickLabelAngle

This commit is contained in:
jkriege2 2023-08-22 17:34:50 +02:00
parent 22d8bdd674
commit af29fa4ffa
10 changed files with 55 additions and 1 deletions

View File

@ -131,6 +131,14 @@ if(JKQtPlotter_BUILD_TOOLS)
) )
add_dependencies(JKQTPlotter_GenerateDocImages JKQTPlotter_GenerateDocImages_listaxisstyleprops) add_dependencies(JKQTPlotter_GenerateDocImages JKQTPlotter_GenerateDocImages_listaxisstyleprops)
add_custom_target(JKQTPlotter_GenerateDocImages_listaxisticklabelangles
COMMENT "Building JKQTPlotter Documentation Images: listaxisticklabelangles"
COMMAND ${JKQTPlotter_GenerateDocImages_COMMAND} --listaxisticklabelangles --background=lightgrey --iconsize=50 --outputdir="${JKQTPlotter_GenerateDocImages_OutputDir}/axisstyle/"
WORKING_DIRECTORY ${JKQtPlotter_QT_BINDIR}
DEPENDS jkqtplotter_doc_imagegenerator
)
add_dependencies(JKQTPlotter_GenerateDocImages JKQTPlotter_GenerateDocImages_listaxisticklabelangles)
add_custom_target(JKQTPlotter_GenerateDocImages_liststyles add_custom_target(JKQTPlotter_GenerateDocImages_liststyles
COMMENT "Building JKQTPlotter Documentation Images: liststyles" COMMENT "Building JKQTPlotter Documentation Images: liststyles"
COMMAND ${JKQTPlotter_GenerateDocImages_COMMAND} --liststyles --iconsize=1200 --outputdir="${JKQTPlotter_GenerateDocImages_OutputDir}/styles/" --doctomodify="${JKQTPlotter_GenerateDocImages_dox}/jkqtplotter_styling.dox" COMMAND ${JKQTPlotter_GenerateDocImages_COMMAND} --liststyles --iconsize=1200 --outputdir="${JKQTPlotter_GenerateDocImages_OutputDir}/styles/" --doctomodify="${JKQTPlotter_GenerateDocImages_dox}/jkqtplotter_styling.dox"

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -206,7 +206,19 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxisStyle {
double tickLabelDistance; double tickLabelDistance;
/** \brief distance between tick label and axis label in pt */ /** \brief distance between tick label and axis label in pt */
double labelDistance; double labelDistance;
/** \brief rotation angle of tick labels [-180..180], i.e. given in degrees, default is 0 (horizontal) */ /** \brief rotation angle of tick labels [-180..180], i.e. given in degrees, default is 0 (horizontal)
*
* These images show some example rotations:
*
* \image html axisstyle/JKQTPCoordinateAxisTickLabelAngle-75Degree.png
* \image html axisstyle/JKQTPCoordinateAxisTickLabelAngle-45Degree.png
* \image html axisstyle/JKQTPCoordinateAxisTickLabelAngle-15Degree.png
* \image html axisstyle/JKQTPCoordinateAxisTickLabelAngle0Degree.png
* \image html axisstyle/JKQTPCoordinateAxisTickLabelAngle15Degree.png
* \image html axisstyle/JKQTPCoordinateAxisTickLabelAngle45Degree.png
* \image html axisstyle/JKQTPCoordinateAxisTickLabelAngle75Degree.png
*
*/
double tickLabelAngle; double tickLabelAngle;
/** \brief styling of the major/primary grid */ /** \brief styling of the major/primary grid */

View File

@ -409,6 +409,36 @@ void doListAxisStyling(const QDir& outputDir, int iconsize, QColor backgroundCol
plot.grabPixelImage(QSize(plot.getWidth(),plot.getHeight()), false).copy(0,0,plot.getWidth(),plot.getHeight()).save(outputDir.absoluteFilePath("axis_unit_scaling_pi.png"), "png"); plot.grabPixelImage(QSize(plot.getWidth(),plot.getHeight()), false).copy(0,0,plot.getWidth(),plot.getHeight()).save(outputDir.absoluteFilePath("axis_unit_scaling_pi.png"), "png");
} }
void doListAxisTickLabelAngles(const QDir& outputDir, int iconsize, QColor backgroundColor) {
JKQTBasePlotter plot(true);
plot.setXY(0,1000,0,1000);
plot.setWidgetSize(iconsize*5,5*iconsize);
plot.setShowKey(false);
plot.setGrid(true);
plot.setExportBackgroundColor(QColor("lightgrey"));
plot.getXAxis()->setShowZeroAxis(false);
plot.getYAxis()->setShowZeroAxis(false);
plot.getXAxis()->setDrawMode1(JKQTPCADMLineTicksTickLabels);
plot.getXAxis()->setDrawMode2(JKQTPCADMLineTicksTickLabels);
plot.getXAxis()->setDrawGrid(false);
plot.getYAxis()->setDrawMode1(JKQTPCADMLineTicksTickLabels);
plot.getYAxis()->setDrawMode2(JKQTPCADMLineTicksTickLabels);
plot.getYAxis()->setAxisLabel("");
plot.getXAxis()->setTickLabelType(JKQTPCALTdefault);
plot.getYAxis()->setTickLabelType(JKQTPCALTdefault);
for (int angle: std::vector<int>{-75,-45,-15,0,15,45,75}) {
plot.getXAxis()->setTickLabelAngle(angle);
plot.getYAxis()->setTickLabelAngle(angle);
plot.setPlotLabel("\\alpha="+QString::number(angle)+"^\\circ");
plot.grabPixelImage(QSize(plot.getWidth(),plot.getHeight()), false).copy(0,0,plot.getWidth(),plot.getHeight()).save(outputDir.absoluteFilePath("JKQTPCoordinateAxisTickLabelAngle"+QString::number(angle)+"Degree.png"), "png");
}
}
void plotStyle(const QSettings& style, QSize examplePlotSize, const QString& examplePlotFilename, QSize samplePlotSize, const QString& samplePlotFilename ) { void plotStyle(const QSettings& style, QSize examplePlotSize, const QString& examplePlotFilename, QSize samplePlotSize, const QString& samplePlotFilename ) {
JKQTBasePlotter plotExtra(true); JKQTBasePlotter plotExtra(true);
@ -513,6 +543,8 @@ int main(int argc, char* argv[])
parser.addOption(listerrorindicatorsOption); parser.addOption(listerrorindicatorsOption);
QCommandLineOption listaxisstylepropsOption("listaxisstyleprops", "generate example images for JKQTPCALabelType and other coordinate axis properties."); QCommandLineOption listaxisstylepropsOption("listaxisstyleprops", "generate example images for JKQTPCALabelType and other coordinate axis properties.");
parser.addOption(listaxisstylepropsOption); parser.addOption(listaxisstylepropsOption);
QCommandLineOption doListAxisTickLabelAnglesOption("listaxisticklabelangles", "generate example images for coordinate axis tick labels at different angles.");
parser.addOption(doListAxisTickLabelAnglesOption);
QCommandLineOption listpalettesOption("listpalettes", "generate example images for all predefined palettes."); QCommandLineOption listpalettesOption("listpalettes", "generate example images for all predefined palettes.");
parser.addOption(listpalettesOption); parser.addOption(listpalettesOption);
QCommandLineOption liststylesOption("liststyles", "generate example images for all predefined style INI files."); QCommandLineOption liststylesOption("liststyles", "generate example images for all predefined style INI files.");
@ -530,6 +562,7 @@ int main(int argc, char* argv[])
const bool listlinedecorators=parser.isSet(listlinedecoratorsOption); const bool listlinedecorators=parser.isSet(listlinedecoratorsOption);
const bool listerrorindicators=parser.isSet(listerrorindicatorsOption); const bool listerrorindicators=parser.isSet(listerrorindicatorsOption);
const bool listaxisstyleprops=parser.isSet(listaxisstylepropsOption); const bool listaxisstyleprops=parser.isSet(listaxisstylepropsOption);
const bool dolistaxisticklabelangles=parser.isSet(doListAxisTickLabelAnglesOption);
const bool liststyles=parser.isSet(liststylesOption); const bool liststyles=parser.isSet(liststylesOption);
const int iconsize=parser.value(iconsizeOption).toInt(); const int iconsize=parser.value(iconsizeOption).toInt();
const QColor backgroundColor = jkqtp_String2QColor(parser.value(backgroundOption)); const QColor backgroundColor = jkqtp_String2QColor(parser.value(backgroundOption));
@ -540,6 +573,7 @@ int main(int argc, char* argv[])
if (listlinedecorators) doListLineDecorators(outputDir, iconsize, backgroundColor); if (listlinedecorators) doListLineDecorators(outputDir, iconsize, backgroundColor);
if (listerrorindicators) doListErrorIndicators(outputDir, iconsize, backgroundColor); if (listerrorindicators) doListErrorIndicators(outputDir, iconsize, backgroundColor);
if (listaxisstyleprops) doListAxisStyling(outputDir, iconsize, backgroundColor); if (listaxisstyleprops) doListAxisStyling(outputDir, iconsize, backgroundColor);
if (dolistaxisticklabelangles) doListAxisTickLabelAngles(outputDir, iconsize, backgroundColor);
if (liststyles) doListStyles(outputDir, doctomodify, iconsize, backgroundColor); if (liststyles) doListStyles(outputDir, doctomodify, iconsize, backgroundColor);
if (listpalettes) doListPalettes(outputDir, QSize(iconsize,qMax(5,iconsize/16))); if (listpalettes) doListPalettes(outputDir, QSize(iconsize,qMax(5,iconsize/16)));