I'm using gnuplot 5.0 with term qt - Qt terminal. Now, when I plot (or splot) whatever I want I have always to follow this post command
set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb "white" behind
to set the background color to white. In fact, as default background color I have "black", so anytime I plot something, e.g.
set term qt
set pm3d
splot sin(x*y)
the output window has a black background, as below
Now, if i export the plot, it shows correctly the white background,
Since having an interactive term (such as qt) but can't interact with it is really annoying, the only possible way is to set manually the background color with the command set object or with the "Terminal configuration" tool, which anyway does not allow to change the color definitely
I've looked around, but nobody seems to know whether there's a command to change definitely the background color in qt terminal, so anytime I plot with tis term I have to change it manually.
Hope someone knows the solution!
Thx!
When you save a graph
gnuplot > save "test.plt"
and you open it, you will see that the file contains ALL the value for all the possible option for your graph.
Those information are the default of your graph and gnuplot under linux reads them in an hidden configuration file locate in the home and called .gnuplot
I suggest you to import to read this it gives you a nice one to use.
Using the above one as a model I created my personal one which is available here
Related
I'm using Qt5.6, I am drawing text on a video window, however sometimes the text is not very readable due to the video content in the window. I'm current drawing the text on the painter context with the 'drawText' method. Whilst I can set the pen colour which controls the fill, I do not seem to be able to set an outline colour.
I would like to draw the text with a black outline to make it stand out. Unfortunately firewall where I am working makes life very difficult and any useful web-site that might help, seems to be blocked, hence this post.
Thank you,
Try using QPainterPath::addText().
You can add the text to a path, then QPainter::fillPath() and QPainter::strokePath() the path.
Or you can direcly use QPainter::drawPath() with a brush and pen set.
I am looking to change the background color of a button in my GUI application to default.After searching online, i saw that
button1.SetBackgroundColour(wx.NullColor) does not seem to work. I am using python 2.7.
Is there any other way I could set it to default color with out using system colors
A little late, but maybe someone else has the same problem.
Did you try
button1.SetBackgroundColour(wx.NullColour)
So, write "Colour" instead of "Color", the non-American writing. This worked for me.
If wx.NullColour doesn't work, a solution is to decode the RGB code for the colour you seek and apply it to your background.
E.g. the background color on my wx GUI is the light grey from Windows, its RGB code is R=240, G=240, B=240 (you can measure this using Paint for instance).
Then this should work:
button1.SetBackgroundColour(wx.Colour(240, 240, 240))
Of course if you want your GUI to be portable on other systems this isn't the best option since this light grey is only the default colour in Windows.
With Python 2.7.17 and wxPython 3.0.2.0 the following seems to work:
button1.SetBackgroundColour('')
I think that the solutions do not work because wxPython works with a style system. I was able to change foreground & background colours with the SetStyle method.
I was styling a wx.TextCtrl where I needed to highlight the text I search for.
First, I stored the existing colours to variables.
bc = self.te.GetBackgroundColour()
fc = self.te.GetForegroundColour()
self.bcol = wx.Colour(bc[0], bc[1], bc[2], bc[3])
self.fcol = wx.Colour(fc[0], fc[1], fc[2], fc[3])
Change the colours with SetStyle
self.te.SetStyle(x, y, wx.TextAttr(wx.BLACK, wx.LIGHT_GREY))
And reset it back to the original colours:
self.te.SetStyle(0, -1, wx.TextAttr(self.fcol, self.bcol))
Here's the issue at hand. I need to be able to pick a background (an image showing an object, let's say, a starship model). I want to be able to apply various previously prepared textures to various areas on it, as some kind of a "colour your own object" app, but without the need to prepare dozens of individual segments.
Ok, so this is one, newbie way to do it. We have those images:
Two kind of different versions, an original photo and a quickly Photoshopped one. Let's say we only want the Borg-ish green deflector and warp nacelle from the second picture, without the odd pink hull. You have to have a mask, basicly an image of an equal resolution (or at least the same aspect ratio, which you can reliably scale to image's resolution), with the area filled with color (or whatever else), and transparent area everywhere else. As the mask, I've used a few strokes of brush on an empty layer, set to overlay mode, and then saved as PNG, with transparency. And this is how the code went:
First, import images.
QPixmap background("orig.png"); //import base image
//import alt version/texture/whatever you want, anything will work with a good mask
QPixmap element("alt.png");
QPixmap mask("deflector.png"); //mask. Just nacelles and deflector.
Then, isolate the area that interests us from alt version
QPainter painter(&element);
painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
painter.drawPixmap(0, 0, mask.width(), mask.height(), mask);
And finally draw it onto the target object.
QPainter inter(&background);
inter.drawPixmap(0, 0, element);
ui->label->setPixmap(background);
The result:
This method respects any and all transparency you could've done in Photoshop or another image editing software.
Simple, but an effective solution, for when your app has to work with graphics prepared by someone else, elsewhere.
I'm using MacVim and Vim-R to interactively edit and run R code. Everything seems to be working fine, but I can't seem to figure out how to set the background color in the tmux window that R runs in.
To be precise: I open up a .r file with MacVim. Then I type _rf, which causes XQuartz to start up, and a window with the title 'tmux' to open up with R running inside of it. When I highlight lines of code and send them to R from MacVim, everything seems to work fine. But the default background color of the tmux window is white, which makes the nicely colored output text hard to read.
How can I change the background color of the tmux window to something darker?
See this part of the doc to force your plugin to use the right terminal emulator.
If you don't want to do that (I think that you should), you can configure the appearance of xterm in the ~/.Xresources file. This guide gives you useful examples.
Does anybody know, if it is possible to hide the axis in a JavaFX ScatterChart object? Or can anybody think of a simple workaround? I didn't find anything related to this issue in the documentation of the ScatterChart object.
Unfortunately, they are kind of irritating in all kinds of graphs where the axis's values are not, per se, informative (e.g. distance configurations).
Note: the most simple solution to set the visibility attribute of the scales to false unfortunately did not yield the result I was longing for (actually it showed no effect at all).
When you say "Hide the Axis", I'm assuming you mean hide all the tick marks and tick labels. Please let me know if you mean different.
The first step would be to hide the tick labels - this is pretty straight forward:
xAxis.setTickLabelsVisible(false);
yAxis.setTickLabelsVisible(false);
The second step is hiding the tick marks and all the neat graphics stuff that goes along with the tick marks (like the background colors). The best way I found for doing this is through the CSS. So you'll need to create a CSS file (I created one called test.css and placed it in my project's base folder) and load it up. Loading it can be done like this:
sc.getStylesheets().add("test.css");
(where sc is the ScatterChart object)
This is the CSS code I used to remove all the visuals associated with tick marks:
.axis-tick-mark,
.axis-minor-tick-mark,
.chart-vertical-grid-lines,
.chart-horizontal-grid-lines,
.chart-vertical-zero-line,
.chart-horizontal-zero-line {
-fx-stroke: transparent;
}
.chart-alternative-row-fill, .chart-alternative-column-fill{
-fx-fill: #f5f5f5;
}
Oracle puts out a great CSS reference for JavaFX - but in addition to that, I would recommend downloading the default CSS JavaFX uses. Looking at the default helps tons. You'll find instructions in that link under the "Default Style Sheet" section and also on the web with caspian.css for JavaFX 2.2 and modena.css for Java 8.