gnuplot graph misplaced on canvas - output

I need to have a graph in a specific format. I am using Gnuplot and try to use the size and terminal size to change the size of my output. However, Gnuplot does some really weird stuff and I don't know how to change things...
I am using Gnuplot Version 4.4 Patchlevel 3.
Here is a minimal example:
reset
set size 1
set terminal postscript enhanced color solid linewidth 1 size 15cm,10.5cm font "Helvetica" 16
set output "C:/..."
set encoding iso_8859_1 #for special characters
set xrange [2.05:3.13] #2. Achse
set yrange [1.5:2.1]
set border 3
set key spacing 1.5
set pointsize 0.6
plot '[...].dat' using 1:2 notitle with points pt 7 lc rgb "#000000" pointsize 1
that gets me the following output: http://i.stack.imgur.com/Z78gF.jpg
The graph is halved in size and starts in the middle of the canvas. I cannot change the position by using margins... I thought it might be a problem of size so I set set size 2 which then gave me http://i.stack.imgur.com/Ov5Ha.jpg . The graph still starts in the middle left and extends way over the boundaries, while most of the canvas stays white...
I have no idea what's going on and tried all kinds of stuff, but still, the picture won't start in the bottom left corner but somewhere in the middle, being shrinked in size... Somebody had the same problem?
I just want to get a Gnuplot figure of the size 15 cm x 10.5 cm - it can't be that difficult, can it be?
Thanks a lot!

After some messing aroung with gsview and gnuplot I found a solution that works for me that includes basically 4 steps:
1) use eps or even postscript, it doesn't really matter. Do not use the set size command. I used eps and it looks very good, here is one proposition:
set terminal postscript eps enhanced color solid linewidth 1 size 15cm,10.5cm font "Helvetica" 22
leave the ret as it was and go to
2) GSView: First check "Options - Show Bounding Box".
Use the commands under "Orientation" to orient canvas and figure so they match each other. This is usually landscape!
Now enter "Media - User Defined" to create a canvas that fits your needs. My figure is 15 by 10.5 cm and my canvas needed to be something like 17 by 12.5 cm.
3) Use b, t, l and r margins to move your figure on the canvas.
4) convert to pdf and take a look at the pdf if it matches your expectations.
I hope this is helpful for some people! It's probably quite a workaround but doesn't take so much time. Maybe it's not very helpful for automatisation...

Related

How to fix the map layer scale size in mapserver(ms4w)

Sample layer map file is:
LAYER
NAME "abc"
STATUS OFF
CONNECTIONTYPE POSTGIS
CONNECTION ""
DATA ""
TYPE polygon
TRANSPARENCY 100
MINSCALEDENOM 1
MAXSCALEDENOM 4000
METADATA
"fields" "layer"
END
CLASS
NAME 'abc'
MINSCALEDENOM 1000
MAXSCALEDENOM 4000
STYLE
OUTLINECOLOR 21 58 224
COLOR 151 219 242
END
END
END
How to fix the map layer scale size of 1:4000 ratio In map file of map script mode in Map Server(ms4w)
can any body help me ?
It is doable but requires a lot of effort to do so.
It is challenging because the scale is the default parameter for WMS getMap operation. The generic WMS getmap operation with a bbox with two coordiantes comes with a width and height as the output parameter. Without knowing what the output width and height will be, it will be hard to simply
The bbox of two pairs of coordinates and the width and height are the parameters decided what is the scale of the output image.
Imagine we have an interest area and a fixed scale at 1:4000.
So in some part of the system we need to get the height and width of the output in a situation like a window in a front end application or a print map extend. we will need to calculate the center point of the area/shape for the output, then recalculate the bbox coordinates based on pixels to the center point in width and height. Then use the new two pairs of coordinates and the height and weight to do the wms getmap request.
In this way the center part is still remain in the middle and the bbox may changed to make sure the scale is fixed as expected.This is complicated at server side using mapserver alone but can be easily managed by using other applications/APIs like OL3,leaflet,ArcGIS Javascript API etc. which has the function to force the output to be in a fixed scale.

Large ratio values ssrs chart

