<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hi Hagen,</div><div>  I just tested your example and I get similar behaviou using an NVIDIA Video card, OpenGL2,  VS2015 and the VTK Master.</div><div> </div><div>I can zoom in and, at some point the line disappears, but zooming out immediately restores the line.</div><div><br></div><div>It seeme to me that once a certain zoom level is reached the line is not drawn, however zooming out restores it.</div><div><br></div><div>Attached are two pngs showing the effect.When the line disappears it should still be visible as the scales on the axes have only changed slightly.</div><div><br></div><div>Andrew</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">---------- Forwarded message ----------<br>From: "Hagen Mölle" <<a href="mailto:h.moelle@googlemail.com">h.moelle@googlemail.com</a>><br>To: <a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>Cc: <br>Date: Mon, 25 Jul 2016 10:14:21 +0200<br>Subject: [vtk-developers] vtkChartXY lines not visible when using logarithmic x axis<br>Hi,<br>
<br>
Due to spam reasons the bug tracker's user login is disabled right now. One should send bug reports to the vtk's user mailing list, which I did twice. My bug report was totally ignored. That's why I send it here again. Hopefully someone can finally create a ticket in the bug tracker. Thanks.<br>
<br>
I want to report a bug for vtkChartXY. So I already send this Email two days ago to the vtkUsers mailing list without receiving any answer. The bug is not visible in the vtk bug tracker too. Thus I send the Email again.<br>
<br>
Bug environment:<br>
a) I am using VTK 6.2. I checked my test code on machines running Windows 7 (Visual Studio 2012/2015) and Ubuntu 15.10/Ubuntu 16.04 (gcc). On all these systems the bug is visible.<br>
b) I can also reproduce the bug in VTK 7.0 (here I used an Ubuntu 16.04 machine and compiled VTK 7.0 using OpenGL2 interface).<br>
<br>
Bug description:<br>
<br>
I am using vtkChartXY to display one line. I also enabled logarithmic x axis (chartXY->GetAxis(vtkAxis::BOTTOM)->SetLogScale(true);). Nothing more special. In the compiled application I start zooming into the chart using the mouse wheel, making sure I always have a line displayed in the view. At some zoom level this line just disappears. At the zoom level the line disappears I did the following:<br>
<br>
1. Zooming more into the chart the line will not appear again.<br>
2. Zooming out twice (with mouse wheel) the line will reappear.<br>
<br>
How to reproduce the bug:<br>
<br>
I basically used the LinePlot example for vtkChartXY (see <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot</a>).<br>
<br>
I added one line to the example code marked with *** (line was added after line 54 in example code).<br>
I added the full code to the end of the Email.<br>
---------------<br>
<br>
// Add multiple line plots, setting the colors etc<br>
    vtkSmartPointer<vtkChartXY >  chart= vtkSmartPointer<vtkChartXY >::New(); *** chart.Get()->GetAxis(vtkAxis::BOTTOM)->SetLogScale(true); view->GetScene()->AddItem(chart);<br>
<br>
---------------<br>
<br>
Compile and execute the program. See my bug description above to visualize the bug.<br>
<br>
<br>
Please contact me if you need more information. I can also provide images of the bug if needed.<br>
I hope the bug can be fixed.<br>
<br>
Hagen.<br>
<br>
<br>
<br>
<br>
#include <vtkVersion.h><br>
#include <vtkRenderer.h><br>
#include <vtkRenderWindowInteractor.h><br>
#include <vtkRenderWindow.h><br>
#include <vtkSmartPointer.h><br>
#include <vtkChartXY.h><br>
#include <vtkAxis.h><br>
#include <vtkTable.h><br>
#include <vtkPlot.h><br>
#include <vtkFloatArray.h><br>
#include <vtkContextView.h><br>
#include <vtkContextScene.h><br>
#include <vtkPen.h><br>
<br>
int main(int, char *[])<br>
{<br>
    // Create a table with some points in it<br>
    vtkSmartPointer<vtkTable> table =<br>
      vtkSmartPointer<vtkTable>::New();<br>
<br>
    vtkSmartPointer<vtkFloatArray> arrX =<br>
      vtkSmartPointer<vtkFloatArray>::New();<br>
    arrX->SetName("X Axis");<br>
    table->AddColumn(arrX);<br>
<br>
    vtkSmartPointer<vtkFloatArray> arrC =<br>
      vtkSmartPointer<vtkFloatArray>::New();<br>
    arrC->SetName("Cosine");<br>
    table->AddColumn(arrC);<br>
<br>
    vtkSmartPointer<vtkFloatArray> arrS =<br>
      vtkSmartPointer<vtkFloatArray>::New();<br>
    arrS->SetName("Sine");<br>
    table->AddColumn(arrS);<br>
<br>
    // Fill in the table with some example values<br>
    int numPoints = 69;<br>
    float inc = 7.5 / (numPoints-1);<br>
    table->SetNumberOfRows(numPoints);<br>
    for (int i = 0; i < numPoints; ++i)<br>
    {<br>
      table->SetValue(i, 0, i * inc);<br>
      table->SetValue(i, 1, cos(i * inc));<br>
      table->SetValue(i, 2, sin(i * inc));<br>
    }<br>
<br>
    // Set up the view<br>
    vtkSmartPointer<vtkContextView> view =<br>
      vtkSmartPointer<vtkContextView>::New();<br>
    view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);<br>
<br>
    // Add multiple line plots, setting the colors etc<br>
    vtkSmartPointer<vtkChartXY> chart =<br>
      vtkSmartPointer<vtkChartXY>::New();<br>
    chart.Get()->GetAxis(vtkAxis::BOTTOM)->SetLogScale(true);<br>
    view->GetScene()->AddItem(chart);<br>
    vtkPlot *line = chart->AddPlot(vtkChart::LINE);<br>
#if VTK_MAJOR_VERSION <= 5<br>
    line->SetInput(table, 0, 1);<br>
#else<br>
    line->SetInputData(table, 0, 1);<br>
#endif<br>
    line->SetColor(0, 255, 0, 255);<br>
    line->SetWidth(1.0);<br>
    line = chart->AddPlot(vtkChart::LINE);<br>
#if VTK_MAJOR_VERSION <= 5<br>
    line->SetInput(table, 0, 2);<br>
#else<br>
    line->SetInputData(table, 0, 2);<br>
#endif<br>
    line->SetColor(255, 0, 0, 255);<br>
    line->SetWidth(5.0);<br>
<br>
    // For dotted line, the line type can be from 2 to 5 for different dash/dot<br>
    // patterns (see enum in vtkPen containing DASH_LINE, value 2):<br>
#ifndef WIN32<br>
    line->GetPen()->SetLineType(vtkPen::DASH_LINE);<br>
#endif<br>
    // (ifdef-ed out on Windows because DASH_LINE does not work on Windows<br>
    //  machines with built-in Intel HD graphics card...)<br>
<br>
    //view->GetRenderWindow()->SetMultiSamples(0);<br>
<br>
    // Start interactor<br>
    view->GetInteractor()->Initialize();<br>
    view->GetInteractor()->Start();<br>
<br>
    return EXIT_SUCCESS;<br>
}<br>
<br>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________</div>
</div></div>