I have some input data from a file looking like this:
06.03.2020 62,30
09.03.2020 60,16
10.03.2020 59,94
11.03.2020 59,34
12.03.2020 56,58
13.03.2020 56,37
I am able to plot the data how I want to, but as the input data and the resulting graph will be updated automatically I would like to display the up-to-date status of the graph and input data by printing the last value of column 1 as a label in the graph.
So far I have tried something like
set term unknown
plot [:][:] input.txt using (xlast=$1):2
set terminal qt
set label xlast at graph 0.025, graph 0.95 left
plot ...
but I did not manage to get an output to the graph.
Can someone please help me out?
Thanks
Try to use strcol(1), I guess $1 tries to extract a number.
Code:
### last value of column to label
reset session
$Data <<EOD
06.03.2020 62,30
09.03.2020 60,16
10.03.2020 59,94
11.03.2020 59,34
12.03.2020 56,58
13.03.2020 56,37
EOD
set table $Dummy
plot $Data u (LastX=strcol(1)) w table
unset table
set label LastX at graph 0.025, graph 0.95 left
plot $Data u 0:(rand(0)) w l notitle
### end of code
Result:
Related
I have 2 lines as measure values and I would like each line having their own % information but I cannot do that as a Text. Any workaround to get it to work?
Tableau file sample:
https://www.dropbox.com/s/1upehg61rg5psas/Percentage_on_success.twbx?dl=0
You should try a dual-axis with your two line measures and put the bars as reference lines. See this as an example. You can't independently control the Text on "Measure Values" because it is treated as a single measure.
I've created a simple line graph in tableau. I'd like to add a drop down box where I can select from to change the line graph's X axis? How do I go about doing this?
Thanks!
Create a parameter str datatype and put dimension name you want to change.
then create a calculated field named x-axis
and use a
case parameter
when 'dim1' then dim1
.
.
end
put this calculate field on x-axis
I use this code to extract from the image the delimitation between a homogeneous part of the image made of 0 of another part made mostly of 1.
I would like to know how to get automatic code. I can explain this: I find the delimitation in this case because I find manually where to place my mask (from column 500) mask (:, 500: end) but I want to find the value ' 500 ' automatically so that this code can be done whatever the image I give it.
So how can I automate the creation of my mask?
img=imread('imgage.png');
figure, imagesc(img),
mask=false(size(img));
mask(:,480:end)=true;
seg = region_seg(img,mask,1000);
figure, imshow(seg);
SE =strel('disk',6);
D=imopen(seg,SE);
imwrite(seg, 'mask.tif')
bw=edge(D);
figure,imshow(bw)
You can achieve this by binarizing, eroding, dilating the image. This will create a "big blob" where there is information in the image, and where is not. You grab the first point where the information is, and voila!, there is you line.
img=imread('https://i.stack.imgur.com/uP973.png');
imgg=rgb2gray(img);
imgbw=im2bw(imgg,graythresh(imgg));
SE = strel('disk', 2, 4);
imgbw=imerode(imgbw,SE);
imgbw=imdilate(imgbw,SE);
[~,indy]=find(imgbw); %slow
indy=min(indy);
% just to show
hold on
imagesc([img]);axis ij; axis tight
plot([indy indy],[1,size(imgg,2)],'red')
I am trying to plot a graph like in attached image ,using tableua by getting data from a text file .
It is having 3 fields Datetime ,track ,inuse
We have 43 different track sizes.Need to plot graph for each track with all in a single graph.
Please help me out.
This should be easy to do in tableau. Try putting time on columns, "inuse" on rows and "track" on color.
I do not have your data but am using the data that tableau desktop ships with. Here is what it looks like with the superstore demo data:
To display the labels, also place track on the label shelf. If you then click on the label shelf, you can choose options about where to display them. To mimic your example, label the line ends.
I want to export matlab output to an excel file starting from G2 column and for this the code i had written is exporting the data correctly but not to the desired location .It is printing in 21st number of rows rather than 2nd.
the code is
ResultFile = xlsread('filename');
sz= size(ResultFile,1);
b= num2str(sz+1);
location = strcat('G2',b);
fprintf('value in location is %g\n',location);
xlswrite('filename',fnlarray,'Sheet1',location);
In the command
xlswrite(filename,A,sheet,xlRange)
you can either specify xlRange as a string defining the corners of the desired output region, or (provided that you have specified the sheet) only give the coordinates of the upper-left cell. If you want to write an array to a region "below and to the right of G2", this should be enough:
location = 'G2';
Concatenating 'G2' with the number of rows of the excel file + 1 does not really seem to make sense to me right now.