小编Kev*_*vin的帖子

Gnuplot中某些特定值的不同颜色的颜色条

我正在使用Gnuplot生成直方图,但如果值超过/低于特定值,我需要将其中的一些颜色换成另一种颜色.例如,如果值<10,则将特定直方图着色为绿色.如果值> 10,值<20,则将特定直方图着色为黄色.如果值> 20,则颜色直方图为红色.

所以我想图表是这样的:

x. y . 颜色

1.4.绿色

2.15.黄色

3.40.红色

值(x和y)来自数据库,所以我无法告诉Gnuplot我想要着色哪些x值,因为值会不时变化.

我能用Gnuplot(和php)完成这个吗?

谢谢!

php graph gnuplot

2
推荐指数
1
解决办法
2032
查看次数

循环遍历带冒号分隔字符串的文件

我有一个看起来像这样的文件:

work:week:day:england:
work1:week:day:sweden:
work2:week:day::
..... 
Run Code Online (Sandbox Code Playgroud)

每次我遍历列表我想要每个字符串作为一个变量,我可以使用.例如,如果我想知道我在哪个位置工作,我会从第一列"work*"获得第四个位置列

我试过这个:

for country in $( awk -F '[:]' '{print $1}' file.txt); do
    if [[ "$country" == "england" ]];
    then
            echo "This user works in England!"
    else
            echo "You do not work in England!"
    fi
done
Run Code Online (Sandbox Code Playgroud)

我想让每个字符串用冒号分隔,作为每个循环的每一行的变量.

bash awk loops

2
推荐指数
1
解决办法
1555
查看次数

广告不会停留在底部

我在底部有一个可滚动的文字和广告,但是广告并没有一直到底部。尝试过RelativeLayout,但如果我使用它,则广告会停留在屏幕中间。已经玩了很多,但是似乎无法让它停留在底部并在屏幕的其余部分填充可滚动文本。

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/box_background"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">



   <ScrollView
       android:id="@+id/ScrollView01"  
       android:layout_height="wrap_content"
       android:layout_width="fill_parent"
       android:padding="30dp">

    <TextView
        android:id="@+id/Button_2_Text"
        android:textColor="#000000"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textStyle="bold"
        android:textSize="17dp"></TextView>
        </ScrollView>

    <com.google.ads.AdView 
    android:gravity="bottom"
    xmlns:ads="http://schemas.android.com/apk/res/com.aurumlabs.excuses"
    android:id="@+id/adView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    ads:adUnitId="a14f19b3aec0a93" 
    ads:adSize="BANNER"/>
    </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

android admob android-layout

0
推荐指数
1
解决办法
847
查看次数

标签 统计

admob ×1

android ×1

android-layout ×1

awk ×1

bash ×1

gnuplot ×1

graph ×1

loops ×1

php ×1