CMP (CustomMatPlot) component questions

Hi Everyone! :),

I’v been trying to get CMP (GitHub - franshej/CustomMatPlot: Plot library for the JUCE Framework) to display a graph that I need,
but have run into some problems…

I’ve read all the source code for the examples and documentation,
but can’t find what I’m looking for…

here’s my current (temporary) code to generate my plot graph:

PlotComponent::PlotComponent()
{
m_plot.setBounds(getLocalBounds());

// Add the plot object as a child component.
addAndMakeVisible(m_plot);

// Create some data to visulize.
std::vector<std::vector<float>> y_data;

y_data.push_back(cmp::generateUniformRandomVector(80, -1.0f, +3.0f));
y_data.push_back(cmp::generateUniformRandomVector(80, -3.0f, +3.0f));

// Setting new colours on graph one and two.
auto graph_attributes = cmp::GraphAttributeList(y_data.size());
graph_attributes[0].graph_colour = Colour(255, 203, 4);
graph_attributes[1].graph_colour = Colour(255, 51, 154);;
graph_attributes[0].marker = cmp::Marker::Type::Circle;

cmp::PlotLookAndFeel* laf = new CustomLookAndFeel();

graph_attributes[0].path_stroke_type = juce::PathStrokeType(1.0f);

m_plot.setLookAndFeel(laf);

// Plot some values.
m_plot.plot(y_data, {}, graph_attributes);

m_plot.setYTicks({ -5.f, -4.f, -3.f, -2.f, -1.f, 0.f, 1.f, 2.f, 3.f, 4.f, 5.f });

}

If you look at the attached image of my plot, you’ll see I have the following issues:

  • I enabled ticks on the Y axis and they don’t show up on the plot, only the values do. (Like in the picture “nice looking fills between graph lines” on the CMP github page.
  • how do I have the plot generate horizontal and/or vertical lines for the whole plotting area that correspond to the X numbers/labels… (like in the 2nd picture of the “some good looking sines!”
  • how can I make the circles from cmp::Marker::Type::Circle smaller ?
  • how can I move the bottom X values to the top of the graph component ?
  • how can I change the background, line and x/y text colours ?
  • Can anyone explain what the downsampling does ?
  • How can I create spline/paths instead of just linear lines between the datapoints ? (Like in the 2nd picture “some good looking sines!” on the CMP github page.

Yours help would be greatly appreciated as I’m developing an awesome, complex JUCE application and I really need a good graph plotting component…