Difference between revisions of "Debug plotting issues"

From Octave
Jump to navigation Jump to search
m
(create test script stub)
Line 39: Line 39:
  
 
* A user had problems printing with fltk in windows. After he updated the graphic drivers the problem was gone. http://octave.1599824.n4.nabble.com/Problem-with-Print-under-Octave-3-8-1-under-windows-tp4664755.html
 
* A user had problems printing with fltk in windows. After he updated the graphic drivers the problem was gone. http://octave.1599824.n4.nabble.com/Problem-with-Print-under-Octave-3-8-1-under-windows-tp4664755.html
 +
 +
== Test script ==
 +
 +
{{Code|FLTK printing test script|<syntaxhighlight lang="octave" style="font-size:13px">
 +
close all
 +
graphics_toolkit fltk
 +
h = plot ([0, 0.5, 1], [0, 0.5, 1], '-sb');
 +
set (h, 'markerfacecolor', 'b', 'markersize', 20, 'linewidth', 4)
 +
hold all
 +
h = plot ([1, 0.5, 0], [0, 0.5, 1], '-or');
 +
set (h, 'markerfacecolor', 'r', 'markersize', 20, 'linewidth', 4)
 +
set (gca (), 'color', 'c')
 +
title ('Cyan background, black axes. A red line with circle markers above a blue line with square markers.')
 +
print -depsc junk1.eps
 +
 +
# Bug 35648, is this a representive test for this? What is the desired output?
 +
close all
 +
hp = patch([1 1 2 2],[1 2 2 1], [1 0.8 1]);
 +
grid on;
 +
set(gca,'layer','bottom');
 +
title ('Please describe what we should see')
 +
print -depsc junk2.eps
 +
 +
}}

Revision as of 02:11, 25 July 2014

THIS PAGE IS A STUB

This page should help with debugging plotting and printing issues and to collect important information which should be included into bugreports or when asking on the mailinglist.

Basics

  • Operating system:
    • Windows: Is it XP 32bit or 64bit? Windows 7 or 8?
    • GNU/Linux: Have you installed Octave using your package system (apt-get, yum..) or compiled from source tarball?
  • If you get a warning on startup, for example "warning: function xyz.m shadows a built-in function" please copy it verbatim
  • If you get an error message, please copy the message verbatim

I can't plot or print or the output doesn't look as expected

Please create a simple, as small as possible example which shows the problem so others can reproduce the problem on their system and help you. Upload a screenshot (together with the script) if you can't describe it with words.

  • Sometimes the figure on the screen visually differs from the file generated with "print". If this is the case please mention this and consider adding a screenshot of the figure window together with the generated print.
  • Which toolkit are you using? Execute 'graphics_toolkit' in octave to query it. Common toolkits are 'fltk' or 'gnuplot'. Consider switching to another available toolkit (see available_graphics_toolkits) and try it there. You have to execute (for example switch to gnuplot) 'graphics_toolkit gnuplot' before any plotting command.

printing with gnuplot

Try

 print("testplot.eps", "-debug")

and attach the generated octave-print-commands.log, debug message and testplot.eps.

printing with fltk

A common problem is that printing with fltk only works if the figure is visible, see [1]

some Windows issues

Test script

Code: FLTK printing test script

{{{2}}}