I have a bar chart that show the count of number of models for each agency,
The problem is that I have a large difference between the values that makes the report to look not so good.
Does anyone have any ideas of a good way to resolve this problem?
Have you considered using a logarithmic scale?
With your chart Right-click the y-axis, and click Vertical Axis Properties.
In Axis Options, select Use logarithmic scale.
Leave the Log base text box as 10 (this is the scale most commonly used by logarithmic charts)
This will display a chart with a scale that goes up by a factor of 10 for each ‘unit’ up, so the distance between 1 and 10 is the same as that between 100 and 1000.
For example the shown dataset is displayed as this chart when using the logarithmic scale
This method is a simple and recognised way to clearly show values of widely different scales.
Update
If want an indicative bar for the vales that are 1 then you could use the expression
=iif(Fields!val.Value = 1, Fields!val.Value * 1.1, Fields!val.Value)
To make all values that are 1 equal to 1.1 so showing a tiny bar appearing a the bottom of the chart, as seen here
Unfortunately I don't know of a way to change that first 1 to a zero (formatting-wise). This is partly because you are now using a logarithmic scale and zero and negative values don't really exist. This is due to a fundamental property of logarithms in mathematics, that
LOG10(10)= 1
LOG10(1) = 0
LOG10(.1)=-1
Therefore, when you perform a log10 of zero, it just doesn't exist.

Targa image – damaged red and green channels

I've a problem with 16-bit targa file. I'm opening image and it colors are weird. It's problem with red and green channels – blue is fine.
How I can repair targa image, to look like on example? (first is original image, second is as must look.)
Image
EDIT: this answer gives results that look right, but won't be bit-identical to the original. Something weirder is going on.
You can make your corrupted image out of your original image by subjecting the red and green channels to a function that doubles the value, subject to wraparound:
F(r) = (r*2) % 255
F(g) = (g*2) % 255
These functions are not invertible, because more than one input value can map to the same output value. In particular,
F^-1(r) = {r / 2, r / 2 + 128}
But we can still try to recover the image if we're willing to tolerate some errors. We'll try to guess whether red (or green) should be high; if so, add 128.
Two pieces of information can guide our guess:
Is the blue channel high? Unless images contain strongly blue pixels, this is a hint that the red and green channels should be high, too.
Is there an adjacent pixel whose red (or green) channel is high, while this pixel's red channel is very low (say, less than 64)? This may suggest that both pixels are relatively bright, but this pixel's red channel got wrapped.
I recovered something very close to your original image using just the blue channel information to decide between r / 2 and r / 2 + 128, though it would probably be better using the neighboring pixels' red and green channels as well.
As a side note, one way this sort of problem could occur is if there were originally (say) 6 bits of red information, but only the least significant 5 bits were retained when the file was written. It would be useful to look at how these images were acquired to make sure that you're not chopping off the most significant bits of your R and G channels somehow.

How to create black and white 1 bit per pixel bitmap from component and print it to zebra printer?

I am writing simple application to print label with Zebra programming language ZPL and Flex. At current stage i want to print graphics and text as graphic. So the steps i need to perform is:
Capture BitmapData (black and white 1 bit per pixel) from spark
component like Label, for example. I think that i have to use BitmapData.draw
function, but i dont know how to make it black and white and 1 bit
per pixel;
Represent data in ASCII hexadecimal string.( For example 32x32 px
black rectangle will look like this
~DG000.GRF,00512,008,
,:::::::::::H07FLF80,:::::::::::::::::::::::::::::::,:::::::::::::::::::
*part of label design, exported by official Zebra Designer label editor)
where ~DG - Command to download graphic;
000.GRF - File Name and extension;
00512 - total number of bytes in graphic;
008 - number of bytes per row;
rest - is The data string defines the image and is an ASCII hexadecimal representation of the image. Each character represents a horizontal nibble of four dots.
I found an answer to step 2 using C# in following post -
How to generate a dynamic GRF image to ZPL ZEBRA print
I need about the same but written in ActionScript.
Thank You.
You are unable to make a BitmapData be 1 bit per pixel, instead you query it pixel by pixel by using getPixel() and check if it's dark enough to be called "black", if yes, act as if this "bit" is 0.

Text size in standart printable points

How can I set the text size (inside TextField) in standart CSS/printable points? According to the manual:
fontSize - Only the numeric part of the value is used. Units (px, pt)
are not parsed; pixels and points are equivalent.
As far as I understand, 1 pixel may be equal to 1 point only in 72 PPI case. So, actionscript just operating pixels (not the real points). My trouble is to get the actual text size that I can print. Any advices or solutions are welcome.
SWF is measured in pixels, moreover, is scalable, so 1 pixel can be 1 point now, 2 points a bit later (scaleY=scaleX=2), and an undefined number another bit later (removed from stage without dereferencing). In short, for AS there are NO "real points" since it does not know a thing about printers, while it knows about displays.