Jump to content

Translations:Development/Tutorials/Physical Simulation/82/en: Difference between revisions

From KDE TechBase
FuzzyBot (talk | contribs)
Importing a new version from external source
 
(No difference)

Latest revision as of 17:42, 19 July 2019

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Development/Tutorials/Physical Simulation)
// For xy plot using KplotWidget
   this->xyPlot = xyPlot; //set pointer
   xyPlot->setMinimumSize( 600, 600 ); //set minimum size in pixel
   xyData = new KPlotObject( Qt::red, KPlotObject::Lines, 2 ); //the data lines are drawn in red with thickness 2
   xyPlot->setLimits(0, 100, 0, 600); //the data limits are 0 to 100 in the x-direction and 0 to 600 in the y-direction (initially we start at point 590)
   xyPlot->addPlotObject(xyData); //assign the data pointer to the graph. From now on, if the data pointer contains data, it is plotted in the graph
   xyPlot->setBackgroundColor( QColor(240, 240, 240) ); //background: light shade of gray
   xyPlot->setForegroundColor( Qt::black ); //foreground: black
   xyPlot->axis( KPlotWidget::BottomAxis )->setLabel("Time [s]"); //set x-axis labeling
   xyPlot->axis( KPlotWidget::LeftAxis )->setLabel("Position [m]");    //set y-axis labeling
}

// For xy plot using KplotWidget

   this->xyPlot = xyPlot;						//set pointer
   xyPlot->setMinimumSize( 600, 600 );					//set minimum size in pixel
   xyData = new KPlotObject( Qt::red, KPlotObject::Lines, 2 );		//the data lines are drawn in red with thickness 2
   xyPlot->setLimits(0, 100, 0, 600);					//the data limits are 0 to 100 in the x-direction and 0 to 600 in the y-direction (initially we start at point 590)
   xyPlot->addPlotObject(xyData);					//assign the data pointer to the graph. From now on, if the data pointer contains data, it is plotted in the graph
   xyPlot->setBackgroundColor( QColor(240, 240, 240) );		//background: light shade of gray
   xyPlot->setForegroundColor( Qt::black );				//foreground: black
   xyPlot->axis( KPlotWidget::BottomAxis )->setLabel("Time [s]");	//set x-axis labeling
   xyPlot->axis( KPlotWidget::LeftAxis )->setLabel("Position [m]");    //set y-axis labeling

}