我正在使用Gnuplot生成直方图,但如果值超过/低于特定值,我需要将其中的一些颜色换成另一种颜色.例如,如果值<10,则将特定直方图着色为绿色.如果值> 10,值<20,则将特定直方图着色为黄色.如果值> 20,则颜色直方图为红色.
所以我想图表是这样的:
x. y . 颜色
1.4.绿色
2.15.黄色
3.40.红色
值(x和y)来自数据库,所以我无法告诉Gnuplot我想要着色哪些x值,因为值会不时变化.
我能用Gnuplot(和php)完成这个吗?
谢谢!
我有一个看起来像这样的文件:
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)
我想让每个字符串用冒号分隔,作为每个循环的每一行的变量.
我在底部有一个可滚动的文字和广告,但是广告并没有一直到底部。尝试过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)