NEW: add color palettes from Green's HELIX method, see https://arxiv.org/abs/1108.5083, see JKQTPCreateGreensCubeHelixLUT() and e.g. JKQTPMathImageCubeHelixClassic, JKQTPMathImageCubeHelix1, ...
@ -13,7 +13,6 @@ This page lists several todos and wishes for future version of JKQTPlotter
|
||||
<li>graphic elements: make coordinate systems selectable for all: x/y-axis, 0..1/0..1, topleft/topright... </li>
|
||||
<li>graphs: add OHLC charts (financial, see https://en.m.wikipedia.org/wiki/Open-high-low-close_chart)</li>
|
||||
<li>graphs: add candlestick charts (financial, see https://en.m.wikipedia.org/wiki/Candlestick_chart)</li>
|
||||
<li>graphs: add color palettes from Green's HELIX method, see <a href="https://articles.adsabs.harvard.edu/pdf/2011BASI...39..289G">https://articles.adsabs.harvard.edu/pdf/2011BASI...39..289G</a>, also see <a href="https://jiffyclub.github.io/palettable/cubehelix/">https://jiffyclub.github.io/palettable/cubehelix/</a></li>
|
||||
<li>graphs: barchart/ranges chart with (x,y1,y2) or (x1,x2,y)</li>
|
||||
<li>graphs: gant-chart as simplified vector field with (x,y1,y2) or (x1,x2,y), or (x,y,dx), (x,y,dy) ... different head/tail style</li>
|
||||
<li>graphs: matrix plots with boxes, labels, ...</li>
|
||||
@ -31,9 +30,7 @@ This page lists several todos and wishes for future version of JKQTPlotter
|
||||
<li>plot: rework layouting of legends: there are some inconsistencies/too large gaps ...</li>
|
||||
<li>sryling: better styling/more styling options for data-tooltips</li>
|
||||
<li>styling: color gradients as fill-styles in style-INIs</li>
|
||||
<li>styling: style.ini with glowing colors in dark background ("techno" or "cyberpunk")</li>
|
||||
<li>user interactions: dialog(s) to edit x/y-range</li>
|
||||
<li>user interactions: support for touch/pad gestures</li>
|
||||
<li></li>
|
||||
</ul></li>
|
||||
<li>JKQTMathText:<ul>
|
||||
|
@ -83,6 +83,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
|
||||
<li>NEW: secondary axes: added functionality to manage additional secondary axes in a JKQTPBasePlotter and to select which x-/y-Axis to use for drawing a JKQTPPlotElement</li>
|
||||
<li>NEW: You can use additional syntax derived from CCS to define colors in style.ini.files (or when using jkqtp_String2QColor() ): You can use full CSS-color syntax with functions <code>"rgb(R,G,B)"</code>, <code>"rgba(...)"</code>, <code>"hsl(...)"</code>, <code>"hsv(...)"</code>, <code>"gray(...)"</code>, <code>"green(...)"</code>, <code>"red(...)"</code>, <code>"blue(...)"</code>.</li>
|
||||
<li>NEW: several new color palettes (especially stepped/categorial palettes), e.g. JKQTPMathImageColorPalette::JKQTPMathImageOkabeIto_STEP, JKQTPMathImageColorPalette::JKQTPMathImageIBMColorBlindSafe, JKQTPMathImageColorPalette::JKQTPMathImageIBMColorBlindSafe_STEP, ...</li>
|
||||
<li>NEW: add color palettes from Green's HELIX method, see <a href="https://arxiv.org/abs/1108.5083">https://arxiv.org/abs/1108.5083</a>, also see <a href="https://jiffyclub.github.io/palettable/cubehelix/">https://jiffyclub.github.io/palettable/cubehelix/</a>, see JKQTPCreateGreensCubeHelixLUT() and e.g. JKQTPMathImageCubeHelixClassic, JKQTPMathImageCubeHelix1, ...</li>
|
||||
<li>NEW: Using Q_SIGNALS/Q_SLOTS instead of signals/slots MOC-keywords ... this allows for interoperability with other signals/slots frameworks, thanks to <a href="https://github.com/nickmontini">user:nickmontini</a> for the proposal</li>
|
||||
</ul></li>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.0 KiB |
BIN
doc/images/palettes/palette_CubeHelix1.png
Normal file
After Width: | Height: | Size: 376 B |
BIN
doc/images/palettes/palette_CubeHelix1_step.png
Normal file
After Width: | Height: | Size: 193 B |
BIN
doc/images/palettes/palette_CubeHelix2.png
Normal file
After Width: | Height: | Size: 372 B |
BIN
doc/images/palettes/palette_CubeHelix2_step.png
Normal file
After Width: | Height: | Size: 193 B |
BIN
doc/images/palettes/palette_CubeHelix3.png
Normal file
After Width: | Height: | Size: 372 B |
BIN
doc/images/palettes/palette_CubeHelix3_step.png
Normal file
After Width: | Height: | Size: 188 B |
BIN
doc/images/palettes/palette_CubeHelixClassic.png
Normal file
After Width: | Height: | Size: 391 B |
BIN
doc/images/palettes/palette_CubeHelixClassic_step.png
Normal file
After Width: | Height: | Size: 193 B |
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 211 B |
@ -59,7 +59,7 @@ QMap<int, JKQTPImageTools::LUTData > JKQTPImageTools::getDefaultLUTs() {
|
||||
|
||||
{
|
||||
const auto palette=JKQTPMathImageDefault_STEP;
|
||||
const QString palN="jkqtplotterdefault_steps";
|
||||
const QString palN="jkqtplotterdefault_step";
|
||||
const QString palNT=QObject::tr("steps: JKQTPlotter Default");
|
||||
lutstore[palette]=JKQTPImageTools::LUTData(palN, palNT);
|
||||
JKQTPPaletteList lst;
|
||||
@ -2528,7 +2528,7 @@ QMap<int, JKQTPImageTools::LUTData > JKQTPImageTools::getDefaultLUTs() {
|
||||
lutstore[palette].lut=JKQTPBuildColorPaletteLUTLinInterpolate(lst);
|
||||
{
|
||||
const auto palettei=JKQTPMathImageIBMColorBlindSafe_STEP;
|
||||
lutstore[palettei]=JKQTPImageTools::LUTData("IBMColorBlindSafe_steps", QObject::tr("steps: IBMColorBlindSafe"));
|
||||
lutstore[palettei]=JKQTPImageTools::LUTData("IBMColorBlindSafe_step", QObject::tr("steps: IBMColorBlindSafe"));
|
||||
lutstore[palettei].lut=JKQTPBuildColorPaletteLUTColorsOnlySteps(lst);
|
||||
}
|
||||
}
|
||||
@ -2547,12 +2547,21 @@ QMap<int, JKQTPImageTools::LUTData > JKQTPImageTools::getDefaultLUTs() {
|
||||
lst<<jkqtp_qRgbOpaque(0xD55E00);
|
||||
lst<<jkqtp_qRgbOpaque(0xCC79A7);
|
||||
|
||||
lutstore[JKQTPMathImageOkabeIto_STEP]=JKQTPImageTools::LUTData(JKQTPBuildColorPaletteLUTColorsOnlySteps(lst), "OkabeIto_steps", QObject::tr("steps: Okabe-Ito"));
|
||||
lutstore[JKQTPMathImageOkabeItoDarker_STEP]=JKQTPImageTools::LUTData(JKQTPModifyLUT(lutstore[JKQTPMathImageOkabeIto_STEP].lut, [](QRgb c) { return QColor(c).darker().rgb(); }), "OkabeItoDarker_steps", QObject::tr("steps: Okabe-Ito, darkened"));
|
||||
lutstore[JKQTPMathImageOkabeItoLighter_STEP]=JKQTPImageTools::LUTData(JKQTPModifyLUT(lutstore[JKQTPMathImageOkabeIto_STEP].lut, [](QRgb c) { return QColor(c).lighter().rgb(); }), "OkabeItoLighter_steps", QObject::tr("steps: Okabe-Ito, lighter"));
|
||||
lutstore[JKQTPMathImageOkabeIto_STEP]=JKQTPImageTools::LUTData(JKQTPBuildColorPaletteLUTColorsOnlySteps(lst), "OkabeIto_step", QObject::tr("steps: Okabe-Ito"));
|
||||
lutstore[JKQTPMathImageOkabeItoDarker_STEP]=JKQTPImageTools::LUTData(JKQTPModifyLUT(lutstore[JKQTPMathImageOkabeIto_STEP].lut, [](QRgb c) { return QColor(c).darker().rgb(); }), "OkabeItoDarker_step", QObject::tr("steps: Okabe-Ito, darkened"));
|
||||
lutstore[JKQTPMathImageOkabeItoLighter_STEP]=JKQTPImageTools::LUTData(JKQTPModifyLUT(lutstore[JKQTPMathImageOkabeIto_STEP].lut, [](QRgb c) { return QColor(c).lighter().rgb(); }), "OkabeItoLighter_step", QObject::tr("steps: Okabe-Ito, lighter"));
|
||||
|
||||
}
|
||||
|
||||
lutstore[JKQTPMathImageCubeHelixClassic]=JKQTPImageTools::LUTData(JKQTPCreateGreensCubeHelixLUT(0.5, -1.5, 1.0, LUTSIZE, 0.0, 1.0, 1.2, 1.2), "CubeHelixClassic", QObject::tr("CubeHelix Classic"));
|
||||
lutstore[JKQTPMathImageCubeHelixClassic_STEP]=JKQTPImageTools::LUTData(JKQTPCreateGreensCubeHelixLUT(0.5, -1.5, 1.0, JKQTPImageTools::NDEFAULTSTEPS, 0.0, 1.0, 1.2, 1.2), "CubeHelixClassic_step", QObject::tr("steps: CubeHelix Classic"));
|
||||
lutstore[JKQTPMathImageCubeHelix1]=JKQTPImageTools::LUTData(JKQTPCreateGreensCubeHelixLUT(1.5, -1.0, 1.0, LUTSIZE, 0.0, 1.0, 1.5, 1.5), "CubeHelix1", QObject::tr("CubeHelix 1"));
|
||||
lutstore[JKQTPMathImageCubeHelix1_STEP]=JKQTPImageTools::LUTData(JKQTPCreateGreensCubeHelixLUT(1.5, -1.0, 1.0, JKQTPImageTools::NDEFAULTSTEPS, 0.0, 1.0, 1.5, 1.5), "CubeHelix1_step", QObject::tr("steps: CubeHelix 1"));
|
||||
lutstore[JKQTPMathImageCubeHelix2]=JKQTPImageTools::LUTData(JKQTPCreateGreensCubeHelixLUT(2.0, -1.0, 1.0, LUTSIZE, 0.0, 1.0, 1.5, 1.5), "CubeHelix2", QObject::tr("CubeHelix 2"));
|
||||
lutstore[JKQTPMathImageCubeHelix2_STEP]=JKQTPImageTools::LUTData(JKQTPCreateGreensCubeHelixLUT(2.0, -1.0, 1.0, JKQTPImageTools::NDEFAULTSTEPS, 0.0, 1.0, 1.5, 1.5), "CubeHelix2_step", QObject::tr("steps: CubeHelix 2"));
|
||||
lutstore[JKQTPMathImageCubeHelix3]=JKQTPImageTools::LUTData(JKQTPCreateGreensCubeHelixLUT(2.0, -1.0, 1.0, LUTSIZE, 0.0, 1.0, 1.5, 1.5), "CubeHelix3", QObject::tr("CubeHelix 3"));
|
||||
lutstore[JKQTPMathImageCubeHelix3_STEP]=JKQTPImageTools::LUTData(JKQTPCreateGreensCubeHelixLUT(2.0, 1.0, 1.0, JKQTPImageTools::NDEFAULTSTEPS, 0.0, 1.0, 3.0, 3.0), "CubeHelix3_step", QObject::tr("steps: CubeHelix 3"));
|
||||
|
||||
|
||||
|
||||
return lutstore;
|
||||
@ -3201,3 +3210,22 @@ JKQTPImageTools::LUTType JKQTPModifyLUT(JKQTPImageTools::LUTType lut, std::funct
|
||||
}
|
||||
return lut;
|
||||
}
|
||||
|
||||
JKQTPImageTools::LUTType JKQTPCreateGreensCubeHelixLUT(float start, float rotation, float gamma, int lutsize, float lambda_min, float lambda_max, float saturation_min, float saturation_max)
|
||||
{
|
||||
JKQTPImageTools::LUTType res;
|
||||
for (int i=0; i<lutsize; i++) {
|
||||
const float lambda=lambda_min+static_cast<float>(i)/static_cast<float>(lutsize-1)*(lambda_max-lambda_min);
|
||||
const float sat=saturation_min+static_cast<float>(i)/static_cast<float>(lutsize-1)*(saturation_max-saturation_min);
|
||||
const float lambda_gamma=pow(lambda, gamma);
|
||||
const float phi=2.0*JKQTPSTATISTICS_PI*(start/3.0+rotation*lambda);
|
||||
const float cosphi=cos(phi);
|
||||
const float sinphi=sin(phi);
|
||||
const float amplitude=sat*lambda_gamma*(1-lambda_gamma)/2.0;
|
||||
const float R=lambda_gamma + amplitude*(-0.14861*cosphi+1.78277*sinphi);
|
||||
const float G=lambda_gamma + amplitude*(-0.29227*cosphi-0.90649*sinphi);
|
||||
const float B=lambda_gamma + amplitude*(1.972940*cosphi+0.0*sinphi);
|
||||
res<<QColor::fromRgbF(jkqtp_bounded<float>(0.0,R,1.0), jkqtp_bounded<float>(0.0,G,1.0), jkqtp_bounded<float>(0.0,B,1.0)).rgb();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -168,8 +168,40 @@ enum JKQTPMathImageColorPalette {
|
||||
JKQTPMathImageOkabeItoLighter_STEP, /*!< lighter version of JKQTPMathImageOkabeItoDarker_STEP \image html palettes/palette_OkabeItoLighter_step.png
|
||||
\note color-blind freindly!
|
||||
\see from https://yoshke.org/blog/colorblind-friendly-diagrams and M. Okabe and K. Ito, How to make figures and presentations that are friendly to color blind people, University of Tokyo, 2002. */
|
||||
JKQTPMathImageDefault_STEP, /*!< \image html palettes/palette_jkqtplotterdefault_steps.png
|
||||
This is the color cycle used to color graphs in JKQTPlotter#s default style.
|
||||
JKQTPMathImageDefault_STEP, /*!< \image html palettes/palette_jkqtplotterdefault_step.png
|
||||
This is the color cycle used to color graphs in JKQTPlotter's default style.
|
||||
*/
|
||||
JKQTPMathImageCubeHelixClassic, /*!< \image html palettes/palette_CubeHelixClassic.png
|
||||
This palette was created using Green's CubeHelix method with the parameters shown in the paper: start=0.5, rotation=-1.5, gamma=1.0, saturation=1.2.
|
||||
\see JKQTPCreateGreensCubeHelixLUT()
|
||||
*/
|
||||
JKQTPMathImageCubeHelixClassic_STEP, /*!< \image html palettes/palette_CubeHelixClassic_step.png
|
||||
This palette was created using Green's CubeHelix method with the parameters shown in the paper: start=0.5, rotation=-1.5, gamma=1.0, saturation=1.2.
|
||||
\see JKQTPCreateGreensCubeHelixLUT()
|
||||
*/
|
||||
JKQTPMathImageCubeHelix1, /*!< \image html palettes/palette_CubeHelix1.png
|
||||
This palette was created using Green's CubeHelix method with the parameters shown in the paper: start=0.5, rotation=-1.5, gamma=1.0, saturation=1.2.
|
||||
\see JKQTPCreateGreensCubeHelixLUT()
|
||||
*/
|
||||
JKQTPMathImageCubeHelix1_STEP, /*!< \image html palettes/palette_CubeHelix1_step.png
|
||||
This palette was created using Green's CubeHelix method with the parameters shown in the paper: start=0.5, rotation=-1.5, gamma=1.0, saturation=1.2.
|
||||
\see JKQTPCreateGreensCubeHelixLUT()
|
||||
*/
|
||||
JKQTPMathImageCubeHelix2, /*!< \image html palettes/palette_CubeHelix2.png
|
||||
This palette was created using Green's CubeHelix method with the parameters shown in the paper: start=0.5, rotation=-1.5, gamma=1.0, saturation=1.2.
|
||||
\see JKQTPCreateGreensCubeHelixLUT()
|
||||
*/
|
||||
JKQTPMathImageCubeHelix2_STEP, /*!< \image html palettes/palette_CubeHelix2_step.png
|
||||
This palette was created using Green's CubeHelix method with the parameters shown in the paper: start=0.5, rotation=-1.5, gamma=1.0, saturation=1.2.
|
||||
\see JKQTPCreateGreensCubeHelixLUT()
|
||||
*/
|
||||
JKQTPMathImageCubeHelix3, /*!< \image html palettes/palette_CubeHelix3.png
|
||||
This palette was created using Green's CubeHelix method with the parameters shown in the paper: start=0.5, rotation=-1.5, gamma=1.0, saturation=1.2.
|
||||
\see JKQTPCreateGreensCubeHelixLUT()
|
||||
*/
|
||||
JKQTPMathImageCubeHelix3_STEP, /*!< \image html palettes/palette_CubeHelix3_step.png
|
||||
This palette was created using Green's CubeHelix method with the parameters shown in the paper: start=0.5, rotation=-1.5, gamma=1.0, saturation=1.2.
|
||||
\see JKQTPCreateGreensCubeHelixLUT()
|
||||
*/
|
||||
|
||||
|
||||
@ -1218,6 +1250,25 @@ JKQTPImageTools::LUTType JKQTCOMMON_LIB_EXPORT JKQTPModifyLUT(JKQTPImageTools::L
|
||||
|
||||
*/
|
||||
JKQTPImageTools::LUTType JKQTCOMMON_LIB_EXPORT JKQTPModifyLUT(JKQTPImageTools::LUTType lut, std::function<QRgb(QRgb)> f);
|
||||
/*! \brief create color palettes/LUTs by using Green's CubeHelix method
|
||||
\ingroup jkqtplotter_imagelots_tools_LUTS
|
||||
|
||||
\see see Green, D. A. 2011. A colour scheme for the display of astronomical intensity images. Bull. Astr. Soc. India 39, 289-295.
|
||||
and <a href="https://articles.adsabs.harvard.edu/pdf/2011BASI...39..289G">https://articles.adsabs.harvard.edu/pdf/2011BASI...39..289G</a>
|
||||
and <a href="https://jiffyclub.github.io/palettable/cubehelix/">https://jiffyclub.github.io/palettable/cubehelix/</a>
|
||||
|
||||
\param start start-hue for the palette
|
||||
\param rotation rotation paremeter for the palette
|
||||
\param gamma optional gamma parameter
|
||||
\param lutsize number of entries in LUT
|
||||
\param lambda_min start value for the \f$ \lambda \f$ in Green's formula
|
||||
\param lambda_max end value for the \f$ \lambda \f$ in Green's formula
|
||||
\param saturation_min start value for the saturation in Green's formula, usually the saturation is a single value, then \a saturation_min == \a saturation_max!
|
||||
\param saturation_max end value for the saturation in Green's formula, usually the saturation is a single value, then \a saturation_min == \a saturation_max!
|
||||
\return the lut generated from the provided parameters with \a lutsize entries
|
||||
|
||||
*/
|
||||
JKQTPImageTools::LUTType JKQTCOMMON_LIB_EXPORT JKQTPCreateGreensCubeHelixLUT(float start, float rotation, float gamma=1.0, int lutsize=JKQTPImageTools::LUTSIZE, float lambda_min=0.0, float lambda_max=1.0, float saturation_min=1.2, float saturation_max=1.2);
|
||||
|
||||
|
||||
/** \brief describes how to modify a rendered image with a second data array \see ModifierModeToString(), StringToModifierMode(), JKQTPImageModifierModeComboBox
|
||||
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